# Repository Briefing: deeplethe/utopia
> Source: https://repoforai.com/repo/deeplethe/utopia (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/deeplethe/utopia
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Rust
- **License**: Apache-2.0
- **Engineering Health**: A (87/100 · Maintenance 35/35 · Adoption 21/25 · Releases 11/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, API
- **Momentum**: 8,980 ★ total (+36 24h / +210 7d) · 1,241 forks
- **Topics**: `agent-memory`, `bitemporal`, `graphrag`, `knowledge-base`, `knowledge-graph`, `llm`, `ontology`, `pgvector`, `postgresql`, `rag`, `rust`, `self-hosted`
- **When to Use**: Best for: Legal, procurement, and governance teams piloting a self-hosted knowledge base that must show what applied on a date, what was known then, and which source supports the answer. Skip if: You only need current-document search and citations, cannot staff review of extracted facts, or require a stable schema with rollback migrations.

## Overview
```text
### Architecture & Core Mechanics
Utopia is a self-hosted end-user application with a web console, graph browser, and ontology workbench. The Rust workspace separates the server and CLI from core types, storage, ingestion, extraction, reasoning, search, and model integration. The backend uses Tokio, Axum 0.8 with multipart support, and SQLx 0.8. The core deployment is one Rust binary and one PostgreSQL instance: pgvector handles vectors, Tantivy runs full-text search inside the application, and jobs are queued in a database table.

Uploads, scheduled connectors, and API submissions feed ingestion and extraction. The graph records both when a fact was valid and when the system learned it, with source evidence for later review. Document search fuses lexical and vector rankings through reciprocal rank fusion (RRF). The built-in agent can combine document retrieval, temporal graph reads, and queries against mounted databases. The same read-only tools are available through per-knowledge-base MCP; proposed knowledge writes go through human review.

### Key Capabilities & Differentiators
Ingestion covers PDF, Office and OpenDocument spreadsheets, CSV/TSV, Markdown, HTML, and plain text, with legacy encoding detection. Scheduled connectors include web pages, RSS, GitHub, Jira, Notion, WebDAV, and S3-compatible buckets. Scans and images can use MinerU or Volcengine Ark vision, while recordings use a transcription model that labels speakers. Chat streams citations that open the supporting passages. Chat and embedding configuration uses OpenAI-compatible endpoints, including DeepSeek, Qwen, GLM, Ollama, and vLLM.

The differentiator is temporal querying, not simply retrieving a passage about a past event. A contract amendment can close the old term's validity interval without erasing it, so a user can ask what applied on a specific date and inspect the underlying sentence. A separate knowledge-time query can establish what the system had recorded at a given point. Five bundled ontology packs bootstrap a new knowledge base; uncertain cases go to human review rather than being resolved solely by model output.

### Trade-offs & Limitations
Compared with a conventional PostgreSQL/pgvector RAG app, Utopia adds structured, dated facts and a review workflow to passage retrieval. That matters when an answer must distinguish when a policy took effect from when the organization learned about it. For a current-document FAQ, those extra layers can add more work than value. A bespoke graph-and-search stack gives a team more control over its component choices, but the team must integrate ingestion, temporal semantics, evidence, and agent access itself.

Embedding full-text search and putting the queue in PostgreSQL reduces the number of services to operate, but ingestion jobs and interactive requests still compete for application and database resources. Test them together at representative volumes. Temporal answers also depend on source dates, extraction quality, and the team's capacity to review ambiguous facts. Release-candidate maturity and forward-only migrations are reasons to rehearse backup and restore before using the system for audit-sensitive records.

### Hardware & Deployment Guide
For a pilot, run `docker compose --profile app up -d` and open `http://localhost:1516`. The bundled database defaults to `pgvector/pgvector:pg16`. Recent prebuilt images target Linux amd64 and arm64; tags through 0.1.0-rc7 are amd64-only. Local development requires Rust 1.85+, Node 20+, and pnpm. `cargo run -p utopia-server` starts the backend and runs migrations; the frontend dev server listens on 5173 and proxies `/api` to the backend. Configure chat and embedding endpoints before extracting documents.

Before exposing the service, control initial registration, review the automatically created public knowledge base, replace the default database password, and configure the restricted application database role; without it the app runs as the owner. Offline operation requires locally reachable model services and no dependency on external connectors or optional media endpoints. At v0.1, migrations are forward-only: pin `UTOPIA_IMAGE` and back up PostgreSQL and `data` before upgrades. The rc8 milestone refined extraction of document dates and how those dates support facts; rc9 fixed vector-index setup under the restricted role and kept chat memory working when an embedding model failed.
```

## Key Capabilities
```text
- Temporal queries: Distinguish when a fact held from when the knowledge base learned it.
- Evidence: Link extracted facts to source material and stream answers with citations that open the supporting passages.
- Hybrid retrieval: Fuse Tantivy full-text and pgvector rankings with reciprocal rank fusion (RRF).
- Agent access: Expose read-only tools over per-knowledge-base MCP with scoped tokens; route proposed writes to human review.
- Ontology cold start: Choose from five bundled packs—schema.org, W3C Org, PROV-O, FOAF, and IOF Core.
- Runtime footprint: One Rust binary and PostgreSQL for the core stack, with embedded full-text search and a database-backed job queue.
```

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