-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.. _AgentQnA_Guide: | ||
|
||
AgentQnA Sample Guide | ||
##################### | ||
|
||
.. note:: This guide is in its early development and is a work-in-progress with | ||
placeholder content. | ||
|
||
Overview | ||
******** | ||
|
||
This example showcases a hierarchical multi-agent system for question-answering applications. | ||
|
||
Purpose | ||
******* | ||
* Improve relevancy of retrieved context. Agent can rephrase user queries, decompose user queries, and iterate to get the most relevant context for answering user’s questions. Compared to conventional RAG, RAG agent can significantly improve the correctness and relevancy of the answer. | ||
* Use tools to get additional knowledge. For example, knowledge graphs and SQL databases can be exposed as APIs for Agents to gather knowledge that may be missing in the retrieval vector database. | ||
* Hierarchical agent can further improve performance. Expert worker agents, such as retrieval agent, knowledge graph agent, SQL agent, etc., can provide high-quality output for different aspects of a complex query, and the supervisor agent can aggregate the information together to provide a comprehensive answer. | ||
|
||
How It Works | ||
************ | ||
|
||
The supervisor agent interfaces with the user and dispatch tasks to the worker agent and other tools to gather information and come up with answers. | ||
The worker agent uses the retrieval tool to generate answers to the queries posted by the supervisor agent. | ||
|
||
|
||
.. mermaid:: | ||
|
||
graph LR; | ||
U[User]-->SA[Supervisor Agent]; | ||
SA-->WA[Worker Agent]; | ||
WA-->RT[Retrieval Tool]; | ||
SA-->T1[Tool 1]; | ||
SA-->T2[Tool 2]; | ||
SA-->TN[Tool N]; | ||
SA-->U; | ||
WA-->SA; | ||
RT-->WA; | ||
T1-->SA; | ||
T2-->SA; | ||
TN-->SA; | ||
|
||
|
||
Deployment | ||
********** | ||
|
||
See the :ref:`agentqna-example-deployment`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. _agentqna-example-deployment: | ||
|
||
AgentQnA Example Deployment Options | ||
################################### | ||
|
||
Here are some deployment options, depending on your hardware and environment: | ||
|
||
Single Node | ||
*********** | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
Xeon Scalable Processor <xeon> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Single node on-prem deployment with Docker Compose on Xeon Scalable processors | ||
|
||
1. [Optional] Build `Agent` docker image | ||
|
||
``` | ||
git clone https://github.com/opea-project/GenAIComps.git | ||
cd GenAIComps | ||
docker build -t opea/agent-langchain:latest -f comps/agent/langchain/Dockerfile . | ||
``` | ||
|
||
2. Launch Tool service | ||
|
||
In this example, we will use some of the mock APIs provided in the Meta CRAG KDD Challenge to demonstrate the benefits of gaining additional context from mock knowledge graphs. | ||
|
||
``` | ||
docker run -d -p=8080:8000 docker.io/aicrowd/kdd-cup-24-crag-mock-api:v0 | ||
``` | ||
|
||
3. clone repo | ||
``` | ||
export WORKDIR=$(pwd) | ||
git clone https://github.com/opea-project/GenAIExamples.git | ||
export TOOLSET_PATH=$WORKDIR/GenAIExamples/AgentQnA/tools/ | ||
# optional: OPANAI_API_KEY | ||
export OPENAI_API_KEY=<your-openai-key> | ||
``` | ||
|
||
4. launch `Agent` service | ||
|
||
The configurations of the supervisor agent and the worker agent are defined in the docker-compose yaml file. We currently use openAI GPT-4o-mini as LLM, and we plan to add support for llama3.1-70B-instruct (served by TGI-Gaudi) in a subsequent release. To use openai llm, run command below. | ||
|
||
``` | ||
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon | ||
bash launch_agent_service_openai.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters