wiki.mcp
Auto-discovers a running local Ollama inference server on port 11434, allowing the harness to use local models as a zero-extra-VRAM inference backend.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wiki.mcp navigate /README.md at high depth and verify citations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cortical
Autonomous Agentic Harness for pi, 4-Tier Deterministic Merkle/Macro-Graph Second Brain MCP, Adaptive Permission Gate & Dual-Path Voice Engine
Author: Carlo Cancellieri (GitHub · ORCID: 0009-0006-4092-4234)
License: Apache License 2.0 (Apache-2.0)
Platforms: macOS (Apple Silicon Metal) & Linux (NVIDIA CUDA / Vulkan / CPU)
System Architecture
+-----------------------------------------------------------------------------------+
| USER INTERACTION LAYER (CLI & VOICE) |
| • Dual-Path Voice Engine (`cortical.voice`): Wake-word + Resilient Barge-in |
| - System 1 Reflex (<900ms): Fast Q&A, Status Checks, Voice Permission Approval |
| - System 2 Agentic: Async background delegation to `pi` Orchestrator |
+-----------------------------------------+-----------------------------------------+
|
v
+-----------------------------------------------------------------------------------+
| `pi` AGENTIC HARNESS (`.pi/extensions/cortical-harness.ts`) |
| • Orchestrator (`delegate_subagent` / `submit_report` with bounded `maxTurns`) |
| • Adaptive Permission Gate (`cortical.permissions`): |
| - Hard Guardrails (blocks `rm -rf /`, credential leaks, focus-stealing UI) |
| - Progressive Risk Learning (auto-approves recurring patterns after feedback) |
+-------------------+-------------------------------------------+-------------------+
| |
v (JSON-RPC 2.0 MCP) v (Deferred Skills & MCP)
+---------------------------------------+ +---------------------------------------+
| CORTICAL SECOND BRAIN (`wiki.mcp`) | | WEB & CODE AUTOMATION SUITE |
| • 4-Tier Deterministic Merkle Tree: | | • `chrome-devtools-mcp` (Deferred) |
| 1. `light` (~50 tok index) | | • Skill: `modern-web-guidance` |
| 2. `medium` (~250 tok digest) | | (3-Strategy SPA/React Resilience, |
| 3. `high` (~1000 tok synthesis) | | Strict Zero Focus-Stealing) |
| 4. `max` (Full raw file) | | • Skill: `browser-use-playwright` |
| • High-Level Episode Macro-Graph | | • Skill: `cortical-second-brain` |
| • 2-Stage NLI Citation Fact-Checker | +---------------------------------------+
| • Multi-Tenant Relational RBAC/ACL |
+---------------------------------------+Related MCP server: CiteAnything MCP Server
The 5 Second Brain Pillars + Hybrid Tree/Macro-Graph
Parallel Deterministic Indexing (
crawler.py): UsesThreadPoolExecutorand bottom-upsha256Merkle subtree hashing. Unchanged files and directories are skipped in $O(1)$.2-Stage Citation Fact-Checking (
fact_check.py): Verifies verbatim span containment against the raw document hash + evaluates semantic entailment (verified/refuted/unverified) via an NLI decision model.Multi-Tenancy (
db.py): Nativetenant_idandworkspace_idisolation in SQLite WAL (with a schema 1:1 portable to PostgreSQL).Scalability via Hybrid Merkle Tree + Macro-Graph: Avoids $O(N^2)$ chunk graphs on thousands of documents by keeping documents in a 4-tier Merkle tree (
light,medium,high,max) while maintaining a lightweight High-Level Macro-Graph (task_episodes+macro_edges) for cross-task episodic memory.Relational Permissions (RBAC/ACL): Path-prefix read/write permissions (
acl_permissions) enforced directly at SQL query time.
3-Step Quickstart
Step 1 — Run the One-Shot Setup & Hardware Auto-Profiler
bash ./scripts/setup.shsetup.sh creates .venv, runs cortical doctor to inspect your CPU/RAM/GPU/VRAM and auto-discover any running local inference servers (:8080 llama-server, :11434 Ollama, :8081 whisper-server) so small laptops incur zero extra VRAM overhead, generates .pi/mcp.json, and crawls the workspace into the Second Brain.
Step 2 — Navigate the 4-Tier Second Brain & Verify Citations
# Navigate root at 'light' depth (~50 tokens)
.venv/bin/cortical --db .cortical_data/wiki.db navigate --path / --depth light
# Escalate to 'high' or 'max' on a specific file
.venv/bin/cortical --db .cortical_data/wiki.db navigate --path /README.md --depth high
# Test the Dual-Path Voice router
.venv/bin/cortical voice-eval "Ehi Cortical, orchestra un sottoagente per analizzare il progetto"Step 3 — Run the Complete Test Suite
.venv/bin/python -m unittest discover -s tests -vAvailable Tools
5 toolswiki_crawl_deltaC
Run the deterministic parallel Merkle-tree crawler on a directory, updating only modified branches.
Inputs: root_dir (required), principal_id.
wiki_record_episodeC
Record a completed agentic task episode and link it in the High-Level Macro-Graph.
Inputs: goal (required), title (required), episode_id (required), outcome_status (required), +3 more.
wiki_searchC
Full-text FTS5 search across the Second Brain with RBAC filtering and depth projection.
Inputs: query (required), depth, limit, principal_id.
wiki_verify_citationB
Verify a claim and quoted span against a source path using deterministic span check + NLI decision model.
Inputs: claim_text (required), quoted_span (required), source_path (required), principal_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action: search (FTS retrieval), navigate (depth-projected tree read), crawl_delta (indexing), verify_citation (validation), record_episode (write/append). The only mild overlap is search vs. navigate, since both are retrieval paths, but the descriptions (FTS5 vs. Merkle-tree depth projection) give an agent enough signal to choose correctly.
All five tools follow a strict wiki_<verb>_<noun> pattern (wiki_search, wiki_navigate, wiki_crawl_delta, wiki_verify_citation, wiki_record_episode). The prefix and snake_case style are consistent, so the set is predictable and easy to scan.
Five tools is well within the ideal 3-15 range for a knowledge-base server, and each one maps to a distinct lifecycle stage (retrieve, project, index, verify, record). No obvious filler or redundant tools are present.
The surface covers read/search, indexing, citation verification, and episode recording, but there is no page-level write path: no create/update/delete of a note or branch, and no listing or backlink operation. An agent that needs to author or correct content would hit a dead end and have to fall back to raw content delivery.
Maintenance
Related MCP Connectors
Company brain for AI agents — temporal knowledge graph search, exploration, and durable memory.
Shared persistent memory for AI agents to read, verify, continue, and connect knowledge.
Machine-native research commons for agent evidence, discovery, rooms, and bounded research quests.
Attestable memory for AI agents: curated writes, verifiable tenant isolation, bi-temporal facts.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to use a neuro-symbolic memory fabric with bi-temporal knowledge graph and holographic VSA, providing tools for adding, searching, temporal queries, auditing, and proving memories with cryptographic provenance and zero-LLM ingest.2Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create verifiable, replayable citations, search private knowledge bases, and publish Markdown with verified citation markers.MIT
- AlicenseNot gradedqualityBmaintenanceProvides AI agents a shared long-term memory layer with evidence-backed, auditable claims, enabling persistent, explainable, and conflict-aware recall across sessions.8MIT
- AlicenseAqualityBmaintenanceEnables AI agents to retrieve compact, evidence-backed knowledge graph packets, verify claims against sourced provenance, trace cryptographic audit trails, and explore entity relationships while minimizing context token usage.1213 npm1MIT