Skip to main content

akasha

A local knowledge base that gives coding agents a memory, served over MCP.

The problem

Every agent session starts from zero. Yesterday an agent spent an hour working out why a test fails one run in twenty: two tests share a fixture directory and the cleanup of one races the setup of the other. It fixed the test and the session ended. The reasoning lived in a context window, and the window is gone. Today another agent meets the same flake, reads the same files and derives the same answer, spending the same time and context to get there.

What you already know is not missing, it is scattered. Some of it sits in Claude Code project memory, some in Serena memories, some in a notes folder, some in markdown files inside repos. Each agent writes to its own corner, and none of them searches the others. Pasting notes into prompts does not scale: context is the scarce resource, and every pasted page crowds out the work. Conventions ("migrations are reviewed before merge", "never mock the database in integration tests") get retyped at the start of session after session.

How akasha fixes it

akasha builds one local index over the markdown you already have. It is read-only by default and copies nothing: your files stay the source of truth, and the SQLite index derived from them can be deleted and rebuilt at any time.

Agents search it through MCP before they start investigating, and write what they find back as ordinary markdown with knowledge_write and knowledge_append. The next session starts where the last one ended. Search is keyword (BM25) and, if enabled, dense retrieval, fused by reciprocal rank. Results are sized for a context window: a handful of capped hits, with knowledge_get to page into a document only when one is worth reading.

Conventions are documents of kind=convention. They are delivered automatically at session start and are read-only to agents; only the CLI can create or change one. Hooks keep the index fresh without anyone thinking about it (in Claude Code and Gemini CLI): a session-start hook refreshes it in the background, and a post-tool hook reindexes a note the moment an agent edits it.

Safety is enforced where the data enters. At index time, secret-shaped strings are redacted and known prompt-injection patterns are neutralised before any agent sees the text. Both are pattern-based: they catch the common shapes, not every secret. Destructive operations are CLI-only; an agent can archive a document, never delete one. There is no account and no server, and nothing leaves your machine (the one exception is a small embedding model, downloaded once if dense search is on).

A day with akasha: an agent running in claude records the flaky-test cause with knowledge_write. The next morning an agent in gemini is asked about the same flake, calls knowledge_search first, and finds the finding in one hit instead of an hour of investigation.

Requirements

  • Python 3.11+ and uv
  • A supported agent CLI: claude, gemini or copilot. akasha init --all registers with whichever are on your PATH. Any other MCP client can run akasha serve (stdio) by hand.

Install

The PyPI package is akasha-mcp; the command it installs is akasha.

uv tool install --python 3.12 'akasha-mcp[vectors]'

--python matters when your default Python is older than 3.11 (macOS ships 3.9): uv does not pick an interpreter from the package's requirement on its own, and downloads 3.12 if you don't have it. Without dense search: uv tool install --python 3.12 akasha-mcp. From git:

uv tool install --python 3.12 'akasha-mcp[vectors] @ git+https://github.com/anuress/akasha'

With [vectors] installed, akasha init writes provider = "model2vec" and search is dense plus keyword. Without it, search is keyword-only: init says so and akasha doctor keeps saying so. akasha config set embeddings.provider none turns dense search off. An existing config is never rewritten; to enable it there, set embeddings.provider model2vec and run akasha index.

Quickstart

akasha init

