utopia README

The project's README from github.com/deeplethe/utopia. As one markdown file: README.md.

Utopia

Utopia

Philosophy · Quick start · Features · Roadmap

Stars License Rust

Official site Container Discussions Built by DeepLethe 中文

The enterprise world model built by DeepLethe. It is the first open substrate for knowledge engineering that learns passively and governs itself. Where a knowledge graph or a vector store 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 a company can stand up a knowledge foundation, a decision core its agents can trust, and a compliance audit trail on hardware it controls.

Please note: we would rather this project were not framed as an open-source take on Palantir. It is a different route to enterprise intelligence, built bottom up from knowledge governance to trustworthy decisions and simulation.


https://github.com/user-attachments/assets/aa226443-75de-437e-bd80-88e592ed8457


Philosophy

We gave it a somewhat romantic name, Utopia. Ptolemy's geocentric model was taken for truth for a very long time, then falsified step by step by Copernicus, Kepler, Galileo and Newton. Looking back, what we keep is not only that heliocentrism turned out to be right; it is how that history unfolded.

Where existing vector stores and knowledge graphs work to get present knowledge right, one of Utopia's founding aims is to record the whole course of changing understanding. Engineered, that becomes a bitemporal knowledge graph. When a decision is reviewed later, the system can produce the full course it took and the grounds it rested on. To make this hold up in practice we have iterated at length against public corpora spanning enterprise records, education, finance, law and research. Temporality is only one facet; for how knowledge is taken in, how the future is reasoned about, and how logic bounds action, see utopia.bi/philosophy.

Features

One Rust binary and one Postgres. Full-text search is embedded in the binary, vectors go in pgvector, and the job queue is a table: nothing else to run.

