Semantic memory layer for OpenCode AI coding sessions
Project description
Muninn
Muninn (Old Norse: "memory") is one of Odin's two ravens — the raven of memory.
Muninn is a semantic memory layer for OpenCode. It gives AI coding sessions persistent, searchable memory — so you never have to re-explain your project from scratch.
What it does
- Session resumption — load prior context at the start of every session
- Decision tracking — record architectural decisions with their rationale
- Pattern memory — save code conventions that apply across the project
- Semantic search — find relevant memories by meaning, not exact keywords
- Global memory — store cross-project knowledge (infra procedures, tool patterns, auth flows) that persists across all projects
- Symbol index — index code symbols (functions, classes, methods) and search them semantically so the AI can navigate large codebases without re-reading files
Memory is stored locally in ~/.config/opencode/muninn/chroma/ using ChromaDB (embedded). Each project gets its own isolated collection. A special __global__ collection holds cross-project knowledge.
Prerequisites
- uv — https://docs.astral.sh/uv/
- Ollama with
mxbai-embed-large— can be local or remote:- Local:
ollama pull mxbai-embed-large && ollama serve - Remote: any Ollama-compatible endpoint (e.g. Mimir) — set
MUNINN_OLLAMA_URLand optionallyMUNINN_OLLAMA_TOKEN
- Local:
Installation
OpenCode
1. Install companion skills
uvx muninn-remembers install opencode
This copies memory-read, memory-write, and symbol-search to ~/.config/opencode/skills/.
2. Add the MCP server to ~/.opencode/opencode.json
"muninn": {
"type": "local",
"command": ["uvx", "muninn-remembers"],
"environment": {
"MUNINN_OLLAMA_URL": "http://localhost:11434",
"MUNINN_DATA_DIR": "/Users/your-username/.config/opencode/muninn"
},
"enabled": true
}
3. Restart OpenCode to pick up the new MCP server.
Claude Code
1. Install companion slash commands
uvx muninn-remembers install claude
This copies memory-read.md, memory-write.md, and symbol-search.md to ~/.claude/commands/, making them available as /memory-read, /memory-write, and /symbol-search slash commands.
2. Add the MCP server
claude mcp add muninn \
--env MUNINN_OLLAMA_URL=http://localhost:11434 \
--env MUNINN_DATA_DIR=/Users/your-username/.config/opencode/muninn \
-- uvx muninn-remembers
3. Verify by running /mcp in Claude Code — muninn should appear in the list.
Environment Variables
| Variable | Default | Description |
|---|---|---|
MUNINN_OLLAMA_URL |
http://localhost:11434 |
Ollama base URL (local or remote) |
MUNINN_OLLAMA_TOKEN |
(unset) | Bearer token for authenticated Ollama endpoints (e.g. Mimir) |
MUNINN_EMBED_MODEL |
mxbai-embed-large:latest |
Ollama embedding model |
MUNINN_DATA_DIR |
~/.config/opencode/muninn |
ChromaDB storage path |
MUNINN_TOP_K |
5 |
Default number of search results |
MUNINN_PROJECT |
(auto-detected) | Override project name |
Using a remote Ollama endpoint (e.g. Mimir)
OpenCode (opencode.json):
"muninn": {
"type": "local",
"command": ["uvx", "muninn-remembers"],
"environment": {
"MUNINN_OLLAMA_URL": "https://your-mimir-host/v1",
"MUNINN_OLLAMA_TOKEN": "your-bearer-token",
"MUNINN_DATA_DIR": "/Users/your-username/.config/opencode/muninn"
},
"enabled": true
}
Claude Code:
claude mcp add muninn \
--env MUNINN_OLLAMA_URL=https://your-mimir-host/v1 \
--env MUNINN_OLLAMA_TOKEN=your-bearer-token \
--env MUNINN_DATA_DIR=/Users/your-username/.config/opencode/muninn \
-- uvx muninn-remembers
When MUNINN_OLLAMA_TOKEN is set, every embedding request includes an Authorization: Bearer <token> header.
MCP Tools
Project-scoped tools
| Tool | Description |
|---|---|
memory_write |
Write a memory entry (text, type, tags) |
memory_search |
Semantic search across project memories |
memory_list |
List recent memories (paginated) |
memory_delete |
Delete a memory entry by ID |
memory_wipe_project |
Delete ALL memories for a project (requires confirm=True) |
memory_list_projects |
List all projects that have stored memories |
Global tools (cross-project)
| Tool | Description |
|---|---|
global_memory_write |
Write a cross-project memory (infra procedures, tool patterns, auth flows, etc.) |
global_memory_search |
Semantic search across global memories |
global_memory_list |
List global memories (paginated) |
global_memory_delete |
Delete a global memory entry by ID |
global_memory_wipe |
Delete ALL global memories (requires confirm=True) |
Symbol tools (per-project code index)
| Tool | Description |
|---|---|
symbol_index |
Index one or more code symbols — name, kind, file, signature, docstring, callers |
symbol_search |
Semantic search across indexed symbols by natural-language query |
symbol_delete_file |
Remove all symbols belonging to a given file path |
symbol_wipe |
Delete the entire symbol index for a project (requires confirm=True) |
Each symbol is stored in a dedicated ChromaDB collection named <project>__symbols, separate from the memory collection. Symbol entries are keyed by a deterministic ID (sha1(<project>:<file>:<name>:<kind>)[:16]), so re-indexing a symbol overwrites the previous entry rather than creating a duplicate.
Skills
Two companion skills guide the agent:
- memory-read — Load project context + global context at session start
- memory-write — Save decisions, summaries, next steps, and cross-project knowledge
- symbol-search — Guide when and how to index code symbols and search them by meaning
Verify it works
After installation, call the memory_list_projects tool (in OpenCode or Claude Code):
memory_list_projects()
This returns a (possibly empty) list if Muninn is connected. If you see an error, check that:
uvis on your PATH- Ollama is reachable:
curl $MUNINN_OLLAMA_URL/api/tags(orcurl http://localhost:11434/api/tagsfor local) - The MCP server is registered — run
/mcpin Claude Code, or checkopencode.jsonin OpenCode
Project detection
Muninn auto-detects the current project using this priority order:
MUNINN_PROJECTenv var (explicit override)git rev-parse --show-toplevel→ basenameos.getcwd()→ basename
Data location
All memory data lives at ~/.config/opencode/muninn/chroma/. To back up your memories, copy this directory. To start fresh for a project, use memory_wipe_project.
Publishing
Releases are published to PyPI automatically when a v* tag is pushed:
git tag v0.1.0
git push --tags
One-time PyPI setup (maintainer only):
- Create an account at pypi.org
- Go to Account → Publishing → Add a Trusted Publisher:
- Owner:
antic-eye - Repository: your GitHub repo name
- Workflow:
publish.yml - Environment: (leave blank)
- Owner:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file muninn_remembers-0.1.6.tar.gz.
File metadata
- Download URL: muninn_remembers-0.1.6.tar.gz
- Upload date:
- Size: 220.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b545e428a2fbaffb337d897a7e6cdb2595fdda4c771f9d0ae6b6bbb24207813e
|
|
| MD5 |
8962661ce0a44bf8707d29ce5926f6dd
|
|
| BLAKE2b-256 |
9ae3c148e4d854113f674b4e1251af041cce821bade677d0ca1777b61d85287b
|
Provenance
The following attestation bundles were made for muninn_remembers-0.1.6.tar.gz:
Publisher:
publish.yml on antic-eye/muninn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muninn_remembers-0.1.6.tar.gz -
Subject digest:
b545e428a2fbaffb337d897a7e6cdb2595fdda4c771f9d0ae6b6bbb24207813e - Sigstore transparency entry: 1271111578
- Sigstore integration time:
-
Permalink:
antic-eye/muninn@4d55030c314f49281e665c7157712cb7c35ef81a -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/antic-eye
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d55030c314f49281e665c7157712cb7c35ef81a -
Trigger Event:
release
-
Statement type:
File details
Details for the file muninn_remembers-0.1.6-py3-none-any.whl.
File metadata
- Download URL: muninn_remembers-0.1.6-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
899e85fe28f830b8ceecb6583f0ec86351df42cc5071ecd3dacae2f581cb6bb3
|
|
| MD5 |
cef36f395f8003bd6221631d1129301c
|
|
| BLAKE2b-256 |
78d8adc45bb5ad7d934fbff1dbe3dec14ebaf3d3dadbce434257c4b072dcecdd
|
Provenance
The following attestation bundles were made for muninn_remembers-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on antic-eye/muninn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muninn_remembers-0.1.6-py3-none-any.whl -
Subject digest:
899e85fe28f830b8ceecb6583f0ec86351df42cc5071ecd3dacae2f581cb6bb3 - Sigstore transparency entry: 1271111689
- Sigstore integration time:
-
Permalink:
antic-eye/muninn@4d55030c314f49281e665c7157712cb7c35ef81a -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/antic-eye
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d55030c314f49281e665c7157712cb7c35ef81a -
Trigger Event:
release
-
Statement type: