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

31 Oct. 2024 - - Total Reads 2,555

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

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

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

Testimonials

We aren't exactly 'IT savvy' but AndMine's Marketing Software is simple to use and the guys are always there to help us out. We send out eNewsletters and automated Birthday offers with ease, keeping the restaurant busy and our 10,000+ members happy. All The Team, La Camera Restaurant

More Testimonials
AndMine-Google-Partner-Signature