Skip to main content

Ask your codebase questions using Ollama and Mnemosyne -- zero-config local code search

Project description

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.

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

mnemosyne_ollama-0.1.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mnemosyne_ollama-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file mnemosyne_ollama-0.1.1.tar.gz.

File metadata

  • Download URL: mnemosyne_ollama-0.1.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mnemosyne_ollama-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1454407b56f1da49ffc16c533295bedafcdade586d0591ed2780deef1d3911ec
MD5 a0992751dc18c4e2900b60cd34d0e99b
BLAKE2b-256 d7f7eb79cf3c60a7a8ba26f577b835153f9d1c2a9e39ddf0260840770de51b0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemosyne_ollama-0.1.1.tar.gz:

Publisher: publish-ollama.yml on castnettech/mnemosyne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mnemosyne_ollama-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mnemosyne_ollama-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ab2a4967f52a0b15f078f610c61e2dcea0d0721006f131ee0282c3c71f45191
MD5 75a19a2f4f2e6e2f9ee8e843d2ead0a2
BLAKE2b-256 7252396a9bf4e0e5a14e1063113f89c68f2ef6cce5466a9d341d5b80119e5cae

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemosyne_ollama-0.1.1-py3-none-any.whl:

Publisher: publish-ollama.yml on castnettech/mnemosyne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page