Skip to content

msbrettorg/maenifold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

218 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maenifold

Your AI is ephemeral. Your context shouldn't rot.

Latest Release MIT License

What is maenifold?

Context engineering infrastructure implementing Anthropic's published principles for building capable agents.

AI agents generate massive thinking data. Without management, old thoughts compete with new conclusions for the attention budget—a phenomenon called context rot. Maenifold prevents this through:

  • Just-in-time retrieval: [[WikiLinks]] as lightweight identifiers, not payloads
  • Compaction: Memory cycles consolidate episodic → semantic
  • Decay: Time-based signal-to-noise management (calibrated to iteration speed)
  • Structured note-taking: Sequential thinking with graph integration
  • Sub-agent architectures: Clean contexts, condensed handoffs

Six composable layers: [[WikiLinks]] → Graph → Hybrid Search → Session State → Reasoning → Orchestration. No magic. No fake AI. Space for intelligence to emerge.

Quick Start

Install

# Homebrew (macOS/Linux) — handles PATH automatically
brew install msbrettorg/tap/maenifold

# Manual — download from GitHub Releases, extract, add to PATH or symlink
# https://github.com/msbrettorg/maenifold/releases/latest

Requirements

Platform Binary Notes
macOS osx-arm64, osx-x64 Apple Silicon or Intel; Homebrew recommended
Linux linux-x64, linux-arm64 x64 or ARM64
Windows win-x64 x64 only; use PowerShell syntax below

Binaries are self-contained (.NET 9.0 bundled). Vector embeddings use ONNX runtime (bundled). No external dependencies.

Use the CLI

macOS/Linux (bash):

maenifold --tool WriteMemory --payload '{"title":"Auth Decision","content":"Using [[OAuth2]] for [[authentication]]"}'
maenifold --tool SearchMemories --payload '{"query":"authentication","mode":"Hybrid"}'
maenifold --tool BuildContext --payload '{"conceptName":"authentication","depth":2}'
maenifold --tool Sync --payload '{}'

Windows (PowerShell):

maenifold --tool WriteMemory --payload '{\"title\":\"Auth Decision\",\"content\":\"Using [[OAuth2]] for [[authentication]]\"}'
maenifold --tool SearchMemories --payload '{\"query\":\"authentication\",\"mode\":\"Hybrid\"}'
maenifold --tool BuildContext --payload '{\"conceptName\":\"authentication\",\"depth\":2}'
maenifold --tool Sync --payload '{}'

The CLI is the primary interface. See SCRIPTING.md for advanced patterns.

Build domain expertise — See Bootstrap Guide for the full journey: research workflows, custom roles, custom workflows, and maintenance.

MCP vs CLI

Both interfaces have full feature parity. Choose based on your use case:

Interface Advantage Best for
MCP Auto-sync watcher keeps graph current Interactive sessions, simple queries
CLI Filter intermediate results, preserve context (why this matters) Complex workflows, scripting, Graph-RAG patterns

MCP config (for Claude Code, Claude Desktop, etc.):

{
  "mcpServers": {
    "maenifold": { "command": "maenifold", "args": ["--mcp"], "type": "stdio" }
  }
}

Skills

Skill What You Get
Maenifold 25+ tools, 6-layer composable layers, sequential thinking, 35+ workflows
Product Manager maenifold-aware agents, graph context injection, quality gates, sprint traceability

Core Mechanisms

Layered from theory → memory → symbols → reasoning → orchestration → assets

Philosophical Foundations

