From 7549dff48d45b96ab44708e2a1438f0ef17bcff0 Mon Sep 17 00:00:00 2001 From: Andrei Fajardo Date: Tue, 6 Aug 2024 16:53:13 -0400 Subject: [PATCH] add README --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++ template.env.docker | 24 ++++++++++++++++++++ template.env.local | 24 ++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 template.env.docker create mode 100644 template.env.local diff --git a/README.md b/README.md index e69de29..34c1f37 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,54 @@ +# LlamaAgents Demo With Snowflake/Cybersyn Data Agents + +For this demo app, we have a multi-agent system comprised with the following +components: + +- A data **Agent** that performs queries over [Cybersyn's Financial & Economic Essentials](https://app.snowflake.com/marketplace/listing/GZTSZAS2KF7/cybersyn-financial-economic-essentials?originTab=provider&providerName=Cybersyn&profileGlobalName=GZTSZAS2KCS) Dataset +- A data **Agent** that performs queries over [Cyberysyn' Government Essentials](https://app.snowflake.com/marketplace/listing/GZTSZAS2KGK/cybersyn-government-essentials?originTab=provider&providerName=Cybersyn&profileGlobalName=GZTSZAS2KCS) Dataset +- A general **Agent** that can answer all general queries +- A **Human (In the Loop) Service** that provides inputs to the two data agents +- A **ControlPlane** that features a router which routes tasks to the most appropriate orchestrator +- A **RabbitMQ MessageQueue** to broker communication between agents, human-in-the-loop, and control-plane + +For the frontend, we built a Streamlit App to interact with this multi-agent +system. + +## Pre-Requisites + +### Docker + +To run this demo, we make use of `Docker`, specifically `docker-compose`. For this +demo, all of the necessary services (with the exception of the message queue) +are packaged in one common Docker image and can be instantianted through their +respective commands (i.e., see `docker-compose.yml`.) + +### Credentials + +For this app, we use OpenAI as the LLM provider and so an `OPENAI_API_KEY` will +need to be supplied. Moreover, the Cybersyn data is pulled from Snowflake and so +various Snowflake params are also required. See the section "# FILL-IN" in the +`template.env.docker` file. Once, you've filled in the necessary environment +variables, rename the file to `.env.docker`. + +Similarly, you need to provide credentials in the `template.env.local`. Once +filled in, rename the file to `.env.local`. + +## Running The App + +### The backend (multi-agent system) + +To start the multi-agent system, use the following command while in the root of +the project directory: + +```sh +docker-compose up --build +``` + +### Streamlit App + +Once the services are all running, you can then run the streamlit app. + +```sh +set -a && source .env.local +streamlit run snowflake_cybersyn_demo/apps/streamlit.py +``` diff --git a/template.env.docker b/template.env.docker new file mode 100644 index 0000000..fc7ec61 --- /dev/null +++ b/template.env.docker @@ -0,0 +1,24 @@ +# DON'T MODIFY +RABBITMQ_HOST="rabbitmq" +RABBITMQ_NODE_PORT=5672 +RABBITMQ_DEFAULT_USER="guest" +RABBITMQ_DEFAULT_PASS="guest" +CONTROL_PLANE_HOST="control_plane" +CONTROL_PLANE_PORT=8001 +FUNNY_AGENT_HOST="funny_agent" +FUNNY_AGENT_PORT=8002 +GOODS_GETTER_AGENT_HOST="goods_getter_agent" +GOODS_GETTER_AGENT_PORT=8003 +TIME_SERIES_GETTER_AGENT_HOST="time_series_getter_agent" +TIME_SERIES_GETTER_AGENT_PORT=8004 +STATS_GETTER_AGENT_HOST="stats_getter_agent" +STATS_GETTER_AGENT_PORT=8005 +STATS_FULFILLER_AGENT_HOST="stats_fulfiller_agent" +STATS_FULFILLER_AGENT_PORT=8006 +LOCALHOST="0.0.0.0" +# FILL IN +SNOWFLAKE_USERNAME= +SNOWFLAKE_PASSWORD= +SNOWFLAKE_ACCOUNT= +SNOWFLAKE_ROLE= +OPENAI_API_KEY= diff --git a/template.env.local b/template.env.local new file mode 100644 index 0000000..29dd3a9 --- /dev/null +++ b/template.env.local @@ -0,0 +1,24 @@ +# DON'T MODIFY +RABBITMQ_HOST="localhost" +RABBITMQ_NODE_PORT=5672 +RABBITMQ_DEFAULT_USER="guest" +RABBITMQ_DEFAULT_PASS="guest" +CONTROL_PLANE_HOST="0.0.0.0" +CONTROL_PLANE_PORT=8001 +FUNNY_AGENT_HOST="0.0.0.0" +FUNNY_AGENT_PORT=8002 +GOODS_GETTER_AGENT_HOST="0.0.0.0" +GOODS_GETTER_AGENT_PORT=8003 +TIME_SERIES_GETTER_AGENT_HOST="0.0.0.0" +TIME_SERIES_GETTER_AGENT_PORT=8004 +STATS_GETTER_AGENT_HOST="0.0.0.0" +STATS_GETTER_AGENT_PORT=8005 +STATS_FULFILLER_AGENT_HOST="0.0.0.0" +STATS_FULFILLER_AGENT_PORT=8006 +LOCALHOST="0.0.0.0" +# FILL IN +SNOWFLAKE_USERNAME= +SNOWFLAKE_PASSWORD= +SNOWFLAKE_ACCOUNT= +SNOWFLAKE_ROLE= +OPENAI_API_KEY=