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

31 Oct. 2024 - - Total Reads 2,707

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

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

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