COSMOS
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π¬π§ English | π«π· FranΓ§ais
COSMOS
Contextual Object Storage & Memory Over Sessions
Your AI forgets everything between conversations. Pasting all your notes into every prompt works... until it doesn't.
COSMOS gives your assistant a memory that lives outside its context window.
Built by Liam DB β with the help of AI.
The COSMOS web app on an example project: a star is a category, a planet is a memory.
COSMOS is an MCP server. Any assistant that can call tools (Claude Desktop, a local model...) writes its memories into a local SQLite file and gets back only the few that matter for the question.
π§ Two layers Short summary always available, full text on demand
π Search by meaning Finds rephrased questions, in 12 languages
π 100% local One SQLite file, no cloud, no account
ποΈ Auto categories They grow with use, priority ones load at conversation start
πΈοΈ Memory graph Links by topic and by time
π 2D / 3D app See your memory as a sky of stars and planets
Why COSMOS
We compared COSMOS with the usual approach (pasting the whole notes file into the prompt) on 8 open models (1.7B to 8B parameters), 298 questions per model and per setup, with about 200 memories stored.
Whole | COSMOS | |
Tokens sent per question | β 4,750 | β 210 (Γ23 fewer) |
Time per answer | β 7.9 s | β 0.75 s (Γ11 faster) |
Right memory in the top 3 of the search | β | 97% (95% with 1,700 memories) |
Models where it wins Β· ties Β· loses | 4 Β· 2 Β· 2 |
COSMOS is not better everywhere: it loses against the full file on Llama 3.2 3B and Qwen3.5 4B. The honest details, the method and the limits are in benchmark-cosmos/ and on the website. Full methodology (PDF): data, setups, scoring, statistics and limits.
Related MCP server: MCPMem
What it's useful for
A personal assistant that remembers you: your preferences, your rules, who is who, what you decided last week.
Project decisions: why you picked a database, a library or a design, and what it replaced.
A coding assistant with context: your conventions, your architecture choices, recurring mistakes to avoid.
Research and study notes: thousands of notes, and the assistant reads only the three that match the question.
Local and small models: a 2 to 8 billion parameter model has a short context window. COSMOS gives it a long memory without filling that window.
Team knowledge (several people sharing one
cosmos.db): not tested, but nothing prevents it.
Installation
Requirements: Python 3.10+ and git (no Git? download the ZIP from GitHub).
Tested on Windows. Linux and macOS are not tested yet. On Ubuntu/Debian,
install.pyneeds thevenvmodule first:sudo apt install python3-venv.
git clone https://github.com/DevLiamDb/COSMOS.git
cd COSMOS
python install.py --configureThen restart Claude Desktop. That's it.
install.py does everything for you:
creates a
.venvenvironment,installs the dependencies,
downloads the search model once (it then stays cached on your machine),
with
--configure, adds COSMOS to Claude Desktop (your old config is saved asclaude_desktop_config.json.bak).
Prefer to edit the config yourself? Run python install.py without --configure: it prints the block to paste in claude_desktop_config.json.
About the search model. COSMOS searches with Polaris, our own model (multilingual-e5-small fine-tuned on memories written for COSMOS). Polaris is currently private on Hugging Face: without a token, COSMOS automatically falls back to MiniLM, which works the same way. With access, set HF_TOKEN before running install.py.
Usage
1. Talk to your assistant
Once connected, Claude sees 22 cosmos_* tools. You don't call them yourself: the assistant does.
cosmos_write("We are moving the database to PostgreSQL: lower cost.")
β stored Β· category: Example Project Β· type: decision
cosmos_query("why did we change databases?")
β Database: switch to PostgreSQL (cost). β short summaries only
cosmos_recall(id)
β Team meeting: we are moving from Firebase to PostgreSQL because of cost... β full text, on demandTo make the assistant use COSMOS on its own, give it the instructions in cosmos-memory.md.
2. Priority categories β the "backpack"
Mark a category as priority (rules, preferences). cosmos_priority_context() returns all of it in one light call, to be run at the start of every conversation.
A "Decisions" star opened in the app: seven memories in orbit.
3. See your memory (web app)
cd webapp
bun install
bun devOpen http://localhost:3000. Search with Ctrl K, filter, edit, switch between 2D and 3D. The app reads and writes the same cosmos.db as the server.
4. Test it without an MCP client (optional)
set ANTHROPIC_API_KEY=sk-ant-... # PowerShell: $env:ANTHROPIC_API_KEY="sk-ant-..."
python scripts/chat_with_memory.pyA terminal chat that uses COSMOS as its memory (needs your own Claude API key, billed on that account).
5. Run the tests (optional)
.venv/Scripts/python -m unittest discover -s tests -vOn Linux or macOS (not tested yet), use .venv/bin/python.
COSMOS Manager (optional)
A tiny control panel to keep COSMOS on and manage it. No extra install: it runs with the same Python.
cosmos-manager.bat # Windows
./cosmos-manager.sh # macOS / LinuxIt opens http://127.0.0.1:8770:
Overview: your memory in numbers, and switches to start the web app and the MCP server. Whatever you start is kept on: if it stops, the manager starts it again.
COSMOS: the web app shown inside the panel. The 2D and 3D views, search and editing are the web app's own.
Storage: backups with one-click restore, export to JSON or Markdown, optimize, open the data folder, erase everything (a backup is always made first).
The web app needs Node.js; a Set up button installs its dependencies. More in manager/README.md.
The AI model: Polaris
COSMOS contains an AI model of its own, used for search only. It does not write text and it does not talk to you: it turns a sentence into a list of 384 numbers (a vector) so that sentences with the same meaning end up close to each other.
What it is: Polaris is
multilingual-e5-small(118 million parameters, MIT license) fine-tuned by us on 7,040 memories in 12 languages written for COSMOS. About 10 minutes of training on 2 Tesla T4 GPUs.What it does: a question and every memory become vectors. The closest vectors are the best matches. That is why "why did we change databases?" finds "we are moving to PostgreSQL".
Where it runs: on your CPU, in ONNX format, through fastembed. No GPU, no cloud, no API call. Your memories never leave your machine.
How COSMOS gets the model
If a
models/polaris/folder exists next toserver.py, COSMOS uses it.Otherwise it downloads Polaris once from Hugging Face (
DevLiamDb/polaris, about 470 MB) and keeps it in your cache. After that it works offline.Polaris is currently private. If you have access, set your token before installing (
HF_TOKEN, from https://huggingface.co/settings/tokens).Without access, COSMOS falls back to MiniLM (
paraphrase-multilingual-MiniLM-L12-v2, about 220 MB, public) and prints a message. Everything still works.COSMOS_EMBED_MODEL=minilmforces MiniLM. If you switch model, COSMOS re-indexes your memories by itself.
Search measure (no AI, ~200 memories) | MiniLM | e5-small | Polaris |
Right memory in the top 3 | 97.6% | 96.3% | 98.3% |
"Not in memory" recognized | 84.6% | 84.8% | 92.0% |
Newest version of a fact ranked first | 91.7% | 91.7% | 86.1% |
It is not ahead everywhere: on search alone it ranks the newest version of a fact first less often. COSMOS fixes that order afterwards using the date. Small test set (~125 questions per draw): gaps of 1 to 2 points are within chance.
COSMOS/
βββ install.py β one-command installer β START HERE
βββ server.py β MCP server (22 tools)
βββ cosmos/ β the engine
β βββ db.py β SQLite schema (nodes, edges), embeddings storage
β βββ embeddings.py β semantic vectors (Polaris, MiniLM fallback)
β βββ summarizer.py β "Surface" summary of each memory
β βββ categorize.py β automatic categories (zero-shot)
β βββ graph.py β CosmosEngine: write, recall, query, link, neighbors...
β βββ visualize.py β standalone interactive HTML graph
β βββ web_export.py β JSON export for the web app
βββ webapp/ β Next.js / Three.js app (2D and 3D)
βββ scripts/ β terminal chat with memory
βββ tests/ β test suite
βββ benchmark/ β benchmark code (run, report, synthetic data)
βββ benchmark-cosmos/ β real results: charts, tables, raw answers
βββ training/ β Polaris training and export scripts
βββ cosmos-memory.md β instructions to give your assistant
βββ docs/ β detailed documentation (French)
βββ assets/ β logo and GIFsYou never call these yourself: your assistant does. Here is what each one does in practice.
Remember and find
Tool | What it does | Concrete example |
| Saves a memory: full text, short summary, vector, category, date | "We chose PostgreSQL because of cost" is saved as a decision |
| Searches by meaning, returns short summaries only | "why did we change databases?" finds it, even with different words |
| Loads the full text of one memory | Open the whole meeting note only when the summary is not enough |
| Shows the linked memories (same topic, before and after) | Follow how a decision evolved over time |
| Edits a memory (title, text, category) | A fact changed: summary and search vector are recomputed |
| Pins one memory | Mark "this one matters to me" on a single planet |
Organize
Tool | What it does | Concrete example |
| Lists categories and which ones are priority | See what topics your memory contains |
| Marks a whole category as priority | Make your "rules" category always available |
| The "backpack": all priority memories in one light call | Run at the start of every conversation so the assistant knows your rules |
| Sets the color of a category | Make "Work" blue in the web app |
| Renames a category and its memories |
|
| Merges one category into another | Group two near-duplicate categories |
Delete (irreversible, only on your explicit request)
Tool | What it does |
| Delete one or several memories and their links |
| Delete a category and all its memories |
| Delete everything written during one session |
| Empty the whole database (there is a safeguard, and no backup) |
Maintain and visualize
Tool | What it does | Concrete example |
| Counts memories, links, sessions | Check the memory is not empty |
| Recomputes every vector with the current model | After changing the search model |
| Builds a standalone interactive HTML graph | Share a picture of your memory without installing anything |
| Exports the graph for the web app | Refresh the 2D / 3D sky |
| Shows the graph live in the chat (needs an MCP Apps host and a remote server) | Experimental |
assistant ββMCPβββΊ server.py βββΊ CosmosEngine βββΊ cosmos.db (SQLite)
β
βββ Polaris / MiniLM (ONNX, CPU, via fastembed)Write: the full text is stored (Abyss), summarized (Surface), turned into a vector, categorized and dated.
Query: the question becomes a vector, the closest memories come back as short summaries. Newer versions of a fact rank first, outdated ones are flagged as replaced.
Recall: the assistant asks for the full text of one memory. Nothing else enters its context window.
If you change the embedding model, COSMOS detects it when the database opens and re-indexes your memories.
The full French documentation (categories, web app routes, graph, limits) is in docs/DETAILS-fr.md.
Where is my data?
In cosmos.db, created next to server.py the first time it runs. It never leaves your machine. You can open it with any SQLite client, back it up or delete it.
Do I need a GPU or an account? No. Polaris runs on the CPU. No account, no API key (except for the optional terminal chat).
The first launch is slow. The search model downloads once (about 220 MB for MiniLM, 470 MB for Polaris), then stays in your cache.
Claude doesn't see the tools.
Restart Claude Desktop completely after install.py --configure. Check that claude_desktop_config.json contains a cosmos-engine entry.
I changed the search model, did I lose my memories? No. COSMOS re-indexes them automatically the next time the database opens.
How reliable is the automatic categorization?
Weak: 21 to 39% correct on our test set. You can always force a category with node_type, and merge categories later.
Story & credits
COSMOS started as a story, not as software.
Liam DB was writing a story and playing roleplay with AI to imagine himself living among invented AI models. One of them had infinite memory: a memory that lived outside the model, kept everything, and gave back only what mattered. In the story, that memory was called COSMOS.
Then at some point the story stopped being only a story. The question became "could this really exist?", and it turned into a real project, first named Cosmos Engine, and now simply COSMOS.
Born | Friday 11 September 2026, 12:28:28 |
Former name | Cosmos Engine |
Origin | A fictional AI model with infinite memory, from a roleplay story |
Today | A real MCP server with its own search model, Polaris |
COSMOS was written with AI, and we say it plainly.
Who | Role |
Liam DB (DevLiamDb) | Creator. The idea, the story behind it, the direction, the decisions, the testing. |
Claude Code (Anthropic) | Wrote the code of the project (engine, MCP server, installer, benchmark, training scripts), under Liam DB's direction. |
Z.ai, model GLM 5.3 Flash | Generated the interface of the web app ( |
Polaris | The search model: a fine-tune of |
The training memories, the benchmark questions and the test texts were also written with AI, not collected from real users.
Built on: MCP, fastembed, ONNX Runtime, SQLite, Hugging Face, Kaggle (training and benchmark), Next.js and Three.js for the web app.
Find the creator: π devliam.com Β· π GitHub
The complete list of models, libraries and licenses is in CREDITS.md.
License
COSMOS Personal Use License v1.0
β
Free to use: personal, educational, research
β
Modification and sharing allowed, with credit to the original author
β
Your memories and your cosmos.db are yours
β Cannot sell COSMOS without written permission
β Cannot claim you created it
See LICENSE for the full terms.
Built by Liam DB β with the help of AI.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI assistants: store, search, and connect knowledge across conversations.
Personal wiki and memory layer for AI assistants. Persistent, structured memory across sessions.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Persistent memory for AI agents. Search, store, and recall across sessions.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.3-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to store and retrieve memories with semantic search capabilities using vector embeddings. Provides persistent memory storage with SQLite backend for context retention across conversations.24 npm1MIT
- AlicenseAqualityBmaintenanceProvides AI coding assistants with persistent memory storage using a local SQLite database. Enables tools to remember project details, notes, and relationships across sessions to maintain context and reduce repetitive explanations.174MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to have persistent, self-hosted memory across sessions and devices, storing context in a SQLite database you control.1MIT