Noureddine RAMDI / Knowledge Engine: bridging markdown wikis with sub-5ms semantic search

Created Mon, 04 May 2026 10:23:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

tashisleepy/knowledge-engine

Knowledge management at scale remains a tough nut to crack — especially when you want the familiarity of markdown wikis combined with the speed of semantic search. Knowledge Engine tackles this by bridging human-readable markdown wikis with Memvid’s lightning-fast vector search, achieving sub-5ms retrieval even across thousands of pages.

At its core, Knowledge Engine implements Andrej Karpathy’s LLM Wiki pattern. This pattern maintains a continuously updated, structured wiki using an LLM, which compounds knowledge over time instead of fetching it on demand. The wiki lives in plain markdown files — easy for humans to read and edit — while the semantic search index is stored as a single .mv2 file managed by Memvid.

This dual-layer architecture is the defining feature. When you search, the system first queries the wiki directly (wiki-first search). If that doesn’t yield results, it falls back to Memvid’s vector search, which can retrieve context semantically in under 5 milliseconds even with 5,000+ pages indexed.

Under the hood, the system is Python-based, with dependencies including memvid-sdk, pymupdf, and portalocker. It offers a web UI with seven tabs: dashboard, search, wiki browser, entity explorer, health monitoring, tool inventory, and monthly review reports. This UI provides a comprehensive interface for navigating and maintaining the knowledge base.

The repo also includes CLI tools to handle ingestion (adding or updating content atomically in both the wiki and Memvid index), search operations, synchronization (ensuring the wiki and vector store stay lockstep via content hashes), and reporting. This idempotent design ensures consistency across layers and supports automatic drift detection — for example, spotting contradictions or orphaned references between the wiki and the semantic index.

What sets Knowledge Engine apart: dual-layer search and integrity management

The standout technical strength is the dual-layer search architecture paired with rigorous synchronization and quality checks. Unlike typical semantic search systems that rely solely on vector indexes, Knowledge Engine keeps a human-readable markdown wiki as the primary source. This means knowledge workers can read, edit, and trust the base content rather than just opaque embeddings.

The tradeoff here is complexity. Maintaining atomic writes to both the markdown wiki and the Memvid index requires careful locking and content hash checks. The repo uses portalocker for file locks to guarantee idempotency during ingestion and sync operations.

Automatic entity extraction populates structured metadata, improving cross-references and enabling contradiction detection. The system flags inconsistencies between wiki content and the semantic index, catching drift before it degrades search quality.

The Python codebase is surprisingly clean and modular. It balances direct file manipulation with calls into Memvid’s SDK for ultra-fast semantic indexing. The UI components offer practical views into system health and entity relationships, which are critical for AI-augmented knowledge workers who rely on Claude Code daily.

Benchmarks cited in the README are concrete: sub-5ms retrieval latency across thousands of pages, loading the interface in 3 seconds, and a quick start achievable in 60 seconds. These are solid numbers for a self-hosted knowledge system integrating LLMs and vector search.

Quick start with Knowledge Engine

If you want to try Knowledge Engine yourself, the setup is straightforward. Clone the repo, install dependencies, and you’re set to start ingesting and searching markdown content.

git clone https://github.com/tashisleepy/knowledge-engine.git
cd knowledge-engine
pip install -r requirements.txt    # memvid-sdk + pymupdf + portalocker

From here, you can run the provided CLI tools for ingestion and search or launch the web UI to explore the dashboard, entity explorer, and monitoring tabs. The CLI and UI are designed to complement each other, giving you control over the knowledge base lifecycle.

Verdict: who should consider Knowledge Engine

Knowledge Engine is built for developers and AI-augmented knowledge workers who want a persistent, structured LLM-maintained wiki backed by blazing fast semantic search. If you rely on markdown for documentation or knowledge management but want the speed and recall benefits of vector search, this repo offers a practical bridge.

The tradeoffs are clear: the system adds complexity with its dual-layer architecture and synchronization needs. It’s not a plug-and-play vector search service but rather a toolkit to maintain knowledge consistency between human-readability and machine retrieval.

If you’re comfortable with Python tooling, CLI-driven workflows, and want to experiment with Karpathy’s LLM Wiki pattern in a self-hosted environment, Knowledge Engine is worth exploring. Its combination of entity extraction, contradiction detection, and idempotent ingestion addresses real-world knowledge drift problems.

In production, expect to invest in learning the sync and search tradeoffs, but the payoff is a knowledge system that balances transparency, speed, and AI augmentation without sacrificing control.


→ GitHub Repo: tashisleepy/knowledge-engine ⭐ 58 · HTML