JSPM

  • Created
  • Published
  • Downloads 518
  • Score
    100M100P100Q126749F
  • License MIT

Monomind - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (monomind) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Monomind β€” Autonomous Claude Code Orchestration

    Monomind Logo

    Monomind

    Build. Learn. Evolve. Without stopping.

    The self-learning orchestration layer that turns Claude Code
    into an autonomous, multi-agent engineering team.

    Documentation npm version downloads stars license node

    πŸ“– Full Docs  •  Quickstart  •  What It Does  •  Features  •  Commands  •  Memory


    What is Monomind?

    You already use Claude Code. Monomind makes it autonomous.

    Type one command. Walk away. Come back to a clean codebase.

    /mastermind:autodev --tillend --focus security

    Monomind researches your project, selects the highest-impact improvement, builds it with a coordinated agent chain, reviews until zero findings β€” then repeats. Indefinitely. Until there's nothing left to fix.

    Without Monomind: You prompt Claude, wait, review, iterate.
    With Monomind: You set a direction. Monomind executes.


    Quickstart

    # Install
    npm install -g monomind
    
    # Initialize in your project
    cd your-project
    monomind init
    
    # Wire into Claude Code
    claude mcp add monomind npx monomind mcp start
    
    # Start the background daemon
    monomind daemon start

    That's it. Open Claude Code and start orchestrating.

    β†’ Full setup guide


    What Monomind Does

    Autonomous Build Loop β€” /mastermind:autodev

    The flagship command. Research β†’ Build β†’ Review β†’ Repeat.

    Phase 1  Research     Parallel scan: git log, file analysis, TODO/FIXME grep,
                          monograph god nodes, memory search for prior work.
                          Returns ranked list of 3-5 improvement candidates.
    
    Phase 2  Selection    Picks by feasibility Γ— blast radius Γ— focus alignment.
                          Stores selection to memory. Avoids repeating past work.
    
    Phase 3  Build        Spawns architect β†’ coder β†’ tester β†’ reviewer chain.
                          Runs with concrete spec and acceptance criteria.
    
    Phase 4  Review Loop  Code Reviewer + Security Engineer + Reality Checker
                          run in parallel. Auto-fixes. Repeats up to 5Γ— until clean.
    
    Phase 5  Log          Records completion. Continues to next improvement.
                          --tillend schedules the next session automatically.
    /mastermind:autodev                     # 1 improvement
    /mastermind:autodev 5                   # 5 improvements in sequence
    /mastermind:autodev --tillend           # run until nothing is left
    /mastermind:autodev --focus security    # bias toward security work
    /mastermind:autodev --focus dx          # bias toward developer experience
    /mastermind:autodev --newfeature 3      # discover & fully deliver 3 brand-new features
                                            # (build β†’ review β†’ document β†’ stage each one)

    From Prompt to Coordinated Execution

    You: "Add webhook delivery with retries and a dead-letter queue"
    
    Monomind:
      1. Software Architect   β†’ designs the system
      2. backend-dev          β†’ implements webhook dispatcher
      3. backend-dev          β†’ implements retry logic with exponential backoff
      4. Database Optimizer   β†’ designs dead-letter queue schema
      5. tester               β†’ writes integration tests
      6. Code Reviewer        β†’ reviews all changes before merge

    β†’ See all 10 pages of documentation


    Features

    230+ Specialized Agents

    Not generic assistants β€” domain experts with targeted system prompts, each optimized for a specific class of work.

    Category Examples
    Engineering Backend Architect, Frontend Developer, Database Optimizer, SRE, Embedded Firmware Engineer
    Security Security Engineer, Threat Detection Engineer, Blockchain Security Auditor
    Architecture Software Architect, System Architect, Salesforce Architect
    Game Dev Unity Architect, Unreal Systems Engineer, Godot Scripter, Roblox Systems Scripter
    Marketing SEO Specialist, TikTok Strategist, Content Creator, Growth Hacker
    Product Product Manager, Sprint Prioritizer, CRO Specialist, Launch Strategist
    AI/ML AI Engineer, ML Developer, Data Engineer, Model QA Specialist
    Swarm/Consensus Hierarchical Coordinator, Mesh Coordinator, CRDT Synchronizer, Quorum Manager

    Swarm Topologies

    Coordinate multiple agents working in parallel on the same problem:

    Swarm Topology

    Topology Best For
    Hierarchical Feature development β€” coordinator delegates to specialists
    Mesh Research β€” all agents share findings peer-to-peer
    Hierarchical-Mesh Complex projects β€” structured delegation with cross-talk
    Adaptive Unknown complexity β€” topology evolves based on task
    Centralized Simple tasks β€” single coordinator, minimal overhead
    Hybrid Mixed β€” star topology with selective mesh connections

    Consensus algorithms: Raft (leader-based), Byzantine (fault-tolerant up to f < n/3), Gossip (eventually consistent), CRDT (conflict-free), Quorum (majority vote).

    /mastermind          # topology picker β€” recommends the best option for your task
    monomind swarm init --topology hierarchical --agents 8 --strategy specialized

    Self-Learning Memory β€” The Memory Palace

    Every interaction makes Monomind smarter:

    Layer What It Stores Tech
    Short-term In-flight context (current session) SQLite + in-memory cache
    Long-term Persistent knowledge and patterns AgentDB + HNSW
    Contextual Summarized episode clusters RAPTOR consolidation worker
    Shared Cross-agent state and promotions PartitionedHNSW
    • Pure-JS HNSW semantic search via AgentDB indexing
    • Hybrid backend β€” SQLite for structured data + AgentDB for semantic
    • BM25 + vector hybrid retrieval β€” precision + recall
    • Session continuity β€” pick up exactly where you left off

    Knowledge Graph β€” Monograph

    30 graph tools that build a full dependency map of your codebase:

    monograph_suggest "add webhook retry logic"  # β†’ ranked relevant files
    monograph_query "UserService dependencies"   # β†’ file paths + line numbers
    monograph_god_nodes                          # β†’ high-centrality files
    monograph_impact "auth.ts"                   # β†’ blast radius before changing

    Queried automatically before every task. No manual invocation needed.

    Keyword Routing & Outcome Measurement

    Monomind routes tasks deterministically and measures whether the routing helped:

    • Keyword routing β€” createKeywordRouter maps tasks to handlers without an LLM call
    • Route-outcome correlation β€” recommended routes are auto-correlated with actual outcomes; doctor surfaces routing accuracy and recommended-vs-actual adherence
    • Trajectory + outcome logging β€” steps, trajectories, and command results are recorded for later analysis

    The full neural learning loop (SONA modes, LoRA, EWC++, Reasoning Bank) lives on the monoes-full-loop branch.

    3-Tier Model Routing

    Monomind routes every task to the cheapest model that can handle it:

    Tier Handler Latency Cost Use Cases
    1 Agent Booster (WASM) <1ms $0 Simple transforms β€” skip the LLM
    2 Haiku ~500ms $0.0002 Low-complexity tasks (<30%)
    3 Sonnet / Opus 2-5s $0.003-0.015 Complex reasoning, architecture

    29+ Hooks + 12 Background Workers

    Monomind hooks into every phase of your Claude Code workflow:

    Hook What It Does
    pre-task Routes to the best agent, suggests topology
    post-task Learns from outcomes, updates neural patterns
    pre-edit Context suggestions, blast radius check
    post-edit Indexes new code into the knowledge graph
    session-start Restores context, preloads relevant memory
    session-end Persists learnings, updates metrics

    Background workers (12 total): ultralearn, optimize, consolidate, predict, audit, map, preload, deepdive, document, refactor, benchmark, testgaps β€” all autonomous.


    Live Dashboard

    Real-time visibility into every project, session, agent, memory operation, route decision, and token spend.

    monomind daemon start    # starts background workers and session tracking

    Sessions are fully recorded and replayable β€” full conversation replay with tool breakdown, agent spawns, and memory operations.


    Commands

    53+ CLI Commands

    monomind init                              # Project initialization wizard
    monomind agent spawn --type coder          # Spawn a specific agent
    monomind swarm init --topology mesh        # Initialize a swarm
    monomind memory search "auth patterns"     # Search vector memory
    monomind hooks route --task "fix bug"      # Route to best agent
    monomind neural status                      # Inspect pattern-learning status
    monomind doctor --fix                      # Diagnose and auto-fix issues
    monomind daemon start                      # Start background workers

    β†’ Full CLI reference

    160+ Slash Commands (inside Claude Code)

    Command What It Does
    /mastermind:autodev Autonomous research β†’ build β†’ review loop
    /mastermind:review --tillend Keep reviewing and auto-fixing until clean
    /mastermind:build <brief> Build a specific feature with an agent chain
    /mastermind:architect System architecture design and review
    /mastermind:research Deep research with structured output
    /mastermind:createtask Decompose a spec into executable tasks
    /mastermind:idea Research β†’ evaluate β†’ create implementation tasks
    /mastermind:do Execute tasks from the board with parallel agents
    /mastermind:review Multi-agent iterative review with auto-fix
    /mastermind Topology picker β€” recommends best swarm for your task

    β†’ Full slash command reference

    --tillend β€” Fully Autonomous Loops

    Any command can run autonomously until there's nothing left to do:

    /mastermind:autodev --tillend --focus security
    # β†’ runs until every security issue is found and fixed
    
    /mastermind:review --tillend --auto
    # β†’ reviews and fixes until zero findings
    
    /mastermind:autodev 5 --tillend --maxruns 20
    # β†’ 5 improvements per session, up to 20 sessions

    The loop uses ScheduleWakeup to resume across sessions. A staleness guard prevents duplicate runs. Human-in-loop items pause and wait for your response before continuing.

    # Stop a loop at any time
    touch .monomind/loops/{loop-id}.stop

    Architecture

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                           Monomind                              β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β”‚  230+ Agents    β”‚  Swarm Engine  β”‚ Memory Palace β”‚  Intelligence β”‚
    β”‚                 β”‚               β”‚              β”‚               β”‚
    β”‚  Specialized    β”‚  6 topologies  β”‚ AgentDB HNSW β”‚  Keyword      β”‚
    β”‚  agent defs     β”‚  5 consensus   β”‚ Knowledge    β”‚  routing +    β”‚
    β”‚  + 3-tier       β”‚  algorithms    β”‚ Graph        β”‚  outcome      β”‚
    β”‚  routing        β”‚               β”‚ (Monograph)  β”‚  measurement  β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β”‚                   29+ Hooks + 12 Background Workers             β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β”‚                  MCP Server (stdio / http / WebSocket)          β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β”‚                        Claude Code Runtime                      β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    Key Packages

    The workspace ships 16 @monomind/* packages:

    Package Purpose
    @monoes/monomindcli CLI entry point β€” 43 top-level commands, 230+ agent defs, 160+ slash commands, hooks, MCP server
    @monomind/memory AgentDB + HNSW vector search, PartitionedHNSW, TierManager, hybrid SQLite backend
    @monomind/hooks Lifecycle hook bridge, 12 background workers (ultralearn, optimize, consolidate, predict, audit, map, preload, deepdive, document, refactor, benchmark, testgaps)
    @monomind/monograph Knowledge graph construction, 30 MCP tools, BM25 + semantic search
    @monomind/graph AST-based node/edge extraction, community detection, RAPTOR consolidation
    @monomind/swarm UnifiedSwarmCoordinator, 6 topologies, 5 consensus algorithms
    @monomind/security Input validation, prompt injection detection, CVE remediation, gVisor sandbox
    @monomind/mcp MCP server transport (stdio / http / WebSocket)
    @monomind/routing Two-stage LLM + keyword agent routing, confidence scoring
    @monomind/performance Profiling, benchmarking, latency tracking
    @monomind/plugins IPFS/Pinata plugin registry, install/create/list
    @monomind/claims Claims-based authorization for agent actions
    @monomind/aidefence Adversarial input detection, semantic scanning
    @monomind/guidance Governance control plane, workflow templates, budget management
    @monomind/shared Shared types, constants, utilities

    Performance

    Metric Result Notes
    Vector search Pure-JS HNSW via AgentDB Approximate nearest-neighbor (Malkov & Yashunin 2018); implemented in hnsw-index.ts
    Agent routing (LLM) <2s Target; Haiku-based routing
    Agent routing (fallback) <5ms Keyword scoring path
    Session restore <500ms cold start Target
    Memory reduction 50–75% vs baseline Target

    Who Uses Monomind?

    • Solo developers β€” the power of a full engineering team from one terminal
    • Startups β€” ship features 10x faster with autonomous agent pipelines
    • Enterprise teams β€” coordinate complex multi-module changes without drift
    • Security teams β€” automate audit, CVE triage, and compliance workflows
    • Game studios β€” Unity, Unreal, Godot, and Roblox specialists on demand
    • Marketing teams β€” content operations with 27 domain-specific marketing agents

    Documentation

    Full interactive documentation: monoes.github.io/monomind

    Section Description
    Getting Started Install, configure MCP, run first autonomous loop
    Architecture Package map, agent hierarchy, data flows
    Memory & Knowledge Memory Palace tiers, AgentDB, Monograph graph tools
    Hooks & Workers 29+ hook events, 12 workers, settings.json wiring
    Swarm Coordination 6 topologies, 5 consensus algorithms, agent hierarchy
    CLI Commands All 53+ commands with flags and examples
    Slash Commands All 160+ slash commands across 22 categories
    Mastermind autodev loop, --tillend mechanics, Brain protocol

    Contributing

    git clone https://github.com/nokhodian/monomind.git
    cd monomind
    pnpm install
    monomind doctor --fix

    See CONTRIBUTING.md for guidelines.


    License

    MIT β€” See LICENSE for details.


    Stop prompting. Start orchestrating.

    πŸ“– Docs  •  npm  •  GitHub  •  Issues


    Acknowledgements

    Monomind builds on ideas, patterns, and research from the following projects:

    Repository Used for
    ruvnet/ruflo Original skeleton that provided the foundational hooks system, swarm coordination, and SPARC agent methodology.
    msitarzewski/agency-agents Informs the multi-agent instruction file layout and specialist agent catalog design.
    microsoft/autogen Provides the human-in-the-loop interrupt gate pattern and auto-retry tool logic in @monomind/hooks.
    crewAIInc/crewAI Provides the multi-tier memory architecture (ShortTermMemory, EntityMemory, ContextualMemory, LongTermMemory) in @monomind/memory.
    langchain-ai/langgraph Provides the SwarmCheckpointer graph-checkpoint-and-resume pattern and fan-out/fan-in workflow DSL.
    All-Hands-AI/OpenHands Provides the per-agent SandboxConfig sandboxing model and EventStream session replay architecture.
    agno-agi/agno Provides the AgentMemory knowledge-base architecture and team-level agent coordination class.
    huggingface/smolagents Provides the explicit planning-before-execution step in LATSPlanner and the PlanStore persistence layer.
    pydantic/pydantic-ai Provides typed agent I/O schema patterns and auto-retry-on-validation-failure used throughout agent contracts.
    BerriAI/atomic-agents Provides BaseIOSchema typed agent contracts and SystemPromptContextProvider composition patterns.
    stanfordnlp/dspy Provides the BootstrapFewShot/MIPRO prompt optimization pipeline and Bayesian exploration in PromptOptimizer.optimize().
    aurelio-labs/semantic-router Provides the utterance-based RouteLayer that replaced static routing codes in the agent dispatcher.
    langfuse/langfuse Provides the trace/span/generation observability hierarchy and prompt version management in @monomind/hooks.
    karpathy/autoresearch Provides the BASELINE/KEEP/DISCARD experiment loop protocol and time-budget pattern used in @monomind/graph.
    safishamsi/graphify Provides the AST-based knowledge graph construction, Louvain community detection, and GRAPH_REPORT.md format that form @monomind/graph.
    google/gvisor Provides the runsc OCI runtime that reduces container syscall surface to ~50 interceptions, wired into SandboxConfig.use_gvisor.
    Indirect Injection research validateExternalContent() in @monomind/security applies the injection pattern detection to all externally-sourced tool content.
    FOREVER Forgetting Curve LearningBridge.decayConfidences() implements the importance-weighted exponential forgetting curve (importanceScore Γ— e^(βˆ’Ξ»t)).
    Awesome RLVR hooksModelOutcome verifier_type field (tsc/vitest/eslint/llm_judge) provides grounded binary reward signals.
    ERL β€” Experiential Reflective Learning Structured {condition, action, confidence} heuristics extracted at hooks_post-task and injected as ranked hints into hooks_pre-task.
    A-MEM β€” Agentic Memory Auto-links top-3 HNSW neighbors via bridgeRecordCausalEdge after every bridgeStoreEntry call in @monomind/memory.
    Collaborative Memory Promotion checkAndPromoteEntry() in SQLiteBackend auto-promotes entries from private to team scope after 3+ distinct agent reads within 24 h.
    Zep / Graphiti β€” Bi-Temporal Knowledge Graph MemoryEntry.eventAt separates event time T from ingestion time T' for bi-temporal filtering without index rebuilds.
    HippoRAG 2 β€” PPR Graph Retrieval MemoryGraph.pprRerank() expands HNSW candidates one hop via MemoryEntry.references edges.
    RAPTOR β€” Recursive Abstractive Tree Indexing RaptorWorker clusters episodic entries, summarizes each cluster, and stores results as contextual-tier entries.
    Multi-Agent Reflexion (MAR) hooks_post-task returns marReflection on task failure via a Diagnoser/Critic/Aggregator reflection loop.
    TextGrad Stores textual_gradient critiques to the gradients memory namespace for injection into the next prompt on failure.
    CP-WBFT weightedTally() scales each agent's vote by confidence in @monomind/hooks hive-mind consensus (AAAI 2026).
    GraphRAG MemoryGraph.getCommunitySummaries() prepends community-level descriptors to semantic search results.
    MemPalace Foundation of the memory palace system with BM25 verbatim retrieval, Wing/Room/Hall hierarchy, and temporal knowledge graph.
    vercel-labs/agent-browser Native Rust CDP client architecture that powers npx monomind browse.
    AgentSeal/codeburn Token cost attribution model tracking spend by task, tool, model, and project used in features/codeburn.md.
    fallow-rs/fallow Dead code detection patterns used in monograph-tools.ts via deadCodePct() and unusedDepsPct().
    pbakaus/impeccable 27-pattern HTML/CSS anti-pattern detection CLI integrated via npx impeccable detect in the monodesign skill.
    hardikpandya/stop-slop Directly integrated as the stop-slop skill for detecting and removing AI writing tells from prose.
    obra/superpowers Forms the complete superpowers skill layer providing brainstorming, TDD, systematic debugging, and finishing workflows.
    Lum1104/Understand-Anything Informs monomind:understand semantic enrichment and @monomind/graph knowledge graph traversal architecture.
    nextlevelbuilder/ui-ux-pro-max-skill Provides the design system methodology and component-first craft approach that forms the monodesign skill.
    paperclipai/paperclip Autonomous business workflow patterns that informed mastermind:ops, mastermind:finance, and mastermind:sales.

    Research Acknowledgements

    Monomind implements techniques from peer-reviewed research across distributed systems, machine learning, and software engineering:

    Technique Paper Applied In
    HNSW approximate nearest neighbor Malkov & Yashunin, 2018 β€” Efficient and Robust ANN HNSWIndex and HnswLite in @monomind/memory vector search
    Byzantine fault tolerance Castro & Liskov, 1999 β€” Practical Byzantine Fault Tolerance weightedTally() in CP-WBFT hive-mind consensus
    Raft consensus Ongaro & Ousterhout, 2014 β€” In Search of an Understandable Consensus Algorithm RaftManager swarm coordinator state machine
    CRDT data structures Shapiro et al., 2011 β€” Conflict-Free Replicated Data Types CrdtSynchronizer for eventually consistent agent memory
    Gossip protocols Demers et al., 1987 β€” Epidemic Algorithms for Replicated Database Maintenance GossipCoordinator cross-agent state propagation
    Hyperbolic embeddings Nickel & Kiela, 2017 β€” PoincarΓ© Embeddings for Learning Hierarchical Representations Code graph hierarchical vector space in @monomind/memory
    Int8 quantization Dettmers et al., 2022 β€” LLM.int8(): 8-bit Matrix Multiplication for Transformers Weight compression for neural pattern memory footprint reduction
    GOAP planning Orkin, 2004 β€” Applying Goal-Oriented Action Planning to Games code-goal-planner and sublinear-goal-planner agents
    Self-play RL Silver et al., 2017 β€” Mastering Chess and Shogi by Self-Play Pattern reinforcement loop in ReasoningBank
    Hierarchical memory Tulving, 1972 β€” Episodic and Semantic Memory AgentDB episodic/semantic namespace split in @monomind/memory
    PageRank influence Page et al., 1998 β€” The PageRank Citation Ranking pagerank-analyzer agent and MemoryGraph graph centrality scoring
    Hindsight Experience Replay Andrychowicz et al., 2017 β€” HER: Hindsight Experience Replay HER policy learner in the RL router
    SPARC methodology Agile/TDD literature sparc-coord, sparc-coder, specification, pseudocode, and refinement agents
    Sublinear algorithms Various β€” approximation theory sublinear-goal-planner, matrix-optimizer, and trading-predictor agents