ReAct
Introduction
The ReAct reasoning engine is designed to assist users with a variety of queries by utilizing different agents and tools. This documentation provides guidance on configuring the ReAct reasoning engine and integrating it with agents/tools, including a RAG (Retrieval-Augmented Generation) engine. By default we configure RAG as the default angent.
ReAct agentic workflow, Reasoning Engine, Agents and Forms
RAG agent
In the ai12z system, RAG is the default agent that ReAct calls whenever a user’s question cannot be answered by another agent. Even if the ReAct LLM believes the question is irrelevant, it should still forward the query to RAG rather than attempting to answer it itself.
By default, RAG streams its response directly to the client, without returning it to the ReAct LLM. However, there are instances where the ReAct LLM may need RAG to return the data to ReAct instead of streaming it to the client. For example, if ReAct needs to compare multiple items by making several parallel calls to RAG, or if it needs to gather data from both RAG and another agent before analyzing and sending a final response to the client, then ReAct instructs RAG to return the results for further processing rather than streaming them.
ReAct plan, action
In the ReAct framework, the LLM (serving as a reasoning engine) is guided by a System Prompt, and context which includes:
- A list of Agents and Forms that are available.
- The complete history of the conversation.
- Overall goals and constraints.
When the user asks a question, the LLM uses this context to decide on a plan of action. This plan might involve:
- Calling one or more agents/forms in a specific order.
- Asking the user follow-up or clarifying questions.
The LLM knows which agents/forms are enabled and determines how best to use them to achieve the user’s goal. It may perform multiple planning steps—revising or expanding its plan as needed—until the objective is met.
Suggested Content for System Prompt
-
Tone:
- Friendly and helpful
- Professional and concise
- Clear and informative
-
Key Components:
- Greeting and introduction
- General guidelines for responses
- Specific handling instructions for common tasks
- Examples for clarity
- Encouragement for user interaction
Reasoning Engine with Actions using Agents / Tools and Forms including RAG as an Agent.
This documentation ensures a comprehensive understanding of setting up and configuring the ReAct reasoning engine with Actions and agents, including a RAG engine. It also outlines the necessary components for any successful web project.