-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reformat agentQnA sample guide #219
Open
abdulari
wants to merge
1
commit into
opea-project:main
Choose a base branch
from
abdulari:abdulari/agentQnA_docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minmin-intel, please check the purpose content below.