Drowning in Vector Pipeline Boilerplate? Quivr-Core Distills Production-Grade RAG into 5 Lines of Python

Drowning in Vector Pipeline Boilerplate? Quivr-Core Distills Production-Grade RAG into 5 Lines of Python

By Reggi, 02 Sep 2026

Most engineering teams attempting to build document search or context-aware AI assistants fall into the exact same trap. You start with a clear objective to query internal documentation, and within 48 hours you are knee-deep in vector database schema definitions, chunking strategy edge cases, embedding model selection, and prompt formatting glue code. What was supposed to be a simple product feature rapidly degenerates into a dedicated infrastructure project.

Quivr-core eliminates this friction. Extracted directly from the production brain behind Quivr.com, quivr-core provides an opinionated, high-performance Retrieval-Augmented Generation (RAG) framework designed to drop into any modern Python application. Instead of spending days wiring up disparate infrastructure components, you get an inspectable, battle-tested pipeline up and running in five lines of Python.

The Architecture of an Opinionated RAG Engine

The fundamental problem with many existing AI tooling ecosystems is over-configurability. When a framework tries to support every theoretical permutation of document retrieval, its configuration surface expands dramatically. You end up reading thousands of lines of documentation just to establish basic context grounding.

Quivr-core takes a strictly opinionated stance. It encapsulates the ingestion, embedding, storage, retrieval, and generation phases behind a single central abstraction: the Brain class.

                                [ Input Files ]
                                       │
                                       ▼
                             [ Brain.from_files() ]
                                       │
┌──────────────────────────────────────┴──────────────────────────────────────┐
│ YAML Workflow Pipeline                                                      │
│                                                                             │
│  [START] ──► [filter_history] ──► [rewrite] ──► [retrieve] ──► [generate_rag] ──► [END]
└──────────────────────────────────────┬──────────────────────────────────────┘
                                       │
                                       ▼
                                [ Answer Output ]

Underneath this minimal surface area lies a deterministic workflow system defined by explicitly chained nodes. Rather than hiding pipeline steps inside opaque framework black boxes, Quivr-core exposes the execution graph through simple, human-readable YAML configurations.

This gives systems engineers two key advantages:

  1. Instant Developer Velocity: Standard RAG pipelines work out of the box without requiring manual vector store initialization or embedding model selection.
  2. Complete Workflow Transparency: Every step between the raw query and the final generated output is inspectable, configurable, and tweakable.

From Zero to Grounded Inferences in Five Lines

Getting started requires Python 3.10 or newer. You can install the package directly via pip:

bash
pip install quivr-core

Once installed, setting up context-grounded retrieval takes literally five lines of execution code. Here is the minimal working example that creates a brain from temporary text data and executes a query:

python
import os import tempfile from quivr_core import Brain # Set your model provider key os.environ["OPENAI_API_KEY"] = "your_api_key_here" if __name__ == "__main__": with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file: temp_file.write("Gold is a liquid of blue-like colour.") temp_file.flush() # Ingest and create the brain context brain = Brain.from_files( name="test_brain", file_paths=[temp_file.name], ) # Query the grounded brain answer = brain.ask("what is gold? asnwer in french") print("answer:", answer)

The beauty of this design lies in its simplicity. You do not define chunk overlaps, you do not provision vector table indices, and you do not write manual context-injection prompts. The Brain instance ingests the files, constructs the underlying vector representations, and executes the retrieval flow seamlessly.

Dissecting the YAML Directed Workflow Engine

While the five-line defaults are sufficient for rapid prototyping, production environments often require granular control over retrieval mechanics, conversation history, and reranking parameters. Quivr-core handles this by allowing developers to pass a custom RetrievalConfig loaded directly from a YAML file.

Consider this production workflow configuration (basic_rag_workflow.yaml):

yaml
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" edges: ["END"] # Maximum number of previous conversation iterations # to include in the context of the answer max_history: 10 # Reranker configuration reranker_config: supplier: "cohere" model: "rerank-multilingual-v3.0" top_n: 5 # Configuration for the LLM llm_config: max_input_tokens: 4000 temperature: 0.7

Understanding the Pipeline Execution Nodes

The workflow config defines a precise graph execution chain:

  • filter_history: Prunes incoming context to prevent token window overflow based on max_history constraints.
  • rewrite: Transforms raw user questions into optimized retrieval queries, resolving conversational ambiguities.
  • retrieve: Fetches candidate document chunks from vector storage based on semantic similarity.
  • generate_rag: Passes the retrieved context and user query into the target LLM to produce a grounded response.

By breaking down the pipeline into discrete, readable nodes, you can easily plug in advanced components like the Cohere multilingual reranker (rerank-multilingual-v3.0) or modify token limits without changing a single line of your core application logic.

Heterogeneous LLM Support and Document Parsers

Modern enterprise software cannot afford vendor lock-in. Quivr-core decoupling allows you to route inference across multiple top-tier model providers or run strictly localized stacks for compliance and cost control.

Provider / ToolIntegration CapabilitiesDeployment Target
OpenAIAPI Key environment variableCloud
AnthropicAPI Key environment variableCloud
MistralAPI Key environment variableCloud
OllamaLocal model execution (Gemma, etc.)On-Premise / Local
MegaparseAdvanced document parsing library integrationIngestion Pipeline

For file format support, Quivr-core processes PDFs, plain text files (.txt), Markdown (.md), and other standard formats right out of the box. For complex, unstructured document ingestion, it natively integrates with Megaparse, enabling high-fidelity layout extraction before passing content to the RAG engine.

Building a Production CLI Terminal Chat Interface

To see how Quivr-core handles interactive applications, here is a complete, full-featured CLI chat engine using quivr_core alongside the rich library for terminal rendering:

python
import os from rich.console import Console from rich.panel import Panel from rich.prompt import Prompt from quivr_core import Brain from quivr_core.config import RetrievalConfig # Define API key os.environ["OPENAI_API_KEY"] = "your_api_key_here" def main(): # Ingest project knowledge base brain = Brain.from_files( name="my smart brain", file_paths=["./my_first_doc.pdf", "./my_second_doc.txt"], ) # Print brain metadata brain.print_info() # Load declarative retrieval pipeline config 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")) # Interactive session loop while True: question = Prompt.ask("[bold cyan]Question[/bold cyan]") if question.lower() == "exit": console.print(Panel("Goodbye!", style="bold yellow")) break # Execute grounded retrieval ask answer = brain.ask(question, retrieval_config=retrieval_config) # Output streamed or final answer console.print(f"[bold green]Quivr Assistant[/bold green]: {answer.answer}\n") console.print("-" * console.width) brain.print_info() if __name__ == "__main__": main()

Pragmatic Architecture: Working Code Beats Infinite Configuration

There is a clear dichotomy in current AI infrastructure tooling. On one side are massive, unopinionated frameworks that force developers to assemble every nut and bolt manually. On the other side lies Quivr-core, which gives you sensible, production-ready defaults derived directly from real-world SaaS traffic on Quivr.com.

If your goal is to build custom RAG graph abstractions for research purposes, building from scratch might make sense. But if you are building an operational product that requires fast, reliable document grounding without getting bogged down in infrastructure maintenance, Quivr-core delivers the exact leverage you need. You get an open-source (Apache 2.0 License), multi-model engine that lets you ship features today and refine workflow configs as your requirements evolve.

References


Popular Reads