Opentrace offers two agent architectures for processing your questions. Both are built with LangGraph and include input guardrails for safety.
The default agent type. It follows a straightforward flow:
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 + citationsThe Simple RAG Agent:
rag_searchThe 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.
A more advanced multi-agent system that coordinates between two specialised sub-agents:
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 answerKey features of the Supervisor Agent:
Both agent types include an input guardrail node that runs before the agent processes your query. The guardrail checks are evaluated in order:
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.
If your query is rejected due to the token limit, shorten your message to fewer than 2,000 tokens and try again.
| Use Case | Recommended |
|---|---|
| Questions only about your documents | Simple RAG Agent |
| Need current/external information too | Agentic RAG (Supervisor) |
| Speed is top priority | Simple RAG Agent |
| Complex, multi-source research questions | Agentic RAG (Supervisor) |
You can switch between agent types in the RAG Settings for any project at any time.