# Utopia

> A bitemporal knowledge graph that records not just what is true, but when you came to believe it

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: Rust
- Licence: Apache-2.0
- Repository: https://github.com/deeplethe/utopia
- Website: https://utopia.bi
- Canonical page: https://ai-tldr.dev/tools/utopia/

## In short

Utopia is an open-source enterprise knowledge platform from DeepLethe, built as one Rust binary plus one PostgreSQL database. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Rust and licensed Apache-2.0. To get started: start from the prebuilt image.

## Overview

Utopia is an open-source enterprise knowledge platform from DeepLethe, built as one Rust binary plus one PostgreSQL database. Where a vector store or a plain knowledge graph works to hold present knowledge, Utopia puts time awareness and ontology in the base layer: the knowledge system evolves as material arrives, and conflict detection, reasoning and decision-making all run against that ontology. It deploys offline, so an organisation can stand up a knowledge foundation and an audit trail on hardware it controls.

The defining design choice is the bitemporal graph. Extraction turns documents into entities and facts following an ontology you can edit, and every fact carries both when it held in the world and where it came from. Correcting a fact closes the old version and links the new one to it rather than overwriting, so the graph keeps two timelines at once — when something was true, and when the system came to believe it. When a decision is reviewed later, the system can reproduce the course it took and the grounds it rested on. Edges are reified, so an edge can carry attributes of its own.

Around that core it ships a complete application rather than a library: a system console, a graph browser and an ontology workbench in one web UI. Ingest covers PDF, DOCX, PPTX, XLSX, CSV, Markdown, HTML and plain text, with scheduled syncing from web pages, RSS, GitHub, Jira, Notion, WebDAV and S3-compatible buckets. Search fuses Tantivy full-text with pgvector embeddings using RRF, and answers stream with inline citations that open the passage they came from. Any OpenAI-compatible endpoint works, so the whole system can run air-gapped. The project is at v0.1 and its schema evolves between versions with forward-only migrations, so pin a release and back up before upgrading.

## What it does

- Bitemporal knowledge graph: every fact records when it held and when the system believed it, and corrections link to the version they replace instead of overwriting it
- Editable ontology with five packs bundled in the binary (schema.org, W3C Org, PROV-O, FOAF, IOF Core); unrecognised terms are counted and can be promoted into the ontology
- Hybrid retrieval — Tantivy full-text and pgvector embeddings fused with RRF — with streamed answers carrying inline citations back to the source passage
- Entity resolution in three stages (exact name or alias, embedding similarity, then a model's call on doubtful pairs), every merge undoable, uncertain cases queued for human review
- Conflict detection across new-versus-old facts and axiom violations, each with an explicit set of resolutions, plus optional forward-chaining derivation that marks derived facts as such
- An MCP server per knowledge base with fine-grained permissions, so Claude Desktop, Cursor and other agent clients can query it as read-only tools
- Ontology-driven querying over a mounted Postgres, MySQL, Trino, Databricks or Snowflake database alongside the documents
- Append-only decision ledger recording who changed what and when, with records outliving the objects they describe

## Getting started

Utopia runs from a prebuilt container image with Docker Compose. You need Docker; local development additionally needs Rust 1.85+, Node 20+ and pnpm.

1. Start from the prebuilt image

   Clone the repository and bring the app profile up. This starts the Rust server and its PostgreSQL database.

```bash
git clone https://github.com/deeplethe/utopia.git
cd utopia
docker compose --profile app up -d
```

2. Register and configure models

   Open http://localhost:1516 and register. The first account automatically becomes the system administrator, and a public knowledge base readable by everyone is created at the same time. Before extracting business documents, set your chat and embedding endpoints under Administration → Models — any OpenAI-compatible endpoint works, including DeepSeek, Qwen, GLM, Ollama and vLLM.

3. Know where the database password comes from

   `UTOPIA_DB_PASSWORD` in `.env` (default `utopia`) is applied when the data volume is first initialised. Changing it later means changing it in the database too, or starting over — and starting over deletes all data.

```bash
docker compose exec db psql -U utopia -c "ALTER USER utopia PASSWORD '<new password>'"
```

4. Or build from source

   Layer the build compose file over the base one to build the image locally instead of pulling it.

```bash
docker compose -f docker-compose.yml -f docker-compose.build.yml --profile app up -d --build
```

5. Run it for local development

   Bring up only the database, run the server (which applies migrations on startup) on port 1516, and start the frontend on 5173 with /api proxied to the backend.

```bash
# 1. Postgres with pgvector
docker compose up -d db

# 2. Backend on :1516, runs migrations on startup
cargo run -p utopia-server

# 3. Frontend on :5173, proxying /api to the backend
cd web && pnpm install && pnpm dev
```

## When to use it

- Build a company knowledge base where every extracted fact keeps its source and the date it was believed, for later audit
- Answer questions across documents and a mounted SQL warehouse at once, with the agent proposing how tables map onto your ontology
- Give agents a governed, read-only view of institutional knowledge over MCP instead of a raw vector store
- Run knowledge retrieval air-gapped, pointing chat and embeddings at a local vLLM or Ollama endpoint
