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

31 Oct. 2024 - - Total Reads 3,399

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

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

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

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