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

31 Oct. 2024 - - Total Reads 2,206

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

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

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

Testimonials

I work with AndMine for my web development and website content management. Changes are always made quickly and I'm kept in the loop at all times - the website continues to generate awesome results. Jason Digby, Eatmusik

More Testimonials
AndMine-Google-Partner-Signature