Ragna is developed in Python and is distributed under a BSD-3-Clause license.
Install
For local installation, follow these steps, elaborated further than the official documentation:
- Install Ragna and its dependencies:
pip install 'ragna[all]'
- Address any dependency issues, such as with jinja2:
pip install jinja2==3.1.2
- Initialize the configuration file using the
ragna init CLI:
$ ragna init
Welcome to the Ragna config creation wizard!
I'll help you create a configuration file to use with ragna.
Due to the large amount of parameters, I unfortunately can't cover everything. If you want to customize
everything, please have a look at the documentation instead.
? Which of the following statements describes best what you want to do? I want to try Ragna and its builtin source storages and assistants, which potentially require additional dependencies or setup.
ragna has the following components builtin. Select the ones that you want to use. If the requirements of a
selected component are not met, I'll show you instructions how to meet them later.
? Which source storages do you want to use? [Chroma]
? Which assistants do you want to use? [OpenAI/gpt-4]
The output path /home/raph/Dev/ragna/ragna.toml already exists and you didn't pass the --force flag to
overwrite it.
? What do you want to do? Overwrite the existing file.
And with that we are done π I'm writing the configuration file to /home/raph/Dev/ragna/ragna.toml.
You can choose different options or directly edit the ragna.toml file. For using the GPT-4 model, provide your OpenAI API key:
export OPENAI_API_KEY="sk-<the-rest-of-the-key>"
Verify Ragna's configuration with the ragna check command:
$ ragna check
source storages
ββββββ³βββββββββ³ββββββββββββββββββββββββ³ββββββββββββββββββββββ
β β name β environment variables β packages β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β β
β Chroma β β β
chromadb>=0.4.13 β
β β β β β
tiktoken β
ββββββ΄βββββββββ΄ββββββββββββββββββββββββ΄ββββββββββββββββββββββ
assistants
ββββββ³βββββββββββββββ³ββββββββββββββββββββββββ³βββββββββββ
β β name β environment variables β packages β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β β
β OpenAI/gpt-4 β β
OPENAI_API_KEY β β
ββββββ΄βββββββββββββββ΄ββββββββββββββββββββββββ΄βββββββββββ
Use
To start using Ragna:
$ ragna api
INFO: RagnaDemoAuthentication: You can log in with any username and a matching password.
INFO: Started server process [4016]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:31476 (Press CTRL+C to quit)
Ragna's REST API is detailed in the OpenAPI format. The project also offers a Python API.
$ ragna ui
Launching server at http://localhost:31477
You can now log in and start chats by uploading documents:
Upload Document
And querying their content:
Chat with Document
Extend
Ragna's architecture facilitates easy extension. Its dynamic community is likely to soon offer new features, vectorstores, and models.
Inspired by an article, I was able to easily add basic Azure OpenAI support:
Azure OpenAI Support
And to connect Ragna to my company instance:
Chat with Azure OpenAI
In conclusion, Ragna stands out as a robust and versatile tool for RAG orchestration, offering ease of use and extensibility, which positions it as a promising asset for AI-enhanced document management.