Creates ~/.akasha/ (mode 0700) with config.toml, the SQLite index and a knowledge/ directory for documents agents write. On first run it looks for existing notes to index: Claude Code project memories (~/.claude/projects/*/memory), and .serena/memories and graphify-out directories in the immediate subdirectories of ~ (change with --code-root DIR, repeatable).

akasha init --all

Registers the MCP server with every detected agent CLI through that CLI's own mcp add command (copilot: its mcp-config.json), and installs the two hooks for claude and gemini. For claude it also allows the mcp__akasha tools in settings.json so they do not prompt; skip that with --no-allow. --dry-run prints what would be written and changes nothing.

akasha index                         # build or refresh the index
akasha knowledge search "cache expiry" --limit 3
akasha doctor                        # what is degraded; exit 0 means healthy

Search defaults to the repo of the current checkout; --all searches every repo.

Tools

Eleven MCP tools:

Tool What it does
knowledge_search Ranked chunks; current repo first, OR retry when strict finds nothing, as_of date
knowledge_get One document by id, paged
knowledge_write New document; lists fold candidates and can supersede older ones
knowledge_update Correct a document in place, whole body or one exact span
knowledge_append Append a dated section to a document
knowledge_archive Hide from default search; reversible
knowledge_fsck Integrity check, read-only
knowledge_timeline Documents in the order written
knowledge_related Linked documents: citations and backlinks
feature_show How many documents carry a feature tag
doctor What is degraded about the installation

Hooks

Two hooks, both fail-open (they never block a session or a tool):

  • akasha hook session-start prints the repo's conventions, a short brief and an integrity note into the new session. The installed command passes --defer-refresh so it does not wait for an index walk.
  • akasha hook post-tool reads the tool payload on stdin and reindexes the one file an agent just wrote, if it is inside an index root.

Documents of kind=convention are standing rules: they are injected at session start and are read-only over MCP. Only the CLI can create or change one.

Sources and config

The native knowledge directory (~/.akasha/knowledge) holds documents written through akasha. Everything else is an indexed root, one [[index]] block in config.toml:

[[index]]
path     = "~/notes"
source   = "notes"
include  = ["**/*.md"]      # optional globs
exclude  = ["**/cache/**"]
repo     = "my-repo"        # repo the whole root belongs to
writable = false            # default; true lets knowledge_append write into it

Roots are read-only by default. Add one without editing the file:

akasha index add ~/notes --source notes --repo my-repo
akasha index

Deleting things

Agents can only archive. Everything else is CLI-only.

Command Effect
akasha knowledge archive ID Hidden from default search; reversible with --include-archived
akasha knowledge rm ID Moved to trash; recoverable
akasha knowledge restore ID Brings a trashed document back
akasha knowledge purge --yes Permanently deletes trashed documents (--older-than DAYS to limit)

Rebuilding and ids

The database is derived from the files:

rm ~/.akasha/akasha.db && akasha index

Ids of documents in indexed roots are derived from root and relative path, so links between documents survive a rebuild. Moving or renaming a file changes its id.

Privacy

At index time, secrets are redacted (scan_secrets, on by default) and prompt-injection shapes are neutralised before text reaches an agent; common secret files (.env*, *.pem, *.key, *.pfx, *.kdbx, SSH keys, .npmrc, .pypirc, credentials.json and similar) are denied outright; deny_files and deny_extensions in [security] replace the lists. A local audit log of events, including redacted query heads, is kept for 90 days (akasha housekeeping prunes it).

Development

uv run pytest -q
uv run --python 3.11 pytest -q

License

MIT

Metadata

Release files for akasha-mcp 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akasha-mcp 0.0.2
File Size Uploaded
akasha_mcp-0.0.2.tar.gz 160.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for akasha-mcp 0.0.2
File Interpreter ABI Platform
akasha_mcp-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 250.4 kB

Release files / akasha_mcp-0.0.2.tar.gz

Download URL akasha_mcp-0.0.2.tar.gz
Size 160.9 kB
Tags Source
SHA-256 checksum
How to use checksums
731c8ec094d3a1de9582d82ae695227359a8754a149978a912e005d91662360c
BLAKE2b-256 checksum
How to use checksums
8487276894c8d475d2fefdf026dc4b8da5206d4e1c0db82b2b6b737f9a8e54c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / akasha_mcp-0.0.2-py3-none-any.whl

Download URL akasha_mcp-0.0.2-py3-none-any.whl
Size 89.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81dc424c72c74af41a7c647ce154b5a772b9e2b887e255c467b17f302349d471
BLAKE2b-256 checksum
How to use checksums
a9dd3c7b92883037dbc39996d93944e51dff033efb4a6c86d1a4205e3da99c33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page