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.0.tar.gz (8.9 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.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mnemosyne_ollama-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 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.0.tar.gz
Algorithm Hash digest
SHA256 9fcfd21300259eed1667f3508ebbf2b3670cf309b11c34087f20bcea46e63942
MD5 c1ba1d4e3cb8475e800eb89085306031
BLAKE2b-256 140a8cfe663056b18270c4fc58f017455a4d40990650a5e4e637d5a4db7a4fa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemosyne_ollama-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mnemosyne_ollama-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7821569d4a12411be2851cfa3eea5196cd66cc8fd9296607bed3bd814317a2
MD5 28ff1aa90b3e8f14e6870f73ebd98da6
BLAKE2b-256 0c1284181cc30e92cbe4a63190f6e8e1cb2c61832476a8b22c309c4d9d1a8e86

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemosyne_ollama-0.1.0-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