# Quivr

> Opinionated RAG core that turns your files into a queryable second brain

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: Python
- Repository: https://github.com/The-Vibe-Company/quivr
- Website: https://core.quivr.com
- Canonical page: https://ai-tldr.dev/tools/quivr/

## In short

Quivr is an open-source framework for building Retrieval-Augmented Generation (RAG) applications. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python. To get started: install the package.

## Overview

Quivr is an open-source framework for building Retrieval-Augmented Generation (RAG) applications. It lets you ingest your own files and then ask questions about them in plain language, so you can build a personal assistant or a 'second brain' on top of your documents.

The project ships an opinionated, ready-made RAG pipeline through the quivr-core Python package. It handles the retrieval and answering for you, so you can focus on your product instead of wiring up the plumbing. Quivr works with many LLM providers and supports a wide range of file formats.

## What it does

- Opinionated RAG pipeline that is fast and efficient out of the box, so you do not have to assemble retrieval logic yourself
- Works with any LLM, including OpenAI, Anthropic, Mistral, and local models served through Ollama
- Handles any file, such as PDF, TXT, and Markdown, and lets you plug in your own parsers
- Customizable RAG: add internet search, add tools, and tune behavior through a YAML workflow config
- Configurable retrieval with reranking and adjustable history, token limits, and temperature settings
- Integrates with Megaparse for file ingestion before querying with Quivr

## Getting started

Quivr needs Python 3.10 or newer. You install the quivr-core package and can build a working RAG in just a few lines of code.

1. Install the package

   Install quivr-core from PyPI using pip.

```bash
pip install quivr-core
```

2. Create a brain from your files

   Build a Brain from one or more files and ask it a question. Quivr handles ingestion and retrieval for you.

```python
from quivr_core import Brain

brain = Brain.from_files(
    name="test_brain",
    file_paths=["./my_first_doc.pdf", "./my_second_doc.txt"],
)

answer = brain.ask("what is gold?")
print("answer:", answer)
```

3. Set your API key

   Add your LLM provider API key to your environment. Quivr supports Anthropic, OpenAI, and Mistral, plus local models through Ollama.

```python
import os
os.environ["OPENAI_API_KEY"] = "myopenai_apikey"
```

4. Customize retrieval with a YAML workflow

   Define a workflow in a YAML file and load it with RetrievalConfig to control reranking, history, token limits, and temperature, then pass it when you ask a question.

```python
from quivr_core.config import RetrievalConfig

retrieval_config = RetrievalConfig.from_yaml("./basic_rag_workflow.yaml")
answer = brain.ask("your question", retrieval_config=retrieval_config)
```

## When to use it

- Build a personal 'second brain' assistant that answers questions from your own notes and documents
- Add a document question-answering feature to a product without building the RAG pipeline from scratch
- Experiment with different retrieval strategies by editing a YAML config instead of changing code
- Run RAG over private files with a local LLM through Ollama to keep data on your own machine
