diff --git a/docs/understanding-perstack/concept.mdx b/docs/understanding-perstack/concept.mdx index 47cc8895..9d6f02ac 100644 --- a/docs/understanding-perstack/concept.mdx +++ b/docs/understanding-perstack/concept.mdx @@ -11,40 +11,79 @@ Perstack is built on a concept called **Expert Stack** — the harness that enab > [!NOTE] > The name "Perstack" combines the Latin word "perītus" (meaning "expert") with "stack". Perstack = Expert Stack. -## Expert Stack +## Expert Stack -Perstack organizes the complexity of micro-agents harness design into a simple stack model: +An agent harness needs a broad set of capabilities — almost like an operating system. Perstack organizes them into a simple stack with clear separation of concerns: -### Definition +``` +┌──────────────────────────────────────────────────────────────────-┐ +│ Interface │ +│ CLI · Event streaming · Programmatic API │ +├──────────────────────────────────────────────────────────────────-┤ +│ Runtime │ +│ Agentic loop · Event-sourcing · Checkpointing · Tool use │ +├──────────────────────────────────────────────────────────────────-┤ +│ Context │ +│ System prompts · Prompt caching · AgenticRAG · Extended thinking │ +├──────────────────────────────────────────────────────────────────-┤ +│ Definition │ +│ Multi-agent topology · MCP skills · Provider abstraction │ +├──────────────────────────────────────────────────────────────────-┤ +│ Infrastructure │ +│ Sandbox isolation · Workspace boundary · Secret management │ +└──────────────────────────────────────────────────────────────────-┘ +``` + +Most of the features above are not new ideas. Perstack takes the usual harness building blocks — tool use, delegation, checkpointing, prompt caching, etc. — makes them easy to operate, puts them on top of standards you already know (MCP, TOML, Docker, SSE), and ships them as one runtime. Where cost or operational burden demands it, Perstack introduces its own take — micro-agents being the first example. + +### Interface + +The top layer exposes Perstack to users and applications. - Purpose-specific micro-agents. - MCP tools (file ops, exec, custom MCP servers). - LLM providers and models. - Declarative definition of experts, skills, and providers. + Interactive TUI (`start`), headless JSON output (`run`), log inspection, and expert management. + Embed the runtime directly in TypeScript apps for serverless and custom integrations. + Real-time activity log, token metrics, and delegation tree. + + +### Runtime + +The execution engine that drives the agentic loop. + + + 9-state machine — generate, call tools, delegate, resolve, and finish. + Step-level event-sourcing for full execution observability and replay. + Checkpoints, resume, and job hierarchy. + Dynamic skill lifecycle — connect, discover tools, execute, disconnect. ### Context +What each expert sees and knows during execution. + - The context in which experts operate. - The shared workspace in which experts operate. - The delegation of tasks to other experts. - The memory of the expert stack. + The shared filesystem where experts collaborate — not conversation history. + Retries, provider-specific error normalization, and retryability detection. -### Runtime +### Definition + +How you declare what experts do and how they collaborate. - The event-sourcing of the expert stack. - The checkpoints of the expert stack. - The skill management of the expert stack. + Purpose-specific micro-agents with a single responsibility. + Declarative config — experts, skills, providers, and global defaults. + MCP tools — file ops, exec, custom MCP servers. + LLM providers, models, and model tier selection. ### Infrastructure +Isolation and security boundaries that make agents safe to operate. + - The container isolation of the expert stack. - The workspace boundaries of the expert stack. - The env vars/secrets of the expert stack. + Container isolation with Docker — multi-arch, non-root, ~74 MB. + Workspace boundaries, path validation, and symlink traversal prevention. + Environment sandboxing, secret management, and exec protection. + Container images, `perstack install`, and production deployment patterns.