quivr README

The project's README from github.com/The-Vibe-Company/quivr. As one markdown file: README.md.

Quivr - Your Second Brain, Empowered by Generative AI

Quivr-logo

Discord Follow GitHub Repo stars Twitter Follow

Quivr, helps you build your second brain, utilizes the power of GenerativeAI to be your personal assistant !

Key Features 🎯

We take care of the RAG so you can focus on your product. Simply install quivr-core and add it to your project. You can now ingest your files and ask questions.*

We will be improving the RAG and adding more features, stay tuned!

This is the core of Quivr, the brain of Quivr.com.

Getting Started 🚀

You can find everything on the documentation.

Prerequisites 📋

Ensure you have the following installed:

30 seconds Installation 💽

Configuration

Workflows

Basic RAG

Creating a basic RAG workflow like the one above is simple, here are the steps:

  1. Add your API Keys to your environment variables
import os
os.environ["OPENAI_API_KEY"] = "myopenai_apikey"

Quivr supports APIs from Anthropic, OpenAI, and Mistral. It also supports local models using Ollama.

  1. Create the YAML file basic_rag_workflow.yaml and copy the following content in it
workflow_config:
  name: "standard RAG"
  nodes:
    - name: "START"
      edges: ["filter_history"]

    - name: "filter_history"
      edges: ["rewrite"]

    - name: "rewrite"
      edges: ["retrieve"]

    - name: "retrieve"
      edges: ["generate_rag"]

    - name: "generate_rag" # the name of the last node, from which we want to stream the answer to the user
      edges: ["END"]

# Maximum number of previous conversation iterations
# to include in the context of the answer
max_history: 10

# Reranker configuration
reranker_config:
  # The reranker supplier to use
  supplier: "cohere"

  # The model to use for the reranker for the given supplier
  model: "rerank-multilingual-v3.0"

  # Number of chunks returned by the reranker
  top_n: 5

# Configuration for the LLM
llm_config:

  # maximum number of tokens passed to the LLM to generate the answer
  max_input_tokens: 4000

  # temperature for the LLM
  temperature: 0.7
  1. Create a Brain with the default configuration
from quivr_core import Brain

brain = Brain.from_files(name = "my smart brain",
                        file_paths = ["./my_first_doc.pdf", "./my_second_doc.txt"],
                        )
  1. Launch a Chat
brain.print_info()

from rich.console import Console
from rich.panel import Panel
from rich.prompt import Prompt
from quivr_core.config import RetrievalConfig

config_file_name = "./basic_rag_workflow.yaml"

retrieval_config = RetrievalConfig.from_yaml(config_file_name)

console = Console()
console.print(Panel.fit("Ask your brain !", style="bold magenta"))

while True:
    # Get user input
    question = Prompt.ask("[bold cyan]Question[/bold cyan]")

    # Check if user wants to exit
    if question.lower() == "exit":
        console.print(Panel("Goodbye!", style="bold yellow"))
        break

    answer = brain.ask(question, retrieval_config=retrieval_config)
    # Print the answer with typing effect
    console.print(f"[bold green]Quivr Assistant[/bold green]: {answer.answer}")

    console.print("-" * console.width)

brain.print_info()
  1. You are now all set up to talk with your brain and test different retrieval strategies by simply changing the configuration file!

Go further

You can go further with Quivr by adding internet search, adding tools, etc. Check the documentation for more information.

Contributors ✨

Thanks go to these wonderful people:

Contribute 🤝

Did you get a pull request? Open it, and we'll review it as soon as possible. Check out our project board here to see what we're currently focused on, and feel free to bring your fresh ideas to the table!

Partners ❤️

This project would not be possible without the support of our partners. Thank you for your support!

YCombinator Theodo

License 📄

This project is licensed under the Apache 2.0 License - see the LICENSE file for details

quivr (The-Vibe-Company/quivr)

Searching Database…

39.6K ·GitHub
这是什么?Quivr 是一个开源引擎,能把你的文件和内容流变成搜索和监控工具——一个可以随时提问的「第二大脑」,其核心是一套由生成式 AI 驱动、理念明确的 RAG。
我是把它作为库加到自己的代码里,还是直接用一个做好的应用?本质上是一个开发者工具:你把 quivr-core 作为 Python 包安装,然后加到自己的项目里。Quivr.com 这个托管的「第二大脑」服务就是基于同一个核心构建的。
我怎么先把第一个版本跑起来?用 pip 安装 quivr-core(需要 Python 3.10 或更高版本),然后用 5 行代码创建一个 RAG。想更精细地控制,可以在 YAML 文件里定义工作流,创建一个 Brain,再启动聊天。
我需要 OpenAI 的 API 密钥吗,还是可以在本地跑模型?不绑定任何一家服务商:它可以用 Anthropic、OpenAI 和 Mistral 的 API,也可以通过 Ollama 使用本地模型。API 密钥放在你的环境变量里。
过了快速上手之后,哪些地方会变复杂?5 行代码的方式只能实现一个基础的 RAG:想要更丰富的功能,就得自己编写 YAML 工作流配置文件;而且除非用 Ollama 走本地路线,否则你必须把 API 密钥放到环境变量里。
这是给最终用户用的,还是给开发者用的?给开发者用的:它的口号是「RAG 我们来搞定,你专心做你的产品」——你是把 quivr-core 嵌入自己的应用,而不是自己从零搭建检索。
它支持导入哪些文件格式?几乎什么都可以:PDF、TXT、Markdown 等等,还支持添加你自己的解析器,并且集成了 Megaparse 用于文件导入。
这个 RAG 的「理念明确」是什么意思?团队只维护一个开箱即用、又快又高效的 RAG,所以你完全不用操心检索那些底层活儿——而且他们会持续改进它,不断添加新功能。
我能调整检索的行为吗?可以:你的 Brain 跑起来之后,只要改 YAML 配置文件就能测试不同的检索策略,还可以进一步加上联网搜索和工具。
Megaparse 是什么?一个解析集成:你可以用 Megaparse 导入你的文件,然后把解析出来的内容交给 Quivr 的 RAG 使用。
Size
171.7 MB
Stars
39.6K
Age
3y
Commits · 90 Days