Documentation
¶
Overview ¶
Package mnemos is a Zero-Dependency Local Semantic Memory Engine.
Mnemos provides fully offline, private semantic search over local documents without relying on a single external library or framework. Every single component—from the storage engine and data structures to the word embeddings and machine learning algorithms—is built from first principles using solely the Go standard library.
Features & Architecture ¶
Mnemos is fully self-contained and offers a state-of-the-art retrieval pipeline.
- LSM-Tree Storage Engine: A custom implementation of a Log-Structured Merge-Tree with Write-Ahead Log (WAL), Memtable, SSTables, and background compaction.
- BPE Tokenizer: A Byte-Pair Encoding tokenizer trained from scratch on your local corpus.
- PPMI + SVD Embeddings: Distributional semantics generated using pure linear algebra.
- SimHash LSH Index: Locality-sensitive hashing for approximate nearest-neighbor search.
- Hybrid Ranking & Machine Learning: BM25 keyword scoring fused with semantic vector similarity via Reciprocal Rank Fusion (RRF). A Deep Learning MLP Ranker then reranks results.
- TextRank Summarization: Extractive text summarization powered by PageRank-style graph algorithms.
The Cyberpunk Terminal User Interface (TUI) ¶
Mnemos features a stunning, custom-built cyberpunk-themed Terminal User Interface, operating completely without external TUI libraries like bubbletea or tview. It features dynamic vector space visualization, live telemetry (document count, vocabulary, SSTables, latency), and an interactive natural language search.
Ingesting Your Own Documents ¶
To make the engine work with your own documents on your device:
- Create a new folder (e.g., my_documents/).
- Drop your personal .txt, .md, or .pdf files into that folder.
- Run the ingest command pointing to your folder: ./mnemos.exe ingest my_documents --data-dir .mnemos --merges 8000 --dimensions 100
Zero-Dependency Disclosure ¶
Mnemos was constructed under the strict constraints of a Zero-Dependency hackathon.
- NO external databases (SQLite, Postgres).
- NO external search indices (ElasticSearch, Lucene).
- NO machine learning frameworks (PyTorch, TensorFlow).
- NO third-party math/linear algebra libraries.
- NO terminal UI frameworks.
Everything is natively implemented in Go.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
mnemos
command
Mnemos — A Zero-Dependency Local Semantic Memory Engine
|
Mnemos — A Zero-Dependency Local Semantic Memory Engine |
|
internal
|
|
|
embed
Package embed implements distributional word embeddings using PPMI (Positive Pointwise Mutual Information) and power-iteration SVD, replacing sentence-transformers, gensim, and scikit-learn's TruncatedSVD.
|
Package embed implements distributional word embeddings using PPMI (Positive Pointwise Mutual Information) and power-iteration SVD, replacing sentence-transformers, gensim, and scikit-learn's TruncatedSVD. |
|
index
Package index implements SimHash Locality-Sensitive Hashing for approximate nearest-neighbor search, replacing FAISS and Annoy.
|
Package index implements SimHash Locality-Sensitive Hashing for approximate nearest-neighbor search, replacing FAISS and Annoy. |
|
ingest
Package ingest handles document ingestion: directory walking, UTF-8 validation, content-hash based idempotency, and feeding documents into the storage engine.
|
Package ingest handles document ingestion: directory walking, UTF-8 validation, content-hash based idempotency, and feeding documents into the storage engine. |
|
rank
Package rank implements BM25 keyword ranking and Reciprocal Rank Fusion (RRF) for combining heterogeneous rankers, replacing rank_bm25 (PyPI).
|
Package rank implements BM25 keyword ranking and Reciprocal Rank Fusion (RRF) for combining heterogeneous rankers, replacing rank_bm25 (PyPI). |
|
storage
Package storage implements a complete log-structured storage engine.
|
Package storage implements a complete log-structured storage engine. |
|
summarize
Package summarize implements TextRank extractive summarization (Mihalcea & Tarau, 2004) to provide concise document snippets.
|
Package summarize implements TextRank extractive summarization (Mihalcea & Tarau, 2004) to provide concise document snippets. |
|
tokenizer
Package tokenizer implements Byte-Pair Encoding (BPE) from scratch, replacing HuggingFace's tokenizers package.
|
Package tokenizer implements Byte-Pair Encoding (BPE) from scratch, replacing HuggingFace's tokenizers package. |


