rath.flow#
Workflow composition layer. Workflow organizes Session -> Session transforms, AgentParam stores the agent-side session and provider, and preset workflows wrap common paths.
Source#
Module |
Source |
|---|---|
|
|
|
|
|
|
|
|
Public contract#
Workflow#
Method |
Returns |
Behavior |
|---|---|---|
|
|
Execution logic implemented by subclasses. |
|
|
Calls |
|
|
Returns agent params registered as attributes. |
When an AgentParam is assigned to a workflow as an attribute, Workflow.__setattr__ adds it to _agents.
AgentParam#
Field |
Type |
Description |
|---|---|---|
|
|
Agent/system transcript. |
|
|
Model and request parameters. |
Preset workflows#
Class |
Constructor arguments |
Behavior |
|---|---|---|
|
|
Creates an agent session and stores provider/runtime options. |
|
|
|
Agent.register_tool(tool) adds tools and deduplicates by name. Agent.unregister_tool(tool_name) removes the tool with the same name.
Agent memory helpers#
Method |
Behavior |
|---|---|
|
Writes an explicit memory entry through the attached store. |
|
Retrieves relevant memory entries. |
|
Asks the agent to extract durable memory from a session. |
|
Runs a best-effort commit after each forward call. |
Runnable workflow examples#
Example |
Path |
Description |
|---|---|---|
Hello agent |
|
Minimal provider and |
Session lineage |
|
Key-free fork/detach/merge graph mechanics. |
Memory |
|
Key-free local memory plus optional model-assisted commit. |
Provider variation |
|
Provider config, Anthropic, embeddings, and VLM setup. |
These examples use the public Workflow, AgentParam, Provider, and run_session_loop(...) APIs, so they are useful source references for multi-agent composition.
Autodoc#
- class rath.flow.Workflow[source]#
Collects attached
AgentParaminstances and subclasses run sessions here.
- class rath.flow.AgentParam(agent_session: Session, provider: Provider, memory: MemoryStore | None = None)[source]#
System session plus LLM options for
run_session_loop.
- class rath.flow.Agent(system_prompt: str, provider: Provider | None = None, tools: list[FlowToolCall] | None = None, *, model: str | None = None, on_event: Callable[[RathLLMStreamDelta], None] | None = None, memory: MemoryStore | MemoryStoreSpec | str | None = None, memory_inject: MemoryInjectionPolicy | None = None, commit_on_forward: bool = False)[source]#
-
- remember_memory(content: str, *, scope: str = 'user', category: str = 'preferences', wait: bool = False) object[source]#
Persist a free-form note under
memory://{scope}/memories/{category}/....scopeis intentionally permissive (user/agent/session) so user code can decide which namespace to target; the URI prefix is adapter-coupled and other backends may rewrite it. SeeOpenVikingBackend.
- recall_memory(query: str, *, top_k: int = 4, target_uri: str | None = None) object[source]#
Issue a
MemoryOpFindagainst the bound store and return the result.