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

31 Oct. 2024 - - Total Reads 2,703

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

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

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

Testimonials

The AndMine team have been delivering our digital strategy and online services for many years now. Strongly commercially aware they know our industry well and have consistently delivered winning results for Matchbox. David Cohen, Owner, Matchbox

More Testimonials
AndMine-Google-Partner-Signature