Four-level hierarchy
Sessions hold conversations, conversations hold topics, topics hold exchanges. Retrieval can scope to a topic, a conversation, or a whole user history instead of dumping everything.
Features
Memorg is a small, deliberate surface: a hierarchy that scopes memory, retrieval that blends similarity with recency and importance, and a single file you own. Here is the whole feature set.
Memory that knows who and what it belongs to.
Sessions hold conversations, conversations hold topics, topics hold exchanges. Retrieval can scope to a topic, a conversation, or a whole user history instead of dumping everything.
Store documents, notes, or arbitrary tagged blobs alongside chat. The hierarchy is the default surface, not a cage — search across types or scope to one.
A session is keyed to a user, so memory is naturally scoped and portable. Reopen a session and its context is there.
Semantic recall that understands recency and importance.
Every exchange and item is embedded with an OpenAI model and indexed in USearch, so search returns the most relevant context, not the most recent by default.
Results are re-scored with a fixed blend of semantic similarity, recency, and importance. No LLM reranker in the default path — the same query returns the same ordering.
A token counter fits returned context to the model window you set when creating the session, so the LLM gets the most useful payload that still fits.
One file. No managed service.
Hierarchy, metadata, tags, and source content live in one SQLite file you can copy, version, and back up with cp.
A fast, native nearest-neighbour index embedded in the same store. The interface is small and pluggable if you outgrow it.
Memorg runs in your process. No separate vector database, no control plane, no service to operate to develop or ship.
Drop it next to whatever you already run.
Memorg is a small Python surface you call from any handler or orchestrator. It does not own your prompts, tools, or agent loop.
A FastMCP server exposes Memorg to Claude Desktop, Cursor, and any MCP-aware host so they can read and write memory without bespoke glue.
Embeddings and chat go through an OpenAI client. Swapping the embedder is a contained change because the vector-store interface is small.
These features are all one library and one file. The architecture page walks the request path end to end.
Browse concrete use cases — chat continuity, RAG upgrades, agent memory, and more.
See where Memorg sits next to Mem0, Letta, and Zep — including where they win.
Install Memorg, point it at a SQLite file, and call search_context() when you need memory.