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

31 Oct. 2024 - - Total Reads 2,179

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

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

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

Testimonials

Michael has a wealth of knowledge in business development and management, especially online businesses. His passion and experience in this fast growing and emerging industry is unrivalled.

Dr Viet Le,Lecturer at Swinburne University

More Testimonials
AndMine-Google-Partner-Signature