Manifest Pipeline
How build_agent(manifest, deps) turns a parsed manifest into a runnable Agent. Source: packages/harness/src/felix/manifests/builder.py in felix-run/felix.
Inputs
Manifests use apiVersion: felix/v1, kind: Agent (Pydantic v2, extra=forbid). Request handlers resolve the document first (tenant Postgres active version → bundled YAML under manifests/), then pass the Manifest object into the builder.
BuildDeps carries the ToolProvider, optional auth, session store/strategy, object store, settings, and sub-agent builder (tests stub children here).
Build steps
-
Validate — re-check schema + cross-field rules (single vs multi-agent, pattern registry kind, durable + checkpointer constraints).
-
System prompt — join soul (if enabled) +
system_prompt.base+inline, then append activated skills. -
Skills — load
SKILL.mdmetadata; fold declared tools/MCP/peers; apply per-tenant activation overlay (restriction-only). -
External tools — bind MCP servers (
server__tool), A2A peers (peer__name), sandboxes, containers, queues (Valkey/Redis lists), browser tools (Playwright extra). Bind failures are logged; the rest of the agent still builds. -
Sub-agents / local tools — multi-agent patterns build children; single-agent resolves
spec.toolsfrom the provider. Auto-inject memory / procedural /fetch_artifactwhen enabled.pattern: deepinjects plan tools before governance so they are gated like everything else. -
Governance pipeline (innermost → outermost on the call path):
secret masking → policies → command screening → content screening→ limits → guardrails → LLM judges → approvals → (artifact spill)See governance.
-
Pattern dispatch —
get_pattern(spec.pattern)from the open registry (react,deep,router,parallel,groupchat,reflect,plan_execute, plus any registered plugins). -
Durable wrap — when
spec.execution.mode: durable, wrap so invoke enqueues a fiber (or Temporal run) and returns a resume token.
Session + memory at build time
| Concern | Resolution |
|---|---|
| Checkpointer | memory.checkpointer → resolved through the checkpointer registry: postgres (default), none, or a plugin-registered store |
| Strategy | session.strategy → full_replay / windowed:N / summarizing:N / semantic:N / compacting |
| Long-term memory | memory.store ∈ {pgvector, memory} injects remember/recall tools |
| Artifacts | Large tool outputs spill to the object store; fetch_artifact is injected |
Caching
Routers may cache a built Agent per resolved manifest version/cache key so repeated hits skip rebuild. Tenant activate/rollback changes the active pointer and forces a fresh build. Prefer getting started for local iteration against bundled manifests.
Unknown spec.pattern fails the build with the registered pattern list — register custom patterns before the first agent build (composition / plugin load).