Skip to content

latent.agents.guided.agent

GuidedAgent — ReActAgent with Parlant-inspired context narrowing.

Classes

GuidedAgent

GuidedAgent(name: str, model: str, system_prompt: str | None = None, guidelines: list[Guideline] | None = None, canned_responses: list[CannedResponse] | None = None, glossary: Glossary | None = None, journeys: list[Journey] | None = None, mode: CompositionMode = 'fluid', match_strategy: MatchStrategy | None = None, match_threshold: float = 0.75, embedding_model: str | None = None, infer_relationships: bool = False, tools: list[Callable] | None = None, kwargs: Any = {})

ReActAgent with context narrowing via guidelines.

Each turn: 1. Match guideline conditions against the conversation 2. Resolve exclusions and sort by priority 3. Build system prompt injecting only matched guidelines 4. Gate tools — expose ungated tools + tools unlocked by active guidelines 5. Delegate to ReActAgent._stream_core()

Methods

GuidedAgent.from_config

from_config(name: str, model: str, tools: list[Callable] | None = None, system_prompt: str | None = None, kwargs: Any = {}) -> GuidedAgent

Load guidelines, glossary, and canned responses from flows//guidelines.yaml.

Attributes

MatchStrategy