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

31 Oct. 2024 - - Total Reads 2,666

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.7K

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

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

Testimonials

AndMine's Marketing Software ensures we stay on-brand no matter who in our office creates the campaign. We love that AndMine take all the IT complexity out of our online marketing so we can focus on results Emma Gleeson, QV Skincare

More Testimonials
AndMine-Google-Partner-Signature