ZHIXU
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Overview
ZHIXU (知序) is benchmarked directly against enterprise open-source knowledge base architectures (such as RAGFlow, Dify, AnythingLLM, and XWiki), built for teams that need enterprise governance, auditability, and strict security boundaries without the operational overhead of Elasticsearch + MinIO + Redis + MySQL multi-container stacks.
In engineering, operations, compliance, and project delivery, critical knowledge lives scattered across PDF specs, Word SOPs, Excel inventories, PowerPoint decks, and field photos. Existing options leave three common gaps:
Traditional Enterprise Wikis (Confluence / XWiki / Outline): Mature review workflows, but entirely manual—legacy documents cannot be compiled into structured knowledge automatically.
Heavyweight RAG Platforms (RAGFlow / Dify): Feature-rich pipelines, but heavy deployment footprint and chunk-only retrieval that lacks formal Wiki governance (
Draft → Review → Published Baseline → AI Delete Guard → Git Rollback).Lightweight Local Chat Tools (AnythingLLM, etc.): Fast to run locally, but oriented around personal chat rather than structured Wiki compilation, excerpt line/page verification, split manual editing, and multi-stage approval.
ZHIXU takes a "Lightweight Monolith, Enterprise Kernel" approach:
Immutable Evidence Base: Imported PDF, DOCX, XLSX, PPTX, Markdown, and image files are stored locally as immutable source records tracked by SHA-256 hashes. AI never mutates original files.
Two-Stage Knowledge Compilation & Excerpt Verification: Structure-aware chunking, zero-bloat OOXML parsing, and two-stage compilation turn heterogeneous sources into a structured Markdown Wiki across six knowledge domains with TF-IDF mutual entity indexing. Cited excerpts are verified back against original line/page locators; unverifiable hallucinations are dropped.
Enterprise Change Governance: AI creations and updates enter a declarative review workflow (
Draft → Moderating → Validating → Published → Archived). AI delete proposals are intercepted intoPending Delete → Recycle Bin. A built-in split Markdown editor allows human editing with baseline line-level diffs, SQLite version snapshots, andisomorphic-gitrollback.Open Data Sovereignty & Bilingual Experience: Knowledge lives as plain Markdown, indexes and persistent vectors live in local SQLite, and revision history lives in standard
.git. Supports one-click English / Chinese (EN / 中文) UI switching and deploys as a desktop app, single Node process, or single Docker container.
Why ZHIXU vs Alternatives
Capability | ZHIXU (知序) | RAGFlow / Dify | AnythingLLM | Obsidian / XWiki |
Runtime Footprint | Single Desktop App or 1 Node process ( | Multi-container ( | Single container / Desktop | Local / Java + DB |
Auto-Compiles Messy Folders → Structured Wiki | Built-in 2-stage compiler + excerpt verification | Chunk RAG only (no Wiki governance) | Chat over files (no Wiki compilation) | Manual writing |
Source Files Strictly Untouched (Read-Only) | SHA-256 tracked, zero mutation | Indexed copies | Indexed copies | Direct editing |
Change Governance & AI Delete Guard |
| Limited | None | XWiki yes / Obsidian no |
Offline Local LLM / Ollama Support | Native ( | Supported | Supported | Via plugins |
Native MCP Server & Knowledge Graph | Built-in | External | Limited | Plugins |
Related MCP server: DocGraph
MCP Server Integration
ZHIXU ships a zero-dependency Model Context Protocol (MCP) stdio server (out/main/mcp.js) so Claude Code, Cursor, Codex, and Antigravity can search, cite, and explore your local audited knowledge base without hallucinating or modifying original files:
{
"mcpServers": {
"zhixu": {
"command": "node",
"args": ["/path/to/zhixu/out/main/mcp.js", "--root", "/path/to/your-knowledge-base"]
}
}
}Exposed Tools:
zhixu_search,zhixu_ask,zhixu_list_pages,zhixu_read_page,zhixu_get_graph, and governance-safezhixu_propose_draft(strictly writesdraftpages into the human Review Queue—never overwrites published baselines).Exposed Resources:
zhixu://schemaandzhixu://wiki/<slug>.
Typical Enterprise Scenarios
Engineering & Ops Knowledge Base: Compile server inventories (
.xlsx), SOP runbooks (.docx/.pdf), scripts, and incident postmortems with exact IP/port/version boosting.Policies, Standards & Compliance: Mandatory human review before publishing, preserved official baselines, explicit applicability & conflict reporting—preventing silent AI edits to formal rules.
Project Delivery & Postmortems: Unify proposals, slide decks (including speaker notes), and site photos into a cross-linked Wiki; turn multi-turn Q&A conclusions into reviewable drafts in one click.
Private / Intranet Deployment: Cloud API first by default, or switch seamlessly to LAN GPU (
vLLM/SGLang/Ollama) or local Ollama with mandatory Bearer auth and127.0.0.1default binding.
Comparison with Enterprise Open-Source KB Architectures
Dimension | Heavyweight Open-Source RAG(RAGFlow / Dify) | Lightweight Local AI(AnythingLLM) | Traditional Enterprise Wiki(XWiki / Outline) | ZHIXU · 知序 |
Core Focus | Multi-tenant RAG orchestration | Personal / small-team local chat | Manual collaborative docs | Lightweight Enterprise AI Knowledge Compiler & Governance Studio |
Deployment | Heavy (ES / DB / MinIO / Redis) | Light (Desktop / single container) | Medium (DB + web services) | Ultra-light (Desktop app, single Node process, or 1 Docker container) |
Knowledge Artifact | Vector chunks (hard to curate manually) | Vector chunks & chat logs | Manually authored pages | Auto-compiled + human-editable standard Markdown Wiki |
Anti-Hallucination | Rerank + prompt guardrails | Basic similarity retrieval | Manual writing | Mandatory source excerpt locator verification + honest refusal |
AI Change Governance | No page-level review / delete guard | No approval workflow / baselines | Workflow without AI compilation | Declarative review + AI delete recycle bin + line Diff + Git rollback |
Model Compute Split | Unified model config | Single chat/embedding model | None | Independent LLLM / LLM / VM 3-tier routing by cognitive load |
Data Openness | Coupled to internal DB & object store | Coupled to internal vector DB | Coupled to platform DB | 100% open local files (Markdown + SQLite + Git) |
Interface Preview
Architecture & Security
flowchart LR
A["Multi-Format Sources<br/>PDF · DOCX · XLSX · PPTX · Images"] --> B["Structure-Aware Chunker<br/>Code-Fence Safe · IP/Version Safe"]
B --> C["3-Tier Model Routing<br/>LLLM Plan · LLM Q&A · VM Vision"]
C --> D["Excerpt Verification<br/>Line/Page Locator Check · Drop Unverified"]
D --> E["Declarative Governance & RBAC<br/>Review Queue · AI Delete Intercept → Recycle Bin"]
E --> F["Open Local Storage<br/>Markdown · SQLite Vectors · Git"]
F --> G["RRF Hybrid Retrieval & Q&A<br/>Exact Token Boost · One-Click Save to Draft"]1. Document Parsing & Structure-Aware Chunking
Zero-Bloat OOXML Parser (
src/main/ooxml.ts): Built on Node nativezliband a pure TypeScript ZIP central directory reader..xlsxsheets emit Markdown tables with header continuation across chunks;.pptxextracts slides alongside speaker notes.Structure-Aware Semantic Chunker (
src/main/chunker.ts): Fenced code-block state machine (```and~~~), IP/version/decimal-safe sentence splitting, micro-chunk coalescing, and line/page locator tracking.
2. RRF Hybrid Retrieval & Excerpt Verification
4-Signal Fusion (
src/main/search.ts,src/main/schema.ts):Bilingual BM25:
Intl.Segmenter('zh-CN')+ bigram indexing + Chinese/English stopword filtering, cached per(root, revision, scope).Persistent SQLite Vectors: Incremental content-hash embeddings persisted in SQLite.
Word-Boundary TF-IDF Mutual Index: Enforces ASCII word boundaries and merges parenthetical aliases.
Exact Technical Token Boost + Adaptive Sigmoid Rerank: Boosts exact IP/port/version/unit tokens and calibrates Cross-Encoder logits via temperature-scaled Logistic Sigmoid (
1 / (1 + exp(-x / T))).
3. Security Hardening & Server-Side RBAC
No Universal Default Password (
src/main/admin-auth.ts):Minimum password length is 12 characters (with weak-password rejection and salted
scrypt+timingSafeEqual).First run on desktop/loopback requires interactive superadmin initialization (
/api/auth/setup).Non-loopback binds (e.g.
0.0.0.0in Docker) refuse to start unless a strongZHIXU_ADMIN_PASSWORD(>= 12chars) is supplied or non-weak accounts already exist.Per-IP and per-account login rate limiting with progressive delay, 15-minute lockout (
HTTP 429+Retry-After), and structured failure logs.
Strict Server-Side RBAC & Authoritative Session Identity (
src/main/rbac.ts,src/server/index.ts):Operator identity (
reviewedBy/createdBy) is always derived from the verified server session; client-suppliedreviewerorauthorfields are ignored.Protected
/api/sourceand/api/remove-sourcereject path traversal (..) and dot-prefixed internal paths (.localwiki/,.git/).
Role | Permitted Operations | Restricted ( |
| Search, Q&A, feedback, read pages/diffs/versions/lint, save/edit drafts, submit moderation/validation, publish, reject delete | Model API config, upload/remove sources, compile/cancel/undo, lint auto-fix, publish-all, version rollback, recycle bin confirm/restore, permanent purge, account CRUD |
| All | None |
Measured Benchmarks & Known Limitations
Run the reproducible end-to-end benchmark locally via npm run build && npm run eval (tests/eval_benchmark.mjs, compiled production HTTP server out/main/server.js, deterministic lexical + exact-token path without external LLM variance):
Metric | Measured Result | Scope / Conditions |
Fixed Corpus | 7 Markdown specs + 1 | 15 answerable technical/policy queries + 5 unanswerable out-of-scope queries |
Recall@1 / @3 / @5 | 100.0% / 100.0% / 100.0% | End-to-end |
MRR | 1.000 | Answerable technical/policy set |
Citation Excerpt Match | 100.0% (7 / 7) | Every published citation verified against immutable raw source text |
Unanswerable Refusal | 100.0% (5 / 5) | Out-of-scope queries return empty or sub-threshold ( |
HTTP Search Latency (p50 / p95) | 15.4 ms / 16.3 ms | Local loopback Node 24 ( |
Process RSS (Eval Runner) | 63.8 MB | Single-node SQLite + in-memory Orama cache |
Backup/Restore & Session Expiry | PASS | Cold directory copy + restart searchable; expired session returns |
Known Limitations
Evaluation Scope: Automated CI tests verify deterministic retrieval, excerpt locator integrity, auth/RBAC boundaries, and mock-routed synthesis; end-to-end answer quality with live models still depends on your chosen
LLLM/LLM/Embedding/Rerankprovider.Scanned PDFs: Text-layer PDFs parse natively via
pdfjs-dist; image-only scanned PDFs without embedded text require external OCR (planned on roadmap).Single-Node Storage: SQLite + local filesystem + Git targets single-team / department deployments rather than multi-region horizontally sharded SaaS clusters.
Windows Certificate: The repository certificate in
certs/zhixu-codesign.ceris self-signed (not issued by a public commercial CA); see below.
Model Routing
ZHIXU defaults to Cloud API First while supporting LAN GPU (vLLM / SGLang / Ollama) and Local Ollama. Three independent tiers can share one gateway or use separate Base URL & API Key values:
Tier | Responsibility | Cloud API Recommendations | LAN / Local Private Recommendations |
| Global Wiki planning & cross-document synthesis |
|
|
| Multi-turn Q&A, single-doc extraction, verification |
|
|
| Photos, architecture diagrams, scanned charts |
|
|
| Persistent semantic vectors & reranking |
|
|
Quick Start
First-Run Security Policy: There is no universal default password. On first desktop/loopback launch, ZHIXU prompts you to create a superadmin password (>= 12 characters). On network/Docker binds (0.0.0.0), startup refuses unless a strong ZHIXU_ADMIN_PASSWORD is provided.
Runtime Requirement: Node.js
>= 22.13(24.xrecommended, built-innode:sqlite).
Run Desktop App Locally
git clone https://github.com/JoeJiang-927117/zhixu.git
cd ZHIXUAgentic-Knowledge-Base
npm install
npm run devSwitch between English and 简体中文 anytime from the login bar, workspace titlebar (
EN / 中文), or Command Palette (Ctrl + K).Shortcuts:
Ctrl + Kopens the Command Palette;Ctrl + Ssaves draft in the split Markdown editor.
Typecheck, Build, Security Tests & Benchmark
npm run typecheck
npm run build
npm test # Runs core unit tests + server RBAC/auth/rate-limit tests + eval benchmark
npm run eval # Runs fixed-corpus retrieval/citation/refusal/restore benchmark standalonePackage Windows Desktop Client
npm run package:dir # Portable folder -> release/win-unpacked/
npm run package # NSIS installer -> release/Deployment & API
Docker Compose
Copy .env.example to .env, set ZHIXU_ADMIN_PASSWORD (>= 12 chars) and ZHIXU_API_KEY, then start:
cp .env.example .env
# Edit .env: set ZHIXU_ADMIN_PASSWORD (>= 12 chars) and ZHIXU_API_KEY
docker compose up -d --buildStandalone Node Server
ZHIXU_ROOT=/data/knowledge-base \
ZHIXU_API_KEY=your-api-key \
ZHIXU_SERVER_TOKEN=your-strong-token \
ZHIXU_ADMIN_PASSWORD=YourStrongPassword#2026 \
npm run serverVariable | Description | Default |
| Server bind host & port |
|
| Knowledge base root path inside the Node process / Docker container |
|
| Host directory bind-mounted into Docker container |
|
| Mode: |
|
| Primary OpenAI-compatible gateway URL |
|
| Default shared API key | empty |
| LLLM reasoning model (optional |
|
| LLM Q&A model (optional |
|
| VM vision model (optional |
|
| Persistent vector embedding model |
|
| Optional Cross-Encoder rerank endpoint | empty |
| Server Bearer token (auto-generated if empty) | auto-generated |
| Comma-separated CORS allowlist | loopback only |
| Initial superadmin username & strong password ( |
|
Protected endpoints require Authorization: Bearer <TOKEN> (server token or admin session token from /api/auth/login):
Method & Path | Description |
| Health & authentication status |
| Admin login returning a session token |
| Full workspace snapshot |
| Upload raw source file (Base64 JSON) |
| Trigger incremental scan, chunking & Wiki compilation |
| Manually create/edit Wiki page with version snapshot & Git commit |
| Review transition & delete approval (publish / reject / recycle / restore) |
| RRF multi-signal hybrid search |
| Multi-turn context-aware cited Q&A |
| Deterministic health check & code-safe broken-link fix |
Roadmap
Multi-format parsing (including zero-dependency
.xlsx/.pptx) & code-fence-safe chunkingRRF hybrid search, persistent SQLite vector cache, word-boundary TF-IDF mutual index & Sigmoid reranking
Built-in split Markdown editor, multi-turn Q&A, one-click save-to-draft & English/Chinese bilingual UI
Declarative review workflow, AI delete guard recycle bin & Git version chain
Page-level RBAC access isolation & organizational role mapping
Local OCR for scanned PDFs & complex multi-column layout reconstruction
Automated retrieval recall & citation faithfulness benchmark suite
License & Self-signed Windows Certificate
Open-Source License: Licensed under the Apache License, Version 2.0 (commercial-friendly, explicit patent grant; preserve LICENSE and NOTICE when redistributing).
Third-Party Notices: See THIRD_PARTY_LICENSES.md.
Security Policy: See SECURITY.md.
Contributing: See CONTRIBUTING.md and CHANGELOG.md.
Self-signed Windows Certificate:
certs/zhixu-codesign.ceris a self-signed RSA-4096 / SHA-256 certificate (Thumbprint252C0ECD64B70B122EF0FEF369120D624B1175D2) intended for internal/intranet integrity verification—it is not issued by a public commercial CA. For public Windows distribution without SmartScreen warnings, sign with a commercial OV/EV certificate viaCSC_LINK/CSC_KEY_PASSWORD(seecerts/README.md).
Star History
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Self-hostable team wiki; agents read & write it via MCP; Atlas turns your repo into a cited wiki.
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server that indexes Markdown, Word, HTML, and PDF documents into a SQLite knowledge graph with CJK+Latin full-text search and cross-document reference tracking. Runs drift audits to surface stale policies, conflicting research claims, superseded ADRs, and undocumented code exports.109MIT
- AlicenseBqualityCmaintenanceUniversal documentation knowledge-graph MCP server with hybrid full-text + vector search. Indexes local files and remote sources from Notion, Jira, Obsidian, Linear, GitHub, and Confluence into a single SQLite knowledge graph, exposing it to AI agents via the Model Context Protocol.1020 npmMIT
- AlicenseNot gradedqualityCmaintenanceRead-only local-first MCP server enabling AI assistants to semantically search private Markdown, PDF, and Tika-backed knowledge bases without data upload.44MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that gives AI coding agents a git-backed markdown wiki to read and update, enabling search, read, write, verify, ingest, promote, and lint operations on versioned knowledge documents with schema validation, staleness tracking, and contradiction detection.4MIT