Newer
Older
navi-1 / navi / profiles / base.py
from dataclasses import dataclass, field


@dataclass
class AgentProfile:
    """
    Defines a complete agent configuration.
    A profile ties together a system prompt, an LLM backend, a model,
    and the set of tools the agent is allowed to use.
    """

    id: str
    name: str
    description: str
    system_prompt: str
    enabled_tools: list[str]  # tool names; resolved by ToolRegistry at runtime
    llm_backend: str = "ollama"  # backend key, e.g. "ollama", "openai"
    model: str = "gemma4:26b-a4b-it-q4_K_M"
    max_iterations: int = 10
    temperature: float = 0.7
    planning_enabled: bool = False  # if True, run a planning LLM call before the main loop

    # Profile discoverability — used for system prompt injection and list_profiles tool.
    # short_description: 1-line summary shown in every system prompt to all profiles.
    # full_description: structured dict with keys: specialization, when_to_use, key_tools.
    short_description: str = ""
    full_description: dict = field(default_factory=dict)

    # Sub-agent configuration
    # subagent_tools: tool names available to sub-agents spawned from this profile.
    #   If empty, falls back to enabled_tools minus dangerous/irrelevant ones.
    # subagent_planning_enabled: if True, sub-agents run the planning phase before their tool loop.
    # subagent_system_prompt: injected as an additional system message for sub-agents,
    #   after the profile's main system_prompt. Loaded from subagent_system_prompt.txt if present.
    subagent_tools: list[str] = field(default_factory=list)
    subagent_planning_enabled: bool = False
    subagent_system_prompt: str = ""