How brijeshsingaravel/shadow-joyboy works
Shadow is a local-first conversational agent centered on persistent, semantic memory and permission-gated actions. The documented user path is chat input through a checkpointed agent graph, an LLM response, and available tools, with actions audited. Major supporting branches include layered memory and project-scoped history, model routing, configurable tools and MCP, security, evaluation signals, and memory consolidation. Relationships are limited to README claims and SOURCE INDEX references; unsampled implementations are represented only at supported directory paths, and the README notes consolidation is not scheduled here.
Main entry points: llm_responder.py LLM responder · registry.py Tool registry · memory Layered memory · orchestration.py Agent graph
Components 20
Conversation runtime
- Chat CLI
src/madras/cli.py - Agent graph
src/madras/graph/orchestration.py - LLM responder
src/madras/graph/llm_responder.py
Memory and history
- Layered memory
src/madras/memory - Semantic retrieval
src/madras/memory/vector.py - Project history
src/madras/mindpalace/ledger.py - Memory consolidation
src/madras/memory_manager
Tools and governance
- Tool registry
src/madras/tools/registry.py - Built-in tools
src/madras/tools/builtin - MCP integration
src/madras/mcp/client.py - Action permissions
src/madras/security/guardrails.py - Append-only audit
src/madras/audit
Model and evaluation
- LLM gateway
src/madras/llm/gateway.py - Model catalog
src/madras/llm/model_catalog.py - Action evaluation
src/madras/eval_/emitter.py
Agent support
- Agent configuration
src/madras/config.py - Agent factory
src/madras/factory/spawn.py - Capability catalog
packages/madras-capabilities/src/madras_capabilities/catalog.py - Persona anchor
src/madras/persona/anchor.py
Other components
- User
Connections 21
- User → Chat CLI: starts chat
README.md - Chat CLI → Agent graph: runs agent
- Agent graph → LLM responder: routes turn
- LLM responder → LLM gateway: requests completion
src/madras/graph/llm_responder.py - LLM responder → Action permissions: checks input
src/madras/graph/llm_responder.py - LLM responder → Project history: reads session
src/madras/graph/llm_responder.py - LLM responder → Persona anchor: builds prompt
src/madras/graph/llm_responder.py - LLM responder → Action evaluation: emits signals
src/madras/graph/llm_responder.py - Agent graph → Tool registry: dispatches tools
- Tool registry → Built-in tools: registers tools
README.md - Tool registry → Action permissions: gates actions
README.md - Tool registry → Append-only audit: records actions
README.md - Built-in tools → Layered memory: accesses memory
- Tool registry → MCP integration: invokes MCP
- Layered memory → Semantic retrieval: embeds for recall
src/madras/metacog/analogy_engine.py - Project history → Layered memory: keeps project context
- Memory consolidation → Layered memory: consolidates memories
- Agent factory → Agent configuration: loads configuration
src/madras/factory/spawn.py - Agent factory → Tool registry: resolves tools
src/madras/factory/spawn.py - Capability catalog → Agent factory: provides capabilities
- LLM gateway → Model catalog: selects models