Skip to main content

Mnemosyne-Ollama

Ask your codebase questions using local LLMs. Zero config, zero cloud, zero new dependencies.

Bridges Ollama to Mnemosyne via MCP -- the same 6-signal hybrid retrieval that powers Mnemosyne's Claude Code integration, now available with any tool-calling Ollama model.

Install

pip install mnemosyne-ollama

This installs everything: the Ollama bridge, the MCP server, and the Mnemosyne retrieval engine.

Quick Start

cd /your/project
mnemosyne-ollama "how does authentication work"

That's it. Auto-detects your Ollama model, indexes if needed, searches with ranked hybrid retrieval, and returns an answer with file paths and line numbers.

Requirements

  • Python 3.11+
  • Ollama running locally with a tool-calling model

Supported Models

Any Ollama model with function/tool-calling support:

  • qwen2.5, qwen3
  • llama3.1, llama3.2, llama3.3, llama4
  • gemma3, gemma4
  • phi4
  • mistral-nemo
  • command-r

If no --model is specified, the first installed tool-capable model is used automatically.

Usage

Single query

mnemosyne-ollama "how does the rate limiter work"
mnemosyne-ollama "find all database queries" --model qwen2.5 --budget 12000
mnemosyne-ollama "explain the auth flow" -v   # verbose: shows tool calls

Interactive mode

mnemosyne-ollama
> how does the auth middleware work?
[searches, responds with code citations]
> what about rate limiting?
[follows up with conversation context]
> ^C

Python library

from mnemosyne_ollama import run

result = await run("how does auth work", model="qwen2.5", budget=8000)
print(result.response)

CLI Reference

mnemosyne-ollama [QUERY] [OPTIONS]

positional:
  query                    Question about the codebase (omit for interactive)

options:
  -m, --model MODEL        Ollama model (auto-detected if omitted)
  -b, --budget INT         Token budget for search results (default: 8000)
  -r, --project-root PATH  Project root directory (default: cwd)
  --ollama-url URL         Ollama URL (default: OLLAMA_HOST env or localhost:11434)
  -v, --verbose            Print tool calls to stderr
  --version                Show version

How It Works

mnemosyne-ollama
  |
  | 1. Spawns mnemosyne-mcp as subprocess (stdio)
  | 2. Discovers tools: search, index, stats
  | 3. Sends query + tools to Ollama /api/chat
  |
Ollama (local model)
  |
  | 4. Model calls search tool with your question
  |
mnemosyne-mcp
  |
  | 5. 6-signal hybrid retrieval (BM25 + TF-IDF + symbols + usage + prefetch + RRF)
  | 6. AST-aware compression, budget-cut to token limit
  |
  | 7. Results fed back to model
  | 8. Model generates answer with file citations

Everything runs locally. No API keys, no cloud, no data leaves your machine.

Configuration

Mnemosyne search settings are configured via .mnemosyne/config.toml in your project root (created on first index). See the Mnemosyne documentation for details.

The --budget flag overrides the configured default per query.

Trademarks

Ollama, Qwen, Llama, Gemma, Phi, Mistral, and Command-R are trademarks of their respective owners. mnemosyne-ollama is an independent project and is not endorsed by or affiliated with any of these companies.

License

AGPL-3.0 -- commercial licensing available from Cast Net Technology.

Copyright 2026 Cast Rock Innovation L.L.C.

Metadata

Release files for mnemosyne-ollama 0.1.1

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

Source distribution (sdist)

Source distribution for mnemosyne-ollama 0.1.1
File Size Uploaded Provenance Actions
mnemosyne_ollama-0.1.1.tar.gz 9.6 kB With provenance Details for mnemosyne_ollama-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mnemosyne-ollama 0.1.1
File Interpreter ABI Platform Actions
mnemosyne_ollama-0.1.1-py3-none-any.whl Python 3 none any Details for mnemosyne_ollama-0.1.1-py3-none-any.whl

Total release size: 19.4 kB

Release files / mnemosyne_ollama-0.1.1.tar.gz

Download URL mnemosyne_ollama-0.1.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1454407b56f1da49ffc16c533295bedafcdade586d0591ed2780deef1d3911ec
BLAKE2b-256 checksum
How to use checksums
d7f7eb79cf3c60a7a8ba26f577b835153f9d1c2a9e39ddf0260840770de51b0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Apr 7, 2026.

Transparency log

Release files / mnemosyne_ollama-0.1.1-py3-none-any.whl

Download URL mnemosyne_ollama-0.1.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ab2a4967f52a0b15f078f610c61e2dcea0d0721006f131ee0282c3c71f45191
BLAKE2b-256 checksum
How to use checksums
7252396a9bf4e0e5a14e1063113f89c68f2ef6cce5466a9d341d5b80119e5cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Apr 7, 2026.

Transparency log

Security for mnemosyne-ollama 0.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mnemosyne_ollama-0.1.1.tar.gz

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 Apr 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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