Concept Origin Application
Ma (間) Japanese aesthetics The space between things as the thing itself (what we don't do)

Theoretical Foundations

Concept Origin Application
Context Engineering Anthropic (2025) Attention budget management: just-in-time retrieval, compaction, decay, structured notes, sub-agents
ACT-R Anderson (CMU); Wixted & Ebbesen (1991) Power-law inspired decay (exponential approximation)
New Theory of Disuse Bjork & Bjork Storage vs retrieval strength
Two-Stage Memory Cognitive neuroscience Episodic → semantic consolidation
Linguistic Relativity Weak form (Boroditsky, 2003) Perspectives change the linguistic frame of LLM reasoning
ConfessionReport OpenAI (Barak et al., 2025) Inference-time honesty enforcement via hooks + adversarial audit
Feature What It Means Implementation
Two-Stage Model Fast episodic encoding → slow semantic consolidation memory://thinking/ (episodic) vs memory://research/ (semantic)
ACT-R Decay Memories fade without access following power-law DecayCalculator: base × time^(-0.5)
Storage vs Retrieval Pointers persist; only accessibility fades WikiLinks never deleted; decay affects ranking
Maintenance Cycles Periodic graph hygiene 4 workflows: consolidation, decay, repair, epistemic
Consolidation Thinking sessions → semantic memory Replay via RecentActivity, distill to WriteMemory, link via FindSimilarConcepts

Symbolic Systems

Feature What It Means Implementation
Concept-as-Protocol WikiLinks carry context between agents PreToolUse hook extracts [[concepts]], injects graph context
Lazy Graph No predefined schema; structure emerges Sync extracts WikiLinks; co-occurrence creates edges
Hybrid Search Semantic similarity + exact matching SearchMemories fuses with Reciprocal Rank Fusion (k=60)
Concept Repair Normalize WikiLink variants safely RepairConcepts validates similarity ≥0.7 before replacing

Reasoning

Feature What It Means Implementation
Sequential Thinking Multi-step reasoning with persistence, graph integration, multi-agent branching Extends MCP server with sessionId, branchId, parentWorkflowId
Assumption Ledger Track beliefs and their validation status AssumptionLedger with confidence levels, evidence links

Workflow System

Feature What It Means Implementation
Workflow Engine Structured multi-step methodology execution Workflow tool with JSON steps, toolHints, guardrails
Nested Composition Workflows invoke other workflows and tools Workflows embed SequentialThinking; bidirectional linking
Session Persistence Resume reasoning across days State in memory://workflow/; session IDs enable continuation

Notable Workflows:

Workflow What It Demonstrates How
Workflow Dispatch Meta-cognitive methodology selection Analyzes problem characteristics, queries graph for similar past problems, selects optimal workflow
Research Think Tank Multi-agent collaborative reasoning Defines roles (synthesizer, critic, explorer), structures knowledge construction phases
Agentic SLC Quality-controlled development Embeds anti-slop checks, requires RTM traceability, enforces ConfessionReports
Constitutional Roles Constitutional AI for persona creation Uses principles + examples to generate role definitions that constrain agent behavior
Higher-Order Thinking Meta-cognitive reflection Recursive self-analysis steps: examine reasoning, identify biases, refine approach
Six Thinking Hats Structured perspective switching Sequences through DeBono's colors with explicit transitions and synthesis

Multi-agent orchestration requires an MCP client with agent dispatch (Claude Code, Codex, aishell) or CLI scripting with subprocess spawning.

Cognitive Assets

Asset Count Examples
Workflows 35+ Deductive, design thinking, agentic sprints, game theory
Roles 16 Architect, PM, red-team, blue-team, researcher
Thinking Colors 7 DeBono's Six Hats + Gray (skeptical inquiry)
Perspectives 12 Native language modes for culturally-aware reasoning

Configuration

Claude Desktop — Same MCP config, different location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Custom data directory:

export MAENIFOLD_ROOT=~/my-knowledge-base

Technical Specifications

Spec Value
Language C# / .NET 9.0
Vectors 384-dim (all-MiniLM-L6-v2 via ONNX)
Search Reciprocal Rank Fusion (k=60)
Database SQLite + sqlite-vec (bundled)
Memory Cycle 24h compaction interval; decay params expressed as cycle multiples (volume-dependent, scriptable)
Decay Model ACT-R power-law (d=0.5); calibrated to memory cycle: sequential (2-3×), workflows (7×), memory (14-28×)
Memory Tiers Grace periods anchored to iteration speed: Sequential (2-3d) / Workflows (7d) / Semantic (14-28d)
Maintenance 4 workflows (consolidation/decay/repair/epistemic) mirror biological sleep phases
Scale > 1M relationships tested

Decay affects search ranking only. Files are never deleted.

Local-only, single-user, no authentication. Memory files (markdown) are the source of truth; the SQLite database is a regenerable cache (maenifold --tool Sync). Version control memory with git to track changes alongside code. Set MAENIFOLD_ROOT to store memory in your repository for atomic commits of code + reasoning.

Documentation

Community

MIT License. Contributions welcome at github.com/msbrettorg/maenifold.


Stargazers over time

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •