AIOps Peach

Agents · Module 03

Multi-Expert Research Agent with ReAct Pattern

Two patterns behind most research agents: several expert tools behind one model, and the ReAct loop of reasoning and acting, then both combined.

Học tương tác →

Học xong bạn làm được

Bài học

  1. Research agent patterns

    A basic research agent (user, LLM, web search, answer) has one tool of limited expertise, no reasoning about quality, no planning and no reflection. Three improvements fix that - multi-expert tools, the ReAct think-act-observe loop, and advanced techniques such as reflection, planning and iteration control - for higher accuracy, complex queries and quality control.

  2. Pattern 1: multi-expert tool use

    Instead of a search tool, the agent gets specialised LLM experts, each a tool that invokes a model with its own system prompt. A coordinator bound to the expert tools decides which to call, and a prebuilt ToolNode runs them in a LangGraph loop. Experts give consistent, domain-specific analysis, but cost more, take longer and do not know post-training events.

  3. Pattern 2: ReAct (Reason + Act)

    In ReAct the coordinator thinks about what it needs, acts by calling an expert tool, observes the ToolMessage that comes back, and repeats until it has enough or reaches the iteration limit. A coordinator prompt describes the process and the tools, a routing function sends tool calls to ToolNode, and the coordinator node adds the system prompt on the first iteration and counts iterations.

  4. Combining multi-expert and ReAct

    The coordinator can consult experts one after another or in parallel in one reply, then synthesise their answers by concatenation or with a structured synthesis prompt. Advanced techniques add LLM-based expert selection and error handling for failed or invalid tool calls. Prompts should give experts clear roles, show the coordinator few-shot examples, and specify the output format.

  5. Use cases, trade-offs and when to use

    Multi-expert tools suit technical plus business, medical and legal plus financial questions; ReAct suits research, complex decisions and data analysis. The patterns bring higher quality, handle complexity and make reasoning visible, but cost more LLM calls (3-5x a single call), more latency and more tokens. Use them when expertise, several perspectives and quality matter more than speed and cost.

  6. Practice: multi-expert ReAct agent with messages

    The practice agent researches a question by consulting expert LLMs over several iterations - HumanMessage, coordinator AIMessage with tool_calls, expert ToolMessages, review, then loop or answer. Its parts are the state, LLM-based expert tools, a coordinator bound to them and a prebuilt ToolNode. Next steps add experts, split planning and synthesis out of the coordinator, and prepare for production.

  7. Agentic RAG patterns (2025-2026)

    Agentic RAG lets an agent decide when, how and whether to retrieve. Corrective RAG grades retrieved documents and falls back to web search when they are not relevant. Self-RAG uses reflection tokens to decide on retrieval and critique its own answer. Adaptive RAG classifies each query and sends it down a simple, agentic or conversational path. They trade latency and cost for quality.

  8. Assignment: Multi-Expert ReAct Research Agent

    Multi-Expert ReAct Research Agent