Skip to main content
Version: 0.0.7

agrag.agents.build.build_agent

build_agent(*, graph_store:GraphStore, embedder:Embedder, scope:frozenset[str], project_id:str, agent_id:str, llm_settings:AgentLLMSettings, agent_settings:AgentSettings | None = None, vector_store:VectorStore | None = None, tracer:Tracer | None = None) -> Any

Build one agent bound to trusted document, history, and decision scopes.

Parameters:

  • graph_store (GraphStore) – Store used by evidence, history, and decision operations.
  • embedder (Embedder) – Embedder used for semantic evidence search.
  • scope (frozenset[str]) – Document keys the agent may read.
  • project_id (str) – Trusted project identifier for task and decision records.
  • agent_id (str) – Trusted author identifier for history and decision writes.
  • llm_settings (AgentLLMSettings) – Model configuration and composition strategy.
  • agent_settings (AgentSettings | None) – Run limits. Defaults to environment settings.
  • vector_store (VectorStore | None) – Optional external store for evidence search.
  • tracer (Tracer | None) – Optional OpenTelemetry tracer for agent and model calls.

Returns:

  • Any – An agent with ainvoke({"task_name": ..., "question": ...}).

Raises:

  • AgentMissingExtraError – The agents extra is not installed, or tracing was requested without the observability extra.