From c474a4ab272bac5651b5b1ea8d9855b421ee1490 Mon Sep 17 00:00:00 2001 From: Jakob Heyder Date: Fri, 2 Feb 2024 10:33:09 +0100 Subject: [PATCH] chore: update docs --- README.md | 9 ++++--- docker-compose-demo.yml | 4 +-- docs/docusaurus/README.md | 2 +- docs/docusaurus/docs/introduction.md | 2 +- docs/docusaurus/docs/tutorial/tutorial.md | 32 +++++++++++------------ docs/docusaurus/sidebars.js | 5 ++++ 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 27afaec2..401763cd 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ Key advantages of the AgentKit toolkit include: - 🛡️ **Focus on reliability**: Easy to configure routing architecture gives control of possible paths Agent can take, increasing reliability and making it suited for real-life use cases - 📈 **Set up to scale**: Set up to scale to MVP with ready made Queue Management, Auth, Caching, Monitoring etc. - https://github.com/BCG-X-Official/agentkit/assets/125347044/32bf632e-a7e0-4cbd-a172-4ba014e64db0 @@ -31,7 +30,7 @@ The starter pack is based on the latest technologies for optimal performance, se * 🖍 Linting, tests and pre-commit hooks pre-configured ## Quickstart -For a quick setup of AgentKit, use the steps below, where both the backend app and frontend app are run inside a Docker container. More elaborate setup instructions can be found at [setup.md](docs/setup.md). +For a quick setup of AgentKit, use the steps below, where both the backend app and frontend app are run inside a Docker container. More elaborate setup instructions can be found at [setup.md](docs/docusaurus/docs/setup.md). ### Prerequisites - Docker: https://www.docker.com/get-started @@ -49,16 +48,20 @@ For a quick setup of AgentKit, use the steps below, where both the backend app a Wait for the containers to build and start, which may take a few minutes depending on your system. Once the containers are up and running, you can access the apps in your browser at [http://localhost](http://localhost/). ## Chinook music database demo -- Ensure you are on the `develop` branch +- If docker containers are running, run `docker-compose down --volumes` - Follow the installation instructions above and swap `docker-compose.yml` with `docker-compose-demo.yml` to run the app - Try the prompt "How many artists and songs are there in the database?" to see AgentKit in action! +Check out a more advanced [demo](https://agentkit.infra.x.bcg.com) build following the [tutorial](docs/docusaurus/docs/tutorial/tutorial.md). + ## Set up your own app - Configure your Agent and Tools [link](docs/docusaurus/docs/configuration/configure_agent_and_tools.md) - (Optional) Adjust the UI to your use case [link](docs/docusaurus/docs/configuration/configure_ui.md) - (Optional) Set up evaluation with LangSmith [link](docs/docusaurus/docs/advanced/evaluation.md) ## Documentation +Find the [hosted documentation here](https://agentkit.infra.x.bcg.com/docs/introduction). + - [Installation instructions for running frontend or entire app outside Docker](docs/docusaurus/docs/setup/setup_development.md) - [Key concepts](docs/docusaurus/docs/how_it_works/key_concepts.md) - [Agent and Tools configuration](docs/docusaurus/docs/configuration/configure_agent_and_tools.md) diff --git a/docker-compose-demo.yml b/docker-compose-demo.yml index e27bd949..fbd4e662 100644 --- a/docker-compose-demo.yml +++ b/docker-compose-demo.yml @@ -37,8 +37,8 @@ services: user: root volumes: - ./db_docker:/var/lib/postgresql - - ./scripts/create-dbs.sql:/docker-entrypoint-initdb.d/1-create-dbs.sql - - ./scripts/sql_db_tool/2-chinook_psql_load.sql:/docker-entrypoint-initdb.d/2-chinook_psql_load.sql + - ./scripts/create-dbs.sql:/docker-entrypoint-initdb.d/create-dbs.sql + - ./scripts/sql_db_tool/chinook_psql_load.sql:/docker-entrypoint-initdb.d/chinook_psql_load.sql ports: - 5432:5432 expose: diff --git a/docs/docusaurus/README.md b/docs/docusaurus/README.md index 87e3bb61..d1da82e0 100644 --- a/docs/docusaurus/README.md +++ b/docs/docusaurus/README.md @@ -28,7 +28,7 @@ For a quick setup of AgentKit, use the steps below, where both the backend app a Wait for the containers to build and start, which may take a few minutes depending on your system. Once the containers are up and running, you can access the apps in your browser at [http://localhost](http://localhost/). ## Chinook music database demo -- Ensure you are on the `develop` branch +- If docker containers are running, run `docker-compose down --volumes` - Follow the installation instructions above and swap `docker-compose.yml` with `docker-compose-demo.yml` to run the app - Try the prompt "When was AC/DC founded?" to see AgentKit in action! diff --git a/docs/docusaurus/docs/introduction.md b/docs/docusaurus/docs/introduction.md index 528b686f..569053d1 100644 --- a/docs/docusaurus/docs/introduction.md +++ b/docs/docusaurus/docs/introduction.md @@ -16,7 +16,7 @@ As an example, try the AgentKit codebase helper [demo](https://agentkit.infra.x. ## Chinook music database demo For a quick start to test some of the functionality, you can use the dummy Chinook example: -- Ensure you are on the `develop` branch +- If docker containers are running, run `docker-compose down --volumes` - Follow the [installation instructions](docs/setup/setup.md) and swap `docker-compose.yml` with `docker-compose-demo.yml` to run the app - Try the prompt "How many artists and songs are there in the database?" to see AgentKit in action! diff --git a/docs/docusaurus/docs/tutorial/tutorial.md b/docs/docusaurus/docs/tutorial/tutorial.md index 8dd3fb0a..1583d2e5 100644 --- a/docs/docusaurus/docs/tutorial/tutorial.md +++ b/docs/docusaurus/docs/tutorial/tutorial.md @@ -1,8 +1,8 @@ -# Tutorial: AgentX Codebase Helper +# Tutorial: AgentKit Codebase Helper -Let's run through a full example of how you can rapidly build a high quality Agent application using AgentX. +Let's run through a full example of how you can rapidly build a high quality Agent application using AgentKit. We're going to build an Agent which can guide us through a GitHub repository, with access to two sorts of information: @@ -13,12 +13,12 @@ Developers can use this Agent to familiarize themselves with the contents of the the documentation and generate a SQL query to retrieve information from the GitHub repository information. -In this example, we'll use data from the AgentX repository itself (meta!), but you can do this for any repository. +In this example, we'll use data from the AgentKit repository itself (meta!), but you can do this for any repository. All it takes is 3 steps: ## Step 1: Ingest data -The first thing we'll do is download all AgentX docs as PDF. We can also do this in native Markdown format, but it's quicker to use PDFs because AgentX has off-the-shelf PDF ingestion and retrieval. +The first thing we'll do is download all AgentKit docs as PDF. We can also do this in native Markdown format, but it's quicker to use PDFs because AgentKit has off-the-shelf PDF ingestion and retrieval. Next, we need a directory to store the PDFs in, for which we can use `backend/app/app/tool_constants/pdf_data` (and we can delete the music-related default PDFs already there). We can also specify any other location for the PDFs, as long as we correctly point the `PDF_TOOL_DATA_PATH` parameter in `.env` to it. @@ -72,7 +72,7 @@ This is what it looks like: ## Step 2: Configure tools -Recall that we want two functionalities: RAG over codebase documentation, and SQL query generation to search commit history. AgentX provides off-the-shelf tools for both of these things. +Recall that we want two functionalities: RAG over codebase documentation, and SQL query generation to search commit history. AgentKit provides off-the-shelf tools for both of these things. For RAG, we want to use a combination of `pdf_tool` and `expert_tool`, where `pdf_tool` retrieves documents and `expert_tool` makes an LLM call to generate an answer. The goal, then, is to run them sequentially: `pdf_tool` first and then `expert_tool` after with access to the retrieved docs. No change needs to be made to `pdf_tool`, we need to add a few lines of code to the `_arun` method of `expert_tool` and write some prompts. @@ -147,7 +147,7 @@ Luckily, we don't need to change any code in `sql_tool` for data retrieval from ```yaml sql_tool: description: >- - SQL tool to query structured table containing commit history of the Github repository of AgentX, an LLM powered agent. + SQL tool to query structured table containing commit history of the Github repository of AgentKit, an LLM powered agent. Input is a question about the data in natural language, output is a string that contains an SQL query in markdown format, the number of rows the query returns and the first 3 rows. {examples} prompt_message: |- @@ -165,7 +165,7 @@ sql_tool: Current conversation history: {{chat_history}} system_context: |- - You are an expert on the GitHub repository of AgentX, an LLM-powered agent. Your main task is to use + You are an expert on the GitHub repository of AgentKit, an LLM-powered agent. Your main task is to use SQL queries to retrieve information from structured tables containing commit history of the repository. During answering, the following principles MUST be followed: 1. Set the language to the markdown code block for each code block. For example, \```sql SELECT * FROM public.Artist``` is SQL. @@ -181,18 +181,18 @@ sql_tool: prompt_inputs: - name: examples content: |- - Example Input: \"List all users who have made commits to the AgentX repository" + Example Input: \"List all users who have made commits to the AgentKit repository" Example Output: \"`sql SELECT DISTINCT commit_user FROM public.COMMITS;`, total rows from SQL query: 8, first 3 rows: Ilyass El Mansouri, Gustaf Halvardsson, Casper Lindberg\" - name: table_definitions content: |- public.db_table | description - public.COMMITS | Table with all commits made to the AgentX repository; columns include commit user, commit message, commit timestamp, and file change. Each (commit, file changed) is a single row + public.COMMITS | Table with all commits made to the AgentKit repository; columns include commit user, commit message, commit timestamp, and file change. Each (commit, file changed) is a single row - name: table_notes content: |- Table name: public.COMMITS Table description: - Table with all commits made to the AgentX repository. + Table with all commits made to the AgentKit repository. Columns include commit user, commit message, commit timestamp, and file change. prompt_selection: |- @@ -204,8 +204,8 @@ sql_tool: Select the tables that can be most useful for answering to the question: {{question}} system_context_selection: |- - You are a software engineering expert on the AgentX codebase, an LLM-powered assistant. You have access to a - PostgreSQL database which has tables consisting of the commit history of the AgentX GitHub repository. + You are a software engineering expert on the AgentKit codebase, an LLM-powered assistant. You have access to a + PostgreSQL database which has tables consisting of the commit history of the AgentKit GitHub repository. Your task is to define which tables are useful to answer the question of the user. Please follow the instructions to answer the questions: @@ -224,8 +224,8 @@ sql_tool: Valid: [yes/no] Reason: [your reason for the validation] system_context_validation: |- - You are a software engineering expert on the AgentX codebase, an LLM-powered assistant. You have access to a - PostgreSQL database which has tables consisting of data from the AgentX GitHub repository, including commits, + You are a software engineering expert on the AgentKit codebase, an LLM-powered assistant. You have access to a + PostgreSQL database which has tables consisting of data from the AgentKit GitHub repository, including commits, issues, and pull requests. You should validate that the constructed SQL query is answering the question of the user. You must reply in the following format: @@ -264,7 +264,7 @@ This suggests using two action plans in `agent.yml`: action_plans: '0': name: '' - description: Use this plan to answer technical questions about AgentX - related to setup, code, codebase navigation, or other technical questions. + description: Use this plan to answer technical questions about AgentKit - related to setup, code, codebase navigation, or other technical questions. actions: - - pdf_tool - - expert_tool @@ -272,7 +272,7 @@ action_plans: '1': name: '' description: |- - Use this plan to fetch Github-related information from the repository of AgentX, such as commits, issues, pull requests. + Use this plan to fetch Github-related information from the repository of AgentKit, such as commits, issues, pull requests. actions: - - sql_tool ``` diff --git a/docs/docusaurus/sidebars.js b/docs/docusaurus/sidebars.js index 12cb55a4..6a28c335 100644 --- a/docs/docusaurus/sidebars.js +++ b/docs/docusaurus/sidebars.js @@ -33,6 +33,11 @@ const sidebars = { label: 'Configuration', items: ['configuration/configure_agent_and_tools', 'configuration/configure_ui'], }, + { + type: 'category', + label: 'Tutorial', + items: ['tutorial/tutorial.md'], + }, { type: 'category', label: 'How it works',