Why Does AI keep “Forgetting” Things, like Code Segments or Parts of the Discussion ?

31 Oct. 2024 - - Total Reads 2,443

Why does AI keep forgetting things

One of the most misunderstood aspects of enterprise AI is how quickly and completely it forgets. Tools like ChatGPT, Claude, or Gemini may sound like they understand and recall information, but under the hood, these models are stateless. Each call to the API is a blank slate. There’s no memory of previous chats, no knowledge of user preferences, and no continuity unless you explicitly build it yourself. This is a major issue when building AI for customer service, sales assistance, coaching tools, or anything requiring follow-up or context.

At a technical level, the AI model only sees what you send in the current prompt. If you want it to remember something, you have to feed that memory back into the prompt each time. That means memory management is not a model feature — it’s an application architecture responsibility. So how do we solve this?

Step 1: Identify and Persist User Identity

Start by assigning every user a unique ID (UUID, email, or account number). On each interaction, log the conversation using this ID.

Step 2: Store and Retrieve Memory

Use a SQL database or a vector store (e.g. Pinecone, Weaviate) to keep chat history, user preferences, or extracted facts. For scalability, embed and store text as vectors, allowing retrieval by semantic similarity.

Step 3: Summarise if Needed

If token limits are an issue, summarise history before sending to the model. Use a separate LLM or prompt to condense.

Step 4: Inject Memory into Prompt

Now you can construct a prompt dynamically, layering in both current user input and summarised memory:

Additional Tips:

Use embedding models (e.g. OpenAI’s text-embedding-3-small) to vectorise long-term memories

For real-time apps, keep for example, recent 2–3 interactions inline; archive older history

Use tools like LangChain or LlamaIndex if you want to manage memory pipelines more easily

If you’re serious about building context-aware AI tools, memory is not optional — it’s foundational. It also separates production-grade systems from flashy demos. As Robert Cialdini teaches in pre-suasion, success comes from what happens before action. This architecture is your pre-suasion: the groundwork that ensures your AI delivers value users remember. Want to fast-track your build with a team that’s solved this? Contact AndMine.

Michael Simonetti, BSc BE MTE
Posted by:

Post Reads: 2.4K

Share this

Go on, see if you can challenge us on "Why Does AI keep “Forgetting” Things, like Code Segments or Parts of the Discussion ?" - Part of our 183 services at AndMine. We are quick to respond but if you want to go direct, test us during office hours.

Add Your Comment

Trusted by

Ebay
ISO CERTIFIED 27001
intowork logo
Scrum.org
Forbes
Catholic Insurance
Melbourne Heart
Atlantic Group of Companies
NextTech
Ubertas Group
Craft CMS
Think & Grow Rich Inc
DUSA, Deakin University Student Association
ATT logo
CB Richard Ellis
VISSF
Appstore
Switzer Media+Publishing
Parker Lane
Mecca Brands
Madman Entertainment
skillhire logo
Passage To India
WTFN
SwinBurne University of Technology
Cronos Australia
Focus On Furniture
Cleanfit
The Royal Melbourne Hospital
Shell
Australian Physiotherapy Association
OJAY
Dinosaur Designs
SunSense Digital Agency
interact logo
Wild Rhino Shoes
Fresh Cheese Company
NGS Super
Engine Swim
Boston Consulting Group
BlackMores
Marshall White
Novvi
Kadac
The Canberra Times
liberal
Tomorrow Stars Basketball
Bulk Nutrients
Movember
Jalna
work and training logo
Schiavello
Australian Anthill
QV Skincare
Gilbert+Tobin
Garmin
Acquia Certified Site Builder Drupal
help logo
MyAccount
Rackspace
Plants
Sports Power
Mamma Lucia
GooglePlay
Unsw Australia
Launtel
The Age
Fit My Car
National Relay Services
Bank of Cyprus
Positive Poster
Naturtint
Mark Alexander Design
Green St Juice CO
itfe logo
The Burger Cheese
CAN- Common Wealth Bank
NMI Insurance
Telstra
Carlton Football Club
Inferflora
Fairfax Media
POSTER Magazine
AC/DC
aga logo
Federation Square
Tek Ocean
HGG 
Florsheim Shoes
Melrose MCT
National Museum of Australia
Globird
LBG Australia and New Zealand
Toni&Guy
King Wood Mallesons
Victorian Government
Loan Market
Celebrate Health
Maxine
Moov Head Lice
Grays Ecommerce
Sunday Creek
ctc logo
SMH – The Sydney Morning Herald
Drupal
Bintani Australia
Xavier
Engineers Without Borders
Smart Company
GPT Group
Metricon
Associated Press
Macmillan Publishing
Palace Cinemas
Brisbane Times
mas national logo
Natralus Australia
Castran Gilbert
Hairhouse Warehouse
Elucent
Magento Solution Specialist
Peter Mac
Google
Aqium Gel
French Tables
James Buyer Advocates
ABC
Matchbox Homewares
Taylor Rose
Jetstar
Ello
nextgenskills logo
CCI
Melbourne Sports and Aquatic Centre – MSAC
Windsorsmith
Rydges
Melbourne Central
findstaff logo
Paypal
ADP Payroll
ISO Certified
Gadens
Heat Holders
Toy World
Oracle
Hanover
intojobs logo
Crumpler
High Street Armadale
Royal Freemasons
MAP
The University Of Melbourne
Instant RockStar
Chia
Cell Therapies
Grainshaker
Street Kitchen
DeeWhy Market
Van Egmond Group
Kay&Burton
White Suede
Dial Before You Dig
Bigcommerce
Adobe Professional
Fast.co
Arthur Galan
Microsoft Certified Azure Fundamentals
nara logo
Oakdale Meat Co
Grow Your Business
iPrimus
Max’s
Beaumont
Australian Government
Thomson Geer
Melrose Health
McArthur Skincare
One Shift
Vitura Health
Cooper Mills
Australian Organic Food CO
News
Federation University Australia
OMS – Order Management System
OpenAI
ACTUATE IP
Uber
Watches of Switzerland
Bolle Safety
Coles
Banki Haddock Fiora
Bostik
Tassal
The Fortune Institute
Etihad Stadium
TPP
Eway
Amino Active
RMIT University
Vendor Advocacy Australia
Tribe
Passage Foods
Arc One
learning partners logo
Viktoria & Woods
131 Pizza
htn logo
Herbert Smith Freehills
kestrel logo
Bondi Sands
Ego Pharmaceuticals
Rock Pool Group
Magento
PranaOn
21st Century Australia Party
Macpherson Kelley
University of South Australia

Testimonials

I wanted to thank you and your teams for the responsiveness and quality of the work you have done for the french version of the site. We had a very good feedback on the quality of the site from our French network. Vincent Berlinet

More Testimonials
AndMine-Google-Partner-Signature