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

31 Oct. 2024 - - Total Reads 3,329

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

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

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

Testimonials

Not only is Michael professional but he is also a great friend to have in your court. He is balanced in his advice, fair in his quotes and has the best twitter feed for all things tech - i highly recommend you follow him and also hire him! Clare Smith, GM – Brand & Marketing Communications at Sensis

More Testimonials
AndMine-Google-Partner-Signature