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

31 Oct. 2024 - - Total Reads 3,163

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: 3.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 184 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

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

Testimonials

Metricon recently worked with AndMine on a major online brand promotion. We were impressed with AndMine’s thinking from concept stage through to campaign execution. We would not hesitate to brief AndMine again on future projects. Yvonne Abood, Marketing Manager, Metricon Homes

More Testimonials
AndMine-Google-Partner-Signature