Installation
Run R2R on your local system
This guide will help you get started with R2R quickly and efficiently.
Environment Variables
Vector Database
R2R uses Postgres with pgvector as the default vector database implementation. The following environment variabls are necessary to facilitate communication with the database.
Be sure to install the pgvector extension for your Postgres database.
export POSTGRES_USER=$YOUR_POSTGRES_USER
export POSTGRES_PASSWORD=$YOUR_POSTGRES_PASSWORD
export POSTGRES_HOST=$YOUR_POSTGRES_HOST
export POSTGRES_PORT=$YOUR_POSTGRES_PORT
export POSTGRES_DBNAME=$YOUR_POSTGRES_DBNAME
export POSTGRES_VECS_COLLECTION=demo_vecs
POSTGRES_VECS_COLLECTION
corresponds to the collection within your Postgres database where the tables relevant to R2R reside. If the specified collection does not exist then it will be created by R2R during initialization.
Language Model Providers
Language model providers are not necessary when running with a local setup, as described in this cookbook. However, most of the docs assume default to hosted provider settings which require an OpenAI API key to be ran successfully.
OpenAI (default hosted provider)
export OPENAI_API_KEY=sk-...
Other LLM providers are supported:
export ANTHROPIC_API_KEY=...
export VERTEX_API_KEY=...
# Add other provider keys as needed
Installation
pip install r2r
Full Installation (Developers)
For developers looking to extend R2R:
-
Install Poetry: Visit the official Poetry website for installation instructions.
-
Clone and Install Dependencies:
git clone [email protected]:SciPhi-AI/r2r.git cd r2r poetry install -E all
-
Config Setup: Create
.env
andconfig.json
files:cp .env.example .env vim .env # Edit with your environment variables vim config.json # Modify as needed
-
Configure Environment Variables: At minimum, set up your OpenAI API key and PostgreSQL credentials in the
.env
file.
For detailed configuration instructions, refer to our Configuration Guide. When using poetry, you will need to append poetry run
to every command in the documentation, or execute the commands after executing poetry shell
.
Database Setup Help (Optional)
Next Steps
After installation:
- Follow the R2R Quickstart guide
- Explore specific features through our cookbooks
- Join our Discord community for support and discussions
For more information on configuring and customizing R2R, check out our guides on configuration and customization.
Was this page helpful?