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

31 Oct. 2024 - - Total Reads 3,164

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: 3.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 184 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

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

Testimonials

You guys have been absolutely amazing to work with and we are extremely happy with the website and how it has come to life. Thank you for all your hard work and dedication in getting this live on our set date and for assisting us and being patient with us with all the changes we have requested.

Katarina Heath , LifeChanger Foundation

More Testimonials
AndMine-Google-Partner-Signature