App builders shipping LLM chat
Conversation continuity for LLM chat
Keep a chat coherent across turns, sessions, and days without stuffing the whole history into every prompt.
In short
Memorg stores each exchange under a session and retrieves only the most relevant, recent, and important context back into the model window — so a returning user is remembered without re-sending the transcript.
The problem
- ✕The transcript outgrows the context window, so you truncate and the assistant forgets earlier turns.
- ✕Re-sending the whole history every turn burns tokens and still loses the thread on long threads.
- ✕A user who returns tomorrow starts from scratch — there is no memory that survives the session.
With Memorg
- ✓Store every user/system exchange under a session keyed to the user.
- ✓On each turn, call search_context() to pull back only what is semantically relevant, recent, and important.
- ✓Results are trimmed to the token budget you set when creating the session, so the prompt always fits.
How it works
- 1
Create a session per user
system.create_session(user_id, {}) scopes all memory to that user and sets the token budget for retrieval.
- 2
Record each exchange
After every turn, store the user message and the assistant reply as an exchange under the active conversation.
- 3
Retrieve before generating
Call search_context(query) to fetch the blended top-k context, then prepend it to your prompt.
- 4
Resume next time
Reopen the session by user id and the same memory is there — no transcript replay needed.
Features it uses
See the full feature set or how it works.
FAQ
+ Do I have to send the whole chat history each turn?
No. That is the point of Memorg — you store exchanges once and retrieve only the relevant slice back into the window, so token usage stays bounded as the conversation grows.
+ How does a returning user get remembered?
Sessions are keyed to a user id and persisted in the SQLite file. Reopen the session and its memory is available immediately, no replay required.
Related use cases
Upgrade naive RAG to structured recall
Move past a bare vector store to retrieval that understands users, sessions, recency, and importance.
→A memory layer for your agent
Drop deterministic recall next to any orchestrator without adopting a whole agent runtime.
→Support bots that remember the customer
Give a support assistant per-customer recall so it stops asking for context the customer already gave.
→Put it to work
Install Memorg and wire this pattern into your app in a few lines.