I read an interesting article about continuous learning for agents.
A core problem working with LLMs is they don’t remember unless you create memory for them. The idea is to accumulate structured knowledge in a retrieval layer, instead of fine tuning or changing the model itself.
For example a research agent that saves information from past questions. Instead of point-in-time research each time, the agent understands the principles in findings, compares to similar questions from the past and saves relevant information for the future.
I discussed this with Claude and it got excited, and there’s no better way to understand deeply than to build! So we built a research agent inspired by the article.
The Principles
- Snapshots - Each question is saved as a snapshot in DB with semantic search
- Conciseness - The model distills raw information and saves clear claims
- Comparison - If the same claim appears again in new information we can identify it
- Tracking - If the same claim repeats several times its confidence strengthens
What Gets Saved in DB
- Snapshot - The question + embedding for semantic search
- Claim - Structured claims from research results
- Sources - Where each claim came from
The Flow
- User asks a question - “What is RAG?”
- After embedding the question, the agent searches for similar questions
- The agent searches the web for information and extracts key claims, saves each claim with confidence level
- The agent compares new claims to old ones: What’s new? What strengthened? What disappeared? (Updates, changes confidence, removes what’s not relevant)
- Presents results to user and saves snapshot for next time
Where Learning Happens
After each research the agent saves claims with embeddings to pgvector DB. When a new question arrives the agent checks if there are similar questions from the past. If there are similar questions it compares the findings.
After the agent was running we built it an interface with FastAPI to see the entire process.
Additional Application: Insights from Conversations
In the end I created with Claude Code a similar mechanism for conversations with it: a /command that instructs it to extract insights from our conversation and save them in a dedicated folder.
Same principle - insights that repeat strengthen, duplicates are filtered.
Why This is Useful
This approach is useful for various domains like market research, policy, business intelligence, technical information and any field that evolves and includes changes and opinions.
It’s very interesting to understand how to optimally use LLM power, build systems and tools around it, examine and expand its boundaries and mine ;)