A complete application A system console, a graph browser and an ontology workbench in one web UI. A product, not a library: install it and it works.
Knowledge ingest Upload PDF, DOCX, PPTX, XLSX, XLS, ODS, CSV, TSV, Markdown, HTML or plain text, with legacy encodings detected on the way in. Web pages, RSS, GitHub, Jira, Notion, WebDAV and S3-compatible buckets sync on a schedule; everything else comes in through the API.
Search and chat Full-text on Tantivy, vectors on pgvector, fused with RRF. Answers stream with inline citations that open the passage they came from. Any OpenAI-compatible endpoint works (DeepSeek, Qwen, GLM, Ollama, vLLM), so the whole system can run air-gapped.
Agent harness and agentic RAG The whole system can be driven through conversation. The built-in agent searches documents, walks the graph (an entity's facts as of any date, or what changed in a period) and queries a mounted database. The same read-only tools are exposed over MCP.
Ontology and cold start A new knowledge base has no vocabulary of its own; it starts from the packs you pick at creation. Five ship inside the binary: schema.org, W3C Org, PROV-O, FOAF and IOF Core (ask for your industry). Terms outside the packs are counted as they appear; confirm the common ones and they join the ontology.
Bitemporal graph Extraction turns documents into entities and facts, following an ontology you can edit. Every fact carries when it held 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: when something was true in the world, and when the system came to believe it.
Entity resolution and review Duplicates are resolved in three stages: exact name or alias, embedding similarity, then a model's call on the doubtful pairs. Every merge can be undone. Uncertain cases go to a review queue: low-confidence extractions, suspected duplicates and cardinality conflicts.
Reasoning and derivation Ontology axioms compile into rules: transitivity, symmetry, inverses and relation hierarchy derive new facts by forward chaining. Derivation is off by default, since a wrong axiom derives wrong facts. A derived fact is marked as such on the graph, carries validity and confidence like any other, and shows what it was derived from. When it contradicts an asserted fact, the asserted one stands.
Conflict detection Three kinds of conflict, three sets of choices. A new fact that clashes with an older one: close the old, keep both, or reject the new. Data that breaks an axiom (self-loop, asymmetry, transitive cycle, cardinality): retract the fact, relax the axiom, or accept both. The ontology itself is checked first, because violations of a self-contradictory ontology are noise.
Ontology-driven querying Mount a database on a base (Postgres, MySQL and the engines that speak its protocol, Trino for Iceberg / Delta Lake / Hive, Databricks, Snowflake) and chat can query it alongside the documents. The agent proposes how its tables map onto the ontology, and you confirm. The method behind it, Ontology2SQL, is state of the art on BIRD Mini-Dev for SQLite and PostgreSQL (submission).
Multi-user and permissions Each knowledge base has its own members and roles: owner, admin, editor and viewer. Open bases are readable by everyone in the deployment, restricted ones only by invitation. The first account registered becomes the system administrator.
Decision ledger Confirming or rejecting a fact, merging or reverting an entity, rebuilding the graph: each leaves a record of who, when, and what the object looked like at the time. The ledger is append-only, and a record outlives its object, even the base it belonged to.
Decision intelligence (in development) Record a decision, replay both what was understood and the course it took, and reason over overlaid scenarios.

Quick start

Requirements: Docker (local development also needs Rust 1.85+, Node 20+, pnpm).

Start from the prebuilt image:

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

Open http://localhost:1516 and register. The first account automatically becomes the administrator, and a public knowledge base readable by everyone is created at the same time. Before extracting business documents, configure the model endpoints (chat and embedding) under Administration → Models.

The database password (UTOPIA_DB_PASSWORD in .env, default utopia) is applied when the data volume is first initialised. To change it on a running deployment, change it in the database as well — docker compose exec db psql -U utopia -c "ALTER USER utopia PASSWORD '<new password>'" — or start over with docker compose --profile app down -v, which deletes all data.

Or build from source:

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

Local development

# 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

Roadmap

Status

Utopia is still at v0.1. The database schema evolves between versions and migrations only roll forward, with no rollback. Pin a specific version with UTOPIA_IMAGE in production, and back up the database along with the data directory before upgrading.

Please read SECURITY.md before exposing it to the public internet.

Star History

Star History

Community

License

Apache-2.0

utopia (deeplethe/utopia)

Searching Database…

8.4K ·GitHub
这是什么?Utopia 是 DeepLethe 推出的开源企业世界模型:一套可自行部署的知识系统,能把文档转化为一个双时态知识图谱,你可以对它进行搜索、对话和推理,而且完全运行在你自己掌控的硬件上。
它是接入我代码里的库,还是需要部署的产品?是一个完整的产品,而不是库:一个 Rust 二进制文件加一个 Postgres,网页界面里内置了系统控制台、图谱浏览器和本体工作台。装好就能用。
我怎么把它跑起来?用 docker compose 运行预构建的 Docker 镜像,打开网页界面并注册——第一个注册的账号会成为管理员,同时会自动创建一个公开知识库。在导入业务文档之前,请先在 Administration → Models 里设置好对话和嵌入模型的服务端点。
除了 Docker 我还需要什么?部署只需要 Docker;本地开发还需要 Rust 1.85+、Node 20+ 和 pnpm。对话和嵌入功能可以指向任何 OpenAI 兼容的服务端点——DeepSeek、Qwen、GLM、Ollama 和 vLLM 都能用——所以不依赖任何单一的 AI 厂商。
它现在能直接用在生产环境吗?还不能完全放心——目前是 v0.1 版本:数据库迁移只能向前执行,无法回滚,所以在生产环境里请固定镜像版本,升级前先备份数据;如果要暴露到公网,请先阅读 SECURITY.md。
它能完全离线运行在我自己的硬件上吗?可以。它支持离线部署,并且兼容任何 OpenAI 兼容的服务端点,所以整套系统连同大语言模型都可以物理隔离地运行在你自己掌控的硬件上——搜索、向量和任务队列全部包含在那一个二进制文件加 Postgres 里。
我可以往里面导入什么?可以上传 PDF、DOCX、PPTX、XLSX、CSV、Markdown、HTML 或纯文本文件,导入时会自动识别旧式编码。网页、RSS、GitHub、Jira、Notion、WebDAV 和 S3 存储桶可以按计划定时同步,其他内容则通过 API 导入。
AI 智能体能配合它使用吗,还是说它只有一个网页界面?整个系统都可以通过对话来操作:内置的智能体能搜索文档、遍历图谱——包括查看某个实体在任意日期时的事实状态——还能查询已挂载的数据库。这些只读工具同样通过 MCP 对外开放,外部智能体也能接入。
它也能查询我的数据库,而不只是文档吗?可以——挂载 Postgres、MySQL、Trino(用于 Iceberg、Delta Lake 和 Hive)、Databricks 或 Snowflake 之后,对话就能在查询文档的同时查询这些数据库。智能体会先提出数据表如何映射到本体的方案,由你确认;这个方法叫 Ontology2SQL,在 BIRD Mini-Dev 基准的 SQLite 和 PostgreSQL 项目上处于业界领先水平。
如果新事实和旧事实相矛盾,会发生什么?由你针对每个冲突自行选择:关闭旧事实、两者都保留,或者拒绝新事实。对于违反本体公理的数据,可以选择撤回数据、放宽公理,或者两者都接受——而且本体本身会先接受检查,因为一个自相矛盾的本体所产生的违规结果只是噪音。
Creator
deeplethe
Size
12.3 MB
Stars
8.4K
Updated
CommitOct 11
Age
2mo
Commits · 90 Days