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

# Pluggable Backends

> Swap cognee-rust storage and compute backends (LLM, embeddings, vector, graph, relational, storage, session, ontology, tokenizer) via configuration.

cognee-rust is built on trait abstractions so each storage/compute backend can be
swapped via configuration. Pick providers with the env vars / config keys in
[Configuration](/rust/configuration); the trait + adapter detail is in rustdoc
(`cargo doc -p <crate> --no-deps --open`).

| Concern                  | Trait (crate)                                                                                                                      | Providers                                                                                                                                                                                    | Selected by                                               |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| **LLM**                  | `Llm` ([`cognee-llm`](https://github.com/topoteretes/cognee-rs/blob/main/crates/llm/))                                             | `OpenAIAdapter` (OpenAI/Ollama/vLLM/llama.cpp), `MockLlm` (`testing`)                                                                                                                        | `LLM_PROVIDER`, `LLM_MODEL`, `LLM_ENDPOINT`               |
| **Embeddings**           | `EmbeddingEngine` ([`cognee-embedding`](https://github.com/topoteretes/cognee-rs/blob/main/crates/embedding/))                     | `OnnxEmbeddingEngine` (local BGE-Small), `OpenAICompatibleEmbeddingEngine`, `OllamaEmbeddingEngine`, `MockEmbeddingEngine`                                                                   | `EMBEDDING_PROVIDER` (+ `MOCK_EMBEDDING`)                 |
| **Vector DB**            | `VectorDB` ([`cognee-vector`](https://github.com/topoteretes/cognee-rs/blob/main/crates/vector/))                                  | `LanceDbAdapter` (embedded, persistent, default on non-Android), `BruteForceVectorDB` (in-memory; Android or `:memory:`), `PgVectorAdapter` (feature `pgvector`), `MockVectorDB` (`testing`) | `VECTOR_DB_PROVIDER` (`lancedb`/`brute-force`/`pgvector`) |
| **Graph DB**             | `GraphDBTrait` ([`cognee-graph`](https://github.com/topoteretes/cognee-rs/blob/main/crates/graph/))                                | `LadybugAdapter` (embedded), `PgGraphAdapter` (feature `postgres`)                                                                                                                           | `GRAPH_DATABASE_PROVIDER` (`ladybug`/`kuzu`/`postgres`)   |
| **Relational DB**        | `IngestDb`/`SearchHistoryDb`/`DeleteDb` ([`cognee-database`](https://github.com/topoteretes/cognee-rs/blob/main/crates/database/)) | `DatabaseConnection` — SQLite / Postgres via SeaORM                                                                                                                                          | `DB_PROVIDER`, `DATABASE_URL`                             |
| **File storage**         | `StorageTrait` ([`cognee-storage`](https://github.com/topoteretes/cognee-rs/blob/main/crates/storage/))                            | `LocalStorage` (`file://`), `MockStorage`                                                                                                                                                    | `STORAGE_BACKEND`                                         |
| **Session store**        | `SessionStore` ([`cognee-session`](https://github.com/topoteretes/cognee-rs/blob/main/crates/session/))                            | `FsSessionStore`, `RedisSessionStore`, `SeaOrmSessionStore`                                                                                                                                  | `COGNEE_SESSION_STORE` (server)                           |
| **Ontology**             | `OntologyResolver` ([`cognee-ontology`](https://github.com/topoteretes/cognee-rs/blob/main/crates/ontology/))                      | `RdfLibOntologyResolver`, `NoOpOntologyResolver`                                                                                                                                             | `ONTOLOGY_RESOLVER`                                       |
| **Tokenizer** (chunking) | `TokenCounter` ([`cognee-chunking`](https://github.com/topoteretes/cognee-rs/blob/main/crates/chunking/))                          | `WordCounter`, `HuggingFaceTokenCounter` (feature), `TikTokenCounter` (feature)                                                                                                              | `COGNEE_TOKEN_COUNTER`                                    |

Notes:

* **Embedded by default.** A plain build runs entirely locally: LanceDB vector
  index, embedded Ladybug (graph), SQLite (relational), local file storage.
  The brute-force vector index is used on Android or with `VECTOR_DB_URL=:memory:`.
* **Feature gates.** `pgvector`, `pggraph`/`postgres`, and the
  `hf-tokenizer`/`tiktoken` counters are cargo features, on by default in
  `cognee-lib`/`cognee-cli` — see
  [Architecture: feature strategy](/rust/architecture#architecture-patterns).
* **Closed-source companions.** Embedded Qdrant (`cognee-vector-qdrant`) and
  on-device LiteRT inference (`cognee-llm-litert`, Android) live in the closed
  `cognee-cloud-rs` repository and are not part of OSS.
* **Full Postgres stack** (relational + graph + vector on one Postgres) is the
  one remaining adapter milestone — see [roadmap/](https://github.com/topoteretes/cognee-rs/blob/main/docs/roadmap/README.md).

`MockEmbeddingEngine`, `MockGraphDB`, `MockVectorDB`, and `MockStorage` (the
`testing` feature) back the test suite — see
[test patterns](https://github.com/topoteretes/cognee-rs/blob/main/.claude/CLAUDE.md#test-patterns).
