Individual RAG: prioritizing a prospect's memory
Most RAG implementations retrieve global context: the nearest chunks across the whole knowledge base.
For a sales agent, that's not enough.
The problem
When a prospect replies to a message, there are two kinds of useful context:
- Their individual memory — what they've said before, their objections, the budget mentioned, the agreed next step.
- The knowledge base — the offer, pricing, scripts that work.
Individual context has to take precedence. If the prospect mentioned a budget of 100,000 XOF three days ago, the model needs to know that before talking price.
The implementation
Each prospect has a dedicated markdown file, automatically updated after every conversation:
~/Brain/.../conversations/22967xxxxxx.md
This file holds the facts the LLM extracted: budget, objections, interests, next step.
At retrieval time, the prospect's phone number filters the results:
// Priority to chunks from THIS prospect
const results = await topK(embedding, 5, { phone: prospect.phone });
// Not enough individual context → fill in with the global base
if (results.length < 3) {
const global = await topK(embedding, 5 - results.length);
return [...results, ...global];
}What it changes
An agent without individual memory answers from the general knowledge base — correct but generic.
An agent with individual memory doesn't repeat what's already been said, doesn't reopen an objection already resolved, doesn't offer a price the prospect already negotiated down.
Consistency across a long conversation comes from this.