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

31 Oct. 2024 - - Total Reads 2,491

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

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

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

Testimonials

The &Mine team is great to work with and went beyond the brief to deliver a family violence website which was both engaging and easy to use. The team is collaborative, understand the constraints and sensitivities of a government environment and work alongside you to develop creative and practical solutions and ideas. Stakeholders have only had positive feedback about the website including with comments such as the best government website I have seen. Christine Panayotou, Director Communications, Family Safety Victoria

More Testimonials
AndMine-Google-Partner-Signature