Skip to content

Commit

Permalink
docs: Update setup docs (#884)
Browse files Browse the repository at this point in the history
Update setup docs
  • Loading branch information
tianjing-li authored Dec 17, 2024
1 parent f71a1f6 commit 49f70b9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 32 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Toolkit is a deployable all-in-one RAG application that enables users to quickly
## Try Now:
There are two main ways for quickly running Toolkit: local and cloud. See the specific instructions given below.
### Local
*You will need to have [Docker](https://www.docker.com/products/docker-desktop/) and [Docker-compose >= 2.22](https://docs.docker.com/compose/install/) installed. [Go here for a more detailed setup.](/docs/setup.md)*
*You will need to have [Docker](https://www.docker.com/products/docker-desktop/), [Docker-compose >= 2.22](https://docs.docker.com/compose/install/), and [Poetry](https://python-poetry.org/docs/#installation) installed. [Go here for a more detailed setup.](/docs/setup.md)*
Note: to include community tools when building locally, set the `INSTALL_COMMUNITY_DEPS` build arg in the `docker-compose.yml` to `true`.

Both options will make the frontend available at http://localhost:4000.
Both options will serve the frontend at http://localhost:4000.

#### Using `make`
Use the provided Makefile to simplify and automate your development workflow with Cohere Toolkit, including Docker Compose management, testing, linting, and environment setup.
Expand All @@ -42,8 +42,6 @@ cd cohere-toolkit
make first-run
```



#### Docker Compose only
Use Docker Compose directly if you want to quickly spin up and manage your container environment without the additional automation provided by the Makefile.
```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/custom_tool_guides/tool_auth_guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### 1. **Create an Authentication Class**
You need to create a class specifically for your tool's authentication.
You need to create a class specifically for your tool's authentication. For great examples, check out the implementations for GMail, GDrive or Slack.

### 2. **Inheritance**
Your authentication class should inherit from:
Expand Down Expand Up @@ -85,5 +85,5 @@ def retrieve_auth_token(self, request: Request, session: DBSessionDep, user_id:
### 4. **Integrate the Auth Class**
Once you've created your authentication class, integrate it into your tool’s configuration so that the frontend can use it for authenticating users when interacting with the tool.

To do so, go to your tool config definition and add:
To do so, go to your tool's `get_tool_definition` method and add:
`auth_implementation=<YourAuthClass>,`
19 changes: 12 additions & 7 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
cd <repository-folder>
```

2. **Set Up with Make**:
2. **Install Poetry and Docker**:
Install [Poetry >= 1.7.1](https://python-poetry.org/docs/#installation)
Install [Docker](https://www.docker.com/products/docker-desktop/)
Install [Docker Compose >= 2.22](https://docs.docker.com/compose/install/)

3. **Set Up with Make**:
Run:
```bash
make first-run
```
This generates the necessary configuration files and applies database migrations.

3. **Manual Configuration**:
4. **Manual Configuration**:
If you prefer:
- Create a `configuration.yaml` file based on `configuration.template.yaml`.
- Replace the placeholders with your actual values.
Expand All @@ -25,10 +30,11 @@

### Environment Variables

Ensure to configure your environment variables appropriately. Important ones include:
- `COHERE_API_KEY`: Your API key for Cohere.
- `DATABASE_URL`: Connection string for PostgreSQL.
- `REDIS_URL`: Connection string for Redis.
Ensure your `configuration.yaml` and `secrets.yaml` file are properly generated and have valid values, especially for the following:

- `cohere_platform.api_key` (in the secrets file): Your API key for Cohere.
- `database.url` (in the config file): Connection string for PostgreSQL.
- `redis.url` (in the config file): Connection string for Redis.

### Local Database Setup

Expand Down Expand Up @@ -72,6 +78,5 @@ Ensure to configure your environment variables appropriately. Important ones inc

### Additional Tips

- **Use Poetry**: It manages dependencies efficiently. Ensure to install the required version (`1.7.1` or higher).
- **Linting and Formatting**: Use `make lint` and `make lint-fix` for maintaining code quality.
- **VSCode Setup**: Install extensions for Ruff and set up your environment as per the provided recommendations.
23 changes: 5 additions & 18 deletions docs/walkthrough/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1 align="center" >Toolkit Guide</h1>
</p>

Cohere Toolkit is a collection of plug-in pre-built components enabling customers to quickly build and deploy **production** level RAG applications. Principles of the toolkit is that it is:
Cohere Toolkit is a collection of plug-and-play pre-built components enabling customers to quickly build and deploy **production** level RAG applications. Toolkit was built with the following principles in mind:

- Quick and simple to set up a light weight version
- Quick and simple to configure for your needs
Expand All @@ -15,12 +15,7 @@ Cohere Toolkit is a collection of plug-in pre-built components enabling customer

<h2>Initial Set Up</h2>

When you first set up the toolkit by running one of the following commands:
- `docker run -e COHERE_API_KEY='>>YOUR_API_KEY<<' -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest`
- Or cloning:
- `git clone https://github.com/cohere-ai/cohere-toolkit.git`
- `cd cohere-toolkit`
- `make first-run`
Quickly setup Toolkit by following our [setup guide.](../setup.md)

The default configuration of the toolkit is:

Expand All @@ -33,7 +28,6 @@ On top of this the toolkit offers many configurable components
Below we will go through each of these components including the prebuilt options and how to plug in your own.



<p align="center">
<img src="assets/interfaces.png" width="100px" height="100px" />
<h1 align="center" >Interfaces</h1>
Expand All @@ -42,9 +36,9 @@ Below we will go through each of these components including the prebuilt options
Interfaces are applications on top of the backend API this could be anything from a website, workflows, a bot etc.

Pre-built interfaces which your can customize to your needs include:
- Chat UI (Coral)

- SlackBot
- Assistants UI (Agentic, default)
- Chat UI (Coral, non-agentic)
- Slack Bot

To add your own:

Expand Down Expand Up @@ -138,10 +132,3 @@ We have a [detailed guide for each cloud deployment here](../service_deployments
</p>

The toolkit stores history of conversations to improve next turn generations. It stores these turns in a PostgreSQL database. It is possible to switch this out for a database that you prefer. There is also an option with no storage.

<p align="center">
<img src="assets/analytics.png" width="100px" height="100px" />
<h1 align="center" >Analytics</h1>
</p>

Currently in development.
2 changes: 1 addition & 1 deletion src/backend/config/configuration.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ redis:
url: redis://:redis@redis:6379
tools:
hybrid_web_search:
# List of web search tool names, eg: google_web_search, tavily_web_search
# List of web search tool names, from: google_web_search, tavily_web_search, brave_web_search
enabled_web_searches:
- tavily_web_search
# List of domains to filter (exclusively) for web search
Expand Down

0 comments on commit 49f70b9

Please sign in to comment.