Ragu is a system for creating and managing agents.
- Ragu Chunker (
ragu-chunker
): Document processing and chunking service - Ragu Web App (
ragu-web-app
): Frontend application for user interaction - Ragu Chat API (
ragu-chat-api
): Backend API for chat functionality
This repository contains all components and setup instructions for the Ragu application stack.
- Git
- Git installation https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- Docker
- Required version: 20.10.13 or higher
- Docker installation https://docs.docker.com/desktop/
- Docker Compose:
- Required version: 2.17.0 or higher
- Docker Compose installation https://docs.docker.com/compose/install/
- OpenAI API key
- OpenAI API key https://platform.openai.com/docs/overview
- Google Oauth2 client id and secret
- Google Oauth2 https://developers.google.com/identity/protocols/oauth2
This chapter will cover steps to start the Ragu application stack on your local machine utilizing OpenAI for embeddings and llms and Google as Oauth provider.
Detailed Oauth information can be found in ragu-chat-api
documentation Authentication Chapter
Supported providers:
Oauth | LLM | Embedder |
---|---|---|
OpenAI | OpenAI | |
Apple | Azure | Azure |
Carnet | Ollama (for local development) | Onnx Compatible models (for local development) |
This article will cover cloud based solution with OpenAI and Azure. Local development guide will be provided in the future releases.
The repository contains submodules, so make sure to clone it with the --recurse-submodules
flag.
git clone --recurse-submodules https://github.com/barrage/ragu.git
git submodule init && \
git submodule update
Minimal requirements are an Oauth provider and OpenAI API key.
Having an Oauth2 client id and secret is required to run the application. Obtain these from Google or Apple or Carnet. For example, if we want to enable Google Oauth and create, edit the following files:
config/ragu-chat-api/application.conf
...
features {
...
oauth {
google = true
}
...
}
...
// use this to create the initial admin account
// be careful to use the email of your Oauth provider account
admin {
email = "[email protected]"
fullName = "Admin"
firstName = "Admin"
lastName = "Admin"
}
...
oauth {
google {
tokenEndpoint = "tokenEndpoint"
keysEndpoint = "keysEndpoint"
tokenIssuer = "tokenIssuer"
accountEndpoint = "accountEndpoint"
clientId = "clientId"
clientSecret = "clientSecret"
}
}
...
config/ragu-web-app/.env
...
OAUTH_GOOGLE_LOGIN_CLIENTID=google-client-id
...
The rest of the stack is configured to work together but feel free to make changes that suit your needs. And/or vendors.
An OpenAI API key is required to run the application. Obtain this from OpenAI. Edit the following files:
config/ragu-chat-api/application.conf
...
llm {
openai {
endpoint = "https://api.openai.com/v1/"
apiKey = "apiKey"
}
}
...
config/ragu-chunker/.env
...
OPENAI_KEY="open-ai-key"
...
docker compose -f docker-compose-infra.yaml up -d \
&& docker compose up -d
docker compose -f docker-compose-infra.yaml up -d;
docker compose up -d
First the infrastructure services are started which must be fully ready and accepting connections so the application services can perform migrations and code generation from database schema.
The infrastructure services are included in the main docker-compose.yaml
file, therefore after the
initial setup the stack can be managed by it i.e. by just using the docker compose
command.
This process may take a while depending on your system, especially on ARM machines.
You can define volumes persist data on your host machine.
# docker-compose-infra.yaml
volumes:
postgres_data:
qdrant_data:
weaviate_data:
# docker-compose.yaml
volumes:
chonkit_data:
Currently, the whole stack is built from source. In the future releases we will provide artifacts like
binaries, prebuilt images etc...
ragu-chunkger
is built in compatibility mode for arm64 systems which will cause slow compilation time on those systems.