Dashboard
DocsCore ConceptsAgent Types

Agent Types

Opentrace offers two agent architectures for processing your questions. Both are built with LangGraph and include input guardrails for safety.

Simple RAG Agent

The default agent type. It follows a straightforward flow:

text
START → Input Guardrail → RAG Agent → END

RAG Agent:
  1. Receives your question
  2. Calls rag_search tool with your query
  3. Retrieves relevant document chunks
  4. Generates an answer grounded in the retrieved context
  5. Returns answer + citations

The Simple RAG Agent:

  • Always queries your documents first (never answers from pre-trained knowledge alone)
  • Has a single tool: rag_search
  • Includes chat history context for follow-up questions
  • Uses a 5-recursion depth limit
Note

The agent is instructed to always use the RAG tool before answering. This ensures every response is grounded in your documents, not in the LLM's training data.

Agentic RAG (Supervisor Agent)

A more advanced multi-agent system that coordinates between two specialised sub-agents:

text
START → Input Guardrail → Supervisor → END

Supervisor has two tools:
  1. rag_search  — delegates to RAG sub-agent (searches project documents)
  2. search_web  — delegates to Web Search sub-agent (searches the internet)

The Supervisor:
  • Analyses the query to decide which agent(s) to use
  • Routes to RAG for project-specific questions
  • Routes to Web Search for current events or external info
  • Can call both agents for complex queries
  • Synthesises results from multiple agents into a single answer

Key features of the Supervisor Agent:

  • Intelligent routing — determines whether to search documents, the web, or both
  • Web search — uses Tavily (advanced, paid) or DuckDuckGo (free fallback)
  • Date-aware — the system prompt includes the current date for temporal queries
  • Citation propagation — citations from the RAG sub-agent bubble up to the supervisor's response
  • Uses a 10-recursion depth limit (deeper than Simple to allow multi-agent coordination)

Input Guardrails

Both agent types include an input guardrail node that runs before the agent processes your query. The guardrail checks are evaluated in order:

  1. Token count limit — inputs exceeding 2,000 tokens are rejected immediately
  2. Toxic or harmful content — offensive language, threats
  3. Prompt injection — attempts to override system instructions
  4. Personal Identifiable Information (PII) — emails, phone numbers, SSNs

If any check fails, the request is rejected with an explanation before reaching the agent. Token count is evaluated first so that oversized inputs are short-circuited without a full safety analysis. All checks are performed by GPT-4o-mini using structured output (InputGuardrailCheck) for fast, reliable classification.

Note

If your query is rejected due to the token limit, shorten your message to fewer than 2,000 tokens and try again.

Choosing an Agent Type

Use CaseRecommended
Questions only about your documentsSimple RAG Agent
Need current/external information tooAgentic RAG (Supervisor)
Speed is top prioritySimple RAG Agent
Complex, multi-source research questionsAgentic RAG (Supervisor)

You can switch between agent types in the RAG Settings for any project at any time.

Was this page helpful?