Skip to content

Commit ef872bd

Browse files
committed
Merge dev into main for v1.1.0 release
2 parents 62417a4 + fd56489 commit ef872bd

44 files changed

Lines changed: 6454 additions & 101 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ docs/
5454
!docs/benchmark_meat_detection_query.md
5555
!docs/assets/
5656
!docs/assets/mnemosyne.png
57+
!docs/assets/diagrams/
58+
!docs/assets/diagrams/*.png
59+
!docs/assets/diagrams/*.gif
5760

5861
# -- Holdback test data (never committed -- validation-only) --
5962
mnemosyne/tests/benchmark_questions/httpx_holdback.json

CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,90 @@ All notable changes to Mnemosyne are documented in this file.
55
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66
This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2026-04-07
9+
10+
### Added
11+
- Document ingestion (Tier 0) -- extract and index PDFs, DOCX, CSV, and
12+
plaintext (.log, .cfg, .ini, .conf, .rst, .xml). PDF requires optional
13+
`mnemosyne-engine[pdf]` extra (pypdf, pure Python, BSD). All other
14+
extractors use stdlib only. Zero-dep core preserved.
15+
- Partitioned document index -- documents stored in isolated tables
16+
(doc_chunks, doc_chunks_fts, doc_sparse_embeddings, doc_vocabulary) within
17+
the same SQLite database. Code retrieval pipeline is completely untouched.
18+
New DocStore and DocRetrievalEngine with BM25 + TF-IDF fused via RRF.
19+
- Schema ingestion pipeline -- DDL-aware SQL chunking (Phase 1), JSON/YAML
20+
schema import with environment tagging (Phase 2), SQLite introspection via
21+
PRAGMA queries with `--sqlite` CLI flag (Phase 3).
22+
- CLI `--docs` flag -- search document partition only.
23+
- CLI `--all` flag -- search both code and document partitions with split budget.
24+
- CLI `schema-ingest` and `schema-stats` commands for database DDL ingestion.
25+
- CLI `--version` flag -- reads from package `__version__`.
26+
- One-time upgrade hint -- on first query or ingest after schema migration,
27+
a stderr message reminds users about the new `--all` and `--docs` flags.
28+
Fires once, then clears. Fresh installs are not affected.
29+
- Progress bar on `mnemosyne ingest` with live counter and file path display.
30+
- Document partition benchmark -- 18-test regression gate covering document
31+
retrieval, schema lookup, cross-partition queries, and partition isolation.
32+
33+
### Fixed
34+
- Document file size limit -- documents were silently skipped using the 512 KB
35+
code limit. Now uses extraction.max_file_size_kb (default 10 MB).
36+
- DocStore vocabulary adapter -- doc_tfidf was created with store=None at all
37+
call sites, so doc_vocabulary was never populated. Added save_vocabulary()
38+
and load_vocabulary() adapter methods, wired all call sites. Re-ingest
39+
required after upgrade to populate document vocabulary.
40+
41+
### Changed
42+
- .md and .txt files reclassified as documents -- route to the doc partition
43+
instead of competing with source code for ranking slots. Use `--all` to
44+
search both partitions.
45+
- Dotfile ignore consolidation -- replaced 12 individual patterns with a
46+
single `.*` glob that catches all dotfiles and dotdirs.
47+
- Schema migration 2->3: files table gains extraction_method,
48+
extraction_quality, page_count; chunks table gains page_number.
49+
- Schema migration 3->4: creates doc_chunks, doc_chunks_fts,
50+
doc_sparse_embeddings, doc_vocabulary tables.
51+
52+
### Upgrade notes
53+
- Run `mnemosyne ingest --full` after upgrading to populate document
54+
partitions and vocabulary. Existing code indexes are preserved.
55+
- Queries that previously found .md files via default `mnemosyne query` must
56+
now use `--all` or `--docs`.
57+
58+
---
59+
60+
### mnemosyne-mcp [0.2.0]
61+
62+
### Added
63+
- `search_docs` tool -- document-only MCP search for LLM agents.
64+
- `schema_ingest` tool -- import DDL files or introspect SQLite databases.
65+
- `schema_stats` tool -- report indexed schema sources and statistics.
66+
- Federated search -- `search` tool now queries both code and document
67+
partitions, returns labeled sections ("Code Results" / "Document Results").
68+
69+
### Fixed
70+
- Per-partition truncation -- the 64KB output cap was applied after
71+
concatenation, silently removing document results when code results
72+
exceeded the cap. Each partition now gets an independent budget (32KB each
73+
when both exist, full 64KB when only one exists).
74+
- Stats handler tuple unpack -- _handle_stats unpacked 3 values but
75+
_get_engine returns 5 since the partition refactor.
76+
- doc_tfidf store wiring at 2 server.py call sites.
77+
78+
---
79+
80+
### mnemosyne-ollama [0.1.1]
81+
82+
### Added
83+
- Partition visibility in verbose mode -- `-v` output shows code/docs chunk
84+
counts and top file paths per partition for `search` and `search_docs` calls.
85+
86+
### Fixed
87+
- Version flag now imports from package `__version__` instead of hardcoded
88+
string.
89+
90+
---
91+
892
## [1.0.5] - 2026-04-04
993

1094
### Fixed
@@ -137,6 +221,8 @@ Initial public release on PyPI as `mnemosyne-engine`.
137221
- Daemon mode with Unix socket RPC
138222
- Zero runtime dependencies
139223

224+
[1.1.0]: https://github.com/castnettech/mnemosyne/compare/v1.0.5...v1.1.0
225+
[1.0.5]: https://github.com/castnettech/mnemosyne/compare/v1.0.4...v1.0.5
140226
[1.0.4]: https://github.com/castnettech/mnemosyne/compare/v1.0.2...v1.0.4
141227
[1.0.2]: https://github.com/castnettech/mnemosyne/compare/v1.0.0...v1.0.2
142228
[1.0.0]: https://github.com/castnettech/mnemosyne/compare/v0.4.0...v1.0.0

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
---
1919

20-
Mnemosyne indexes your codebase into a local SQLite store, scores every chunk with a 6-signal hybrid retriever, compresses results with AST awareness, and returns exactly what you need within a token or result budget. It runs entirely locally -- no API keys, no cloud, no runtime dependencies beyond Python 3.11+.
20+
<p align="center">
21+
<img src="https://raw.githubusercontent.com/castnettech/mnemosyne/main/docs/assets/diagrams/mnemosyne-ecosystem.gif" alt="Mnemosyne Ecosystem -- three packages, zero cloud" width="800">
22+
</p>
23+
24+
Mnemosyne indexes your codebase and documents into a local SQLite store, scores every chunk with a 6-signal hybrid retriever, compresses results with AST awareness, and returns exactly what you need within a token or result budget. Supports source code (Python, JS/TS, Go, Rust, C#, Java, Kotlin), documents (PDF, DOCX, CSV, plaintext), and database schemas (SQL DDL, JSON snapshots, SQLite introspection). It runs entirely locally -- no API keys, no cloud, no runtime dependencies beyond Python 3.11+.
2125

2226
## Install
2327

@@ -53,7 +57,9 @@ mnemosyne query "How does authentication work?" # search
5357
- **Self-tuning ARC cache** -- adapts between recency and frequency patterns automatically, persisted across sessions
5458
- **Delta-aware tracking** -- detects file and chunk-level changes, delivers diffs instead of full content (80-95% savings on incremental queries)
5559
- **Content deduplication** -- SHA-256 addressed storage eliminates duplicate chunks across files
56-
- **7-language structural chunking** -- Python (AST), JavaScript/TypeScript, Go, C#, Rust, Java, Kotlin, plus Markdown and plain text
60+
- **7-language structural chunking** -- Python (AST), JavaScript/TypeScript, Go, C#, Rust, Java, Kotlin
61+
- **Document ingestion** -- PDF, DOCX, CSV, and plaintext extraction into an isolated document partition with independent BM25 + TF-IDF retrieval. Optional `mnemosyne-engine[pdf]` extra for PDF support
62+
- **Schema ingestion** -- DDL files, JSON/YAML snapshots, and live SQLite introspection indexed alongside code for cross-domain queries
5763
- **Daemon mode** -- JSON-RPC over Unix socket keeps indexes warm for sub-20ms queries
5864
- **Full audit trail** -- append-only JSON-lines log of every operation
5965
- **Zero runtime dependencies** -- pure Python 3.11+ stdlib. One `pip install`, no conflicts
@@ -121,8 +127,10 @@ Works with any agent that can execute shell commands.
121127
|---|---|
122128
| `init` | Create workspace and config |
123129
| `ingest` | Index files (incremental, `--full` to rebuild) |
124-
| `query` | Search with token budget |
130+
| `query` | Search with token budget (`--docs`, `--all` for document partition) |
125131
| `stats` | Index and cache statistics |
132+
| `schema-ingest` | Import database schema (DDL, JSON, SQLite) |
133+
| `schema-stats` | Schema index statistics |
126134
| `compress` | Preview compression for a file |
127135
| `delta` | Show changes since last index |
128136
| `cache` | Manage ARC cache (`show`, `clear`, `warm`) |
1.2 MB
Loading

mcp/README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# mnemosyne-mcp
22

3-
MCP server for [Mnemosyne](https://github.com/castnettech/mnemosyne-engine) -- a 6-signal hybrid code retrieval engine that reduces LLM context waste by 73%.
3+
MCP server for [Mnemosyne](https://github.com/castnettech/mnemosyne) -- a 6-signal hybrid retrieval engine for code, documents, and database schemas. Reduces LLM context waste by 73%.
44

55
For the full reference, see [MCP.md](../MCP.md) in the repository root.
66

@@ -31,33 +31,58 @@ Or add to your project's `.mcp.json`:
3131

3232
## Tools
3333

34-
### `mnemosyne.search`
34+
### `search`
3535

36-
Search a codebase using 6-signal hybrid retrieval (BM25 + TF-IDF + symbol matching + usage frequency + predictive prefetch + optional dense embeddings) fused via Reciprocal Rank Fusion. Returns the most relevant code chunks within a configurable token budget, with AST-aware compression.
36+
Federated search across code and document partitions. Code results use 6-signal hybrid retrieval (BM25, TF-IDF, symbol matching, usage frequency, predictive prefetch, optional dense embeddings) fused via Reciprocal Rank Fusion. Document results use BM25 + TF-IDF with isolated vocabulary. Returns labeled sections so the LLM can perform cross-type ranking.
3737

3838
**Parameters:**
3939
- `query` (string, required) -- natural language or keyword query
4040
- `budget` (integer, default 8000) -- maximum token budget
4141
- `project_root` (string, optional) -- path to project root
4242

43-
### `mnemosyne.index`
43+
### `search_docs`
4444

45-
Index or re-index a codebase. Incremental by default (only processes changed files).
45+
Search the document partition only (PDFs, DOCX, CSVs, logs, and other non-code files). Uses BM25 and TF-IDF with an isolated vocabulary tuned for prose retrieval.
46+
47+
**Parameters:**
48+
- `query` (string, required) -- natural language query
49+
- `budget` (integer, default 8000) -- maximum token budget
50+
- `project_root` (string, optional) -- path to project root
51+
52+
### `index`
53+
54+
Index or re-index a codebase. Incremental by default (only processes changed files). Indexes both code and document partitions.
4655

4756
**Parameters:**
4857
- `project_root` (string, optional) -- path to project root
4958
- `full` (boolean, default false) -- force full re-index
5059

51-
### `mnemosyne.stats`
60+
### `stats`
5261

5362
Show index statistics: file count, chunk count, tokens, language breakdown, chunk types.
5463

5564
**Parameters:**
5665
- `project_root` (string, optional) -- path to project root
5766

67+
### `schema_ingest`
68+
69+
Ingest database schema into the index. Accepts DDL files (.sql), JSON/YAML schema snapshots, or SQLite database paths for live introspection.
70+
71+
**Parameters:**
72+
- `source_path` (string, required) -- path to schema source
73+
- `environment` (string, optional) -- tag for the schema source (e.g., "production", "staging")
74+
- `project_root` (string, optional) -- path to project root
75+
76+
### `schema_stats`
77+
78+
Report indexed schema sources and statistics.
79+
80+
**Parameters:**
81+
- `project_root` (string, optional) -- path to project root
82+
5883
## How it works
5984

60-
Mnemosyne indexes your codebase into local SQLite, scoring every chunk with six retrieval signals fused through Reciprocal Rank Fusion. AST-aware compression then strips boilerplate while preserving function signatures, control flow, and documentation -- delivering exactly within your token budget.
85+
Mnemosyne indexes your codebase and documents into local SQLite, scoring every chunk with retrieval signals fused through Reciprocal Rank Fusion. Code gets 6-signal hybrid search; documents get BM25 + TF-IDF with isolated vocabulary. AST-aware compression strips boilerplate while preserving function signatures, control flow, and documentation.
6186

6287
Zero runtime dependencies beyond Python 3.11+. No API keys. No cloud services. Everything runs locally.
6388

mcp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "mnemosyne-mcp"
7-
version = "0.1.0"
7+
version = "0.2.0"
88
description = "MCP server for Mnemosyne -- semantic code retrieval with 6-signal hybrid search and AST-aware compression"
99
readme = "README.md"
1010
license = "AGPL-3.0-only"

mcp/src/mnemosyne_mcp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Mnemosyne MCP Server -- semantic code retrieval for Claude Code."""
22

3-
__version__ = "0.1.0"
3+
__version__ = "0.2.0"

0 commit comments

Comments
 (0)