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

31 Oct. 2024 - - Total Reads 2,850

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

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

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