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

31 Oct. 2024 - - Total Reads 2,891

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

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

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

Testimonials

The guys at &Mine are one step ahead and have made the process pleasant and stress free. All credit to them and their great working culture because I expected the process to be awful. I am looking forward to taking this project live and doing more business with &Mine. Lauren Brown, Director, Motto fashion

More Testimonials
AndMine-Google-Partner-Signature