> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vrin.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# How Vrin Works

> From document ingestion to reasoned answers: the 3-stage pipeline

Vrin is a retrieval-time reasoning layer. It sits between your data and your AI, curating the right context before the LLM ever sees it.

## The Core Insight

**Pre-inference context gathering is not the same as LLM reasoning.**

LLMs reason well over good context, but they can't gather it. Standard RAG retrieves by semantic similarity, which works for simple lookups. But real questions require connecting facts across documents, timelines, and domains. Transformers can't do this natively. Vector search doesn't even try.

## The 3-Stage Pipeline

<Steps>
  <Step title="Ingest">
    Documents are chunked, embedded, and analyzed. Vrin extracts structured facts (entities, relationships, temporal markers) and builds a **knowledge graph** alongside the vector index. Every fact is linked to its source with confidence scores.

    ```bash theme={null}
    vrin insert "ACME reported $50M revenue in Q4..." --title "ACME Q4"
    vrin upload ./report.pdf
    ```
  </Step>

  <Step title="Retrieve & Reason">
    When you query, Vrin doesn't just find similar text. It:

    1. **Decomposes** complex queries into sub-questions
    2. **Traverses the knowledge graph** to find multi-hop connections
    3. **Searches the vector index** for supporting text chunks
    4. **Fuses results** from both graph and vector retrieval
    5. **Scores and filters** to deliver only relevant, high-confidence context

    This is the reasoning layer that standard RAG lacks.
  </Step>

  <Step title="Generate">
    The curated context (structured facts + relevant chunks) is passed to the LLM. Because the hard work of gathering and connecting information is already done, the LLM can focus on what it's good at: synthesizing a clear, well-reasoned answer.
  </Step>
</Steps>

## Why Not Just RAG?

Standard vector RAG has three fundamental limits:

| Problem                 | Standard RAG                                                         | Vrin                                                                         |
| ----------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| **Multi-hop reasoning** | Retrieves chunks independently, can't connect facts across documents | Graph traversal follows entity relationships across any number of hops       |
| **Temporal awareness**  | No concept of time, treats all facts equally                         | Tracks `valid_from` / `valid_to` on every fact                               |
| **Fact provenance**     | Returns text chunks, no structure                                    | Every answer traces back to: source document, extracted fact, reasoning step |

## What Gets Built During Ingestion

When you insert a document, Vrin creates:

* **Text chunks** in a vector index (for semantic similarity search)
* **Entities** in the knowledge graph (people, companies, concepts, events)
* **Relationships** between entities (typed, directional edges)
* **Temporal markers** on facts that change over time
* **Confidence scores** per fact (model, timestamp, extraction confidence)

The knowledge graph and vector index work together. The graph finds the right connections. The vector index provides the supporting evidence.

<Card title="See it in action" icon="terminal" href="/quickstart">
  Insert your first document and query it in under 2 minutes.
</Card>
