How baarai/norma works
Norma is a Go agent-harness SDK. A host supplies a prompt, provider, tools, and safety policy; a session streams a user request through the harness, which calls the model, dispatches tools, and returns events/results. Supporting branches add context management, transcript persistence, planning, skills, memory, MCP, background work, and delegation. The tree and excerpts also show a separate NOA archive/context-management subsystem. Some subsystem wiring is documented in the README rather than sampled source; edges below cite that documentation where applicable.
Main entry points: agentcore.go Stateful session · query.go Streaming loop · provider.go LLM providers · session.go NOA session
Components 26
Session Entry
- Stateful session
agentcore/agentcore.go - CLI demo
cmd/agentcore/main.go
Agent Runtime
- Streaming loop
harness/query.go - LLM providers
llm/provider.go - Anthropic adapter
llm/anthropic.go - OpenAI adapters
llm/openai.go - Tool registry and tools
tool/registry.go - Permission policy
permission/permission.go - Lifecycle hooks
hook/hook.go
Agent Capabilities
- Skill registry
skill/skill.go - Long-term memory
memory/memory.go - MCP integration
mcp/mcp.go - Plan mode
plan/plan.go - Background tasks
tool/task.go
Context Management
- Context compaction
compaction/compaction.go - Summarization
compaction/summarizer.go - Transcript store
transcript/transcript.go - NOA session
noaadapter/session.go - NOA projection
noaadapter/project.go - NOA state store
noaadapter/state_store.go
Delegation
- Subagents
subagent/subagent.go - Coordinator
coordinator/coordinator.go
Other components
- Host application
- Model API
- MCP server
- User
Connections 26
- Host application → Stateful session: configures
README.md - CLI demo → Stateful session: creates
cmd/agentcore/main.go - User → Stateful session: prompts
README.md - Stateful session → Streaming loop: runs
agentcore/agentcore.go - Streaming loop → LLM providers: requests completion
harness/query.go - LLM providers → Anthropic adapter: selects format
README.md - LLM providers → OpenAI adapters: selects format
README.md - LLM providers → Model API: streams requests
- Streaming loop → Tool registry and tools: dispatches calls
README.md - Streaming loop → Permission policy: evaluates calls
README.md - Streaming loop → Lifecycle hooks: runs callbacks
README.md - Streaming loop → Context compaction: manages context
README.md - Context compaction → Summarization: summarizes history
README.md - Streaming loop → Transcript store: records messages
harness/query.go - Stateful session → Skill registry: registers skills
agentcore/agentcore.go - Stateful session → Long-term memory: offers memory
README.md - Stateful session → MCP integration: supports integration
- MCP integration → MCP server: calls tools
mcp/mcp.go - Stateful session → Plan mode: enables planning
README.md - Tool registry and tools → Background tasks: provides task tools
README.md - Stateful session → Subagents: exposes delegation
README.md - Subagents → Streaming loop: runs child loop
subagent/subagent.go - Coordinator → Subagents: dispatches workers
coordinator/coordinator.go - Stateful session → NOA session: optional integration
- NOA session → NOA projection: projects context
noaadapter/project.go - NOA session → NOA state store: loads state
noaadapter/session.go