symfonic.core.graph¶
graph ¶
AgentGraph — graph definition factory.
Per ADR-PFX-002/008 and TDD SS2.8: Accepts graph topology and compiles it into a CompiledGraph. Config is owned by AgentRuntime, passed at compile time.
AgentGraph ¶
Graph definition factory. Accepts topology and compiles into CompiledGraph.
Not responsible for execution or configuration — that's AgentRuntime. Config is passed at compile time, not at construction time.
Source code in src/symfonic/core/graph.py
add_context_loader ¶
add_context_loader(
fn: Callable[..., Any],
required: bool = False,
timeout_seconds: float = 5.0,
allow_collision_keys: set[str] | None = None,
) -> AgentGraph
Register a context loader. Returns self for chaining.
Source code in src/symfonic/core/graph.py
add_tool ¶
Register a single tool with metadata. Returns self for chaining.
add_tools ¶
compile ¶
compile(
deps: BaseAgentDeps,
config: AgentConfig | None = None,
checkpointer: Any | None = None,
) -> Any
Validate capabilities, freeze registry, wire topology.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deps
|
BaseAgentDeps
|
Capability registry with registered providers. |
required |
config
|
AgentConfig | None
|
Agent configuration. Defaults to AgentConfig() if not provided. |
None
|
checkpointer
|
Any | None
|
Optional LangGraph checkpointer for persistence/resume. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
unknown preset name |
ConfigurationError
|
capability flags violated |
MissingCapabilityError
|
required capability absent from deps |
Source code in src/symfonic/core/graph.py
register_preset
classmethod
¶
set_active_skills_getter ¶
Register the async callable the v7.7.4
:class:PreconditionGateNode uses to query active procedural
skills.
Signature: async def getter(state: dict) -> list[skill_entry].
Typical implementation queries
ProceduralLayer.query_skills(scope, "", include_drafts=False).
The engine wires this automatically; callers building a graph
by hand (no SymfonicAgent) register their own getter when
opting into procedural_enforce_preconditions.
Returns self for chaining.
Source code in src/symfonic/core/graph.py
unregister_preset
classmethod
¶
Remove a custom preset. Raises KeyError if not found.
Source code in src/symfonic/core/graph.py
with_preset
classmethod
¶
ConfigurationError ¶
Bases: Exception
Raised when capability flags are violated at compile time.