Skip to content
daryn987 edited this page Jan 19, 2026 · 3 revisions

🧠 Unified AI System Wiki (Full System) A complete documentation set for your local AI operating system.

📘 Index • Overview • Architecture • Cognitive Loop MCP • v0.1 • v0.2 • v0.3 • v0.4 • v0.5 • run_cycle • reflect • Knowledge Graph MCP • Schema • Nodes • Edges • State Node • serverpy • Long‑Term Memory MCP • Paperless MCP Integration • Orchestration Patterns • Nightly Cycles • Reflection Engine • Agent Architecture • Workflows • Developer Onboarding Guide • Cheat Sheet • Whitepaper Overview

🟦 Overview Your system is a local AI operating system composed of: • A Cognitive Loop that plans, executes, and reflects. • A Knowledge Graph that stores structured memory. • A Long‑Term Memory MCP for durable facts. • A Paperless integration layer for ingesting documents. • A reflection engine that produces insights and summaries. • A nightly autonomous cycle that maintains and evolves the system. • A multi‑agent orchestration layer that coordinates tools. The design philosophy: • Hybrid realism: grounded logic with cinematic distortion. • Maximal agency: the system feels alive, expressive, and self‑maintaining. • All‑at‑once upgrades: avoid incrementalism. • Clarity and correctness: every subsystem is documented and testable.

🟦 Architecture Your system consists of four major layers:

  1. Cognitive Layer • Plans tasks • Executes MCP calls • Reflects on results • Writes insights to the Knowledge Graph
  2. Memory Layer • Knowledge Graph (structured) • Long‑Term Memory MCP (durable facts) • Paperless ingestion (documents → nodes)
  3. Orchestration Layer • Multi‑agent workflows • Tool selection logic • State node persistence
  4. Autonomy Layer • Nightly cycles • Self‑maintenance • Self‑extension

🟦 Cognitive Loop MCP v0.1 • Basic loop: plan → execute → reflect. • No state persistence. • No multi‑step reasoning. v0.2 • Added structured reflection. • Added multi‑tool plans. • Added error‑aware retries. v0.3 • Introduced run_cycle and reflect tools. • Added state node integration. • Added plan‑based autonomy. v0.4 • Added multi‑agent orchestration. • Added context windows from Knowledge Graph. • Added memory‑aware planning. v0.5 • Full autonomy modes: • autonomous • nightly • Persistent state across cycles. • Self‑maintaining knowledge graph updates. • Reflection engine upgraded to produce: • insights • summaries • new nodes • new edges • state updates

🟦 run_cycle Input: • user goal • current state • recent context Output: A structured plan:

🟦 reflect Input: • results of executed steps • previous state Output: • insights • summaries • new nodes • new edges • updated state Reflection is the system’s “inner monologue.”

🟦 Knowledge Graph MCP Schema Tables • nodes • id • type • content • metadata (JSON) • created_at • edges • id • source_id • target_id • type • metadata (JSON) • state • id = 1 • json blob containing: • last_cycle • active_goals • memory pointers • agent statuses

Nodes Types include: • • • • • • • •

Edges Types include: • • • • • •

State Node The single source of truth for: • active goals • last cycle • memory pointers • agent statuses • nightly cycle progress

server.py Implements: • SQLite connection • Node/edge CRUD • State node read/write • JSON‑RPC interface • Validation layer

🟦 Long‑Term Memory MCP Stores: • durable facts • user preferences • stable traits • long‑term goals Used by: • Cognitive Loop • Reflection Engine • Nightly Cycle

🟦 Paperless MCP Integration Pipeline:

  1. Paperless search → document metadata
  2. Paperless get → full text
  3. Ingest into Knowledge Graph
  4. Create: • document node • summary node • edges linking them

🟦 Orchestration Patterns • Plan‑based execution • Multi‑agent delegation • State‑driven branching • Memory‑aware planning • Reflection‑driven updates

🟦 Nightly Cycles Nightly mode performs: • Knowledge graph cleanup • Summarization • Fact extraction • Long‑term memory updates • State node maintenance • Self‑extension (adding new capabilities)

🟦 Reflection Engine Produces: • insights • summaries • contradictions • new tasks • new nodes • new edges It is the system’s “thinking about thinking.”

🟦 Agent Architecture Agents include: • Planner • Executor • Reflector • Memory Agent • Document Agent • State Manager Each agent is stateless but reads/writes the state node.

🟦 Workflows Examples: • Document ingestion • Research assistant • Autonomous nightly maintenance • Multi‑step planning • Knowledge graph exploration

🟦 Developer Onboarding Guide Covers: • Installing MCP servers • Running Cognitive Loop • Testing run_cycle • Testing reflect • Inspecting the Knowledge Graph • Debugging state node issues

🟦 Cheat Sheet Quick reference for: • MCP calls • Node types • Edge types • State node fields • Reflection patterns

🟦 Whitepaper Overview A high‑level conceptual document explaining: • Why cognitive loops matter • Why knowledge graphs are essential • How autonomy emerges • How nightly cycles maintain the system • How multi‑agent orchestration creates expressive behavior

Clone this wiki locally