# Trieve

> Search, recommendations and RAG over one chunk store

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: Rust
- Licence: MIT
- Repository: https://github.com/devflowinc/trieve
- Website: https://trieve.ai
- Canonical page: https://ai-tldr.dev/tools/trieve/

## In short

Trieve is Search, recommendations and RAG over one chunk store. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Rust and licensed MIT. To get started: copy the environment files.

## Overview

Trieve is an all-in-one retrieval API. You upload chunks once, and the same store answers dense semantic queries, typo-tolerant neural full-text queries, hybrid queries with cross-encoder reranking, "more like this" recommendations, and fully-managed RAG — rather than assembling a vector database, a keyword index, a reranker and an LLM wrapper separately and keeping them in sync.

The server is written in Rust and backed by Qdrant for dense vectors. Full-text search is neural rather than lexical: every uploaded chunk is also vectorized with `naver/efficient-splade-VI-BT-large-query`, which is what makes it typo tolerant. Hybrid search combines both and can rerank with `BAAI/bge-reranker-large`. Embedding, SPLADE, reranking and LLM models can all be swapped for your own.

Retrieval quality controls are first-class: sub-sentence highlighting bolds the matching words inside a chunk, recency biasing keeps stale results down, merchandizing tunes relevance from clicks and add-to-carts, grouping marks several chunks as one file so a top-level result never appears twice, and filters cover date ranges, substrings, tags and numerics. It is offered as a hosted API and self-hosts in your own VPC or on-prem, with documented guides for AWS, GCP, Kubernetes and docker compose.

## What it does

- Dense semantic search over Qdrant with OpenAI or Jina embedding models
- Typo-tolerant neural sparse search — every chunk is also vectorized with efficient-SPLADE — and hybrid search with `BAAI/bge-reranker-large` cross-encoder reranking
- Recommendation API that returns similar chunks or files, for bookmark, favourite and upvote-driven surfaces
- RAG routes via OpenRouter, either fully managed with topic-based memory or with a context set you choose
- Relevance controls: sub-sentence highlighting, recency biasing, click and add-to-cart merchandizing, grouping, and date/substring/tag/numeric filters
- Bring your own text-embedding, SPLADE, cross-encoder and LLM models; self-host on AWS, GCP, Kubernetes or docker compose

## Getting started

The quickest path is the hosted dashboard; self-hosting guides live in the docs. To run it from source, the repository uses docker compose for the supporting services and cargo for the Rust server and its workers.

1. Copy the environment files

   Each frontend and the server take their own env file from the checked-in examples.

```bash
cp .env.analytics ./frontends/analytics/.env
cp .env.chat ./frontends/chat/.env
cp .env.search ./frontends/search/.env
cp .env.example ./server/.env
cp .env.dashboard ./frontends/dashboard/.env
```

2. Set your LLM key

   Open `./server/.env` and set both `LLM_API_KEY` and `OPENAI_API_KEY` to your own OpenAI key.

3. Start the supporting services

   Concatenate the env files and bring up the containers the server depends on.

```bash
cat .env.chat .env.search .env.server .env.docker-compose > .env

./convenience.sh -l
```

4. Start the embedding servers

   Two compose files are provided — pick CPU or GPU. If you run embeddings on a separate GPU box, update `EMBEDDING_SERVER_ORIGIN`, `SPARSE_SERVER_QUERY_ORIGIN` and `SPARSE_SERVER_DOC_ORIGIN` to point at it.

```bash
docker compose -f docker-compose-cpu-embeddings.yml up -d
```

5. Run the server and its workers

   The API server and three background workers each run as their own process.

```bash
cd server
cargo watch -x run
cargo run --bin ingestion-worker
cargo run --bin file-worker
cargo run --bin delete-worker
```

6. Verify it came up

   The OpenAPI reference renders at localhost:8090/redoc. Create an account and a dataset with test data at localhost:5173, then search it at localhost:5174.

## When to use it

- Put semantic search, keyword search and reranking behind one API instead of running a vector DB and a search engine side by side
- Add a "more like this" rail to a product or content site from the same index that powers its search box
- Ship RAG over your own documents with topic-based conversation memory handled by the API
- Keep search and retrieval inside your own VPC where documents cannot be sent to a hosted third party
