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

31 Oct. 2024 - - Total Reads 2,098

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

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

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

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