本地优先的 AI 知识工作台,支持文档问答、长期记忆、可选联网搜索和可持续的会话工作流。
这个项目的当前边界很明确:
Chroma负责静态文档证据与本地检索OpenViking负责长期记忆、回答时上下文和可持久化记忆能力- 主应用现在分层落在
app/core/、app/memory/、app/retrieval/
- 流式聊天
- 多轮对话与会话恢复
.txt/.md文档上传、删除和本地索引- 本地优先的文档问答
- 文档概览 / 简介 / 摘要问答
- 证据不足时返回关联证据,而不是直接空拒答
- 长期记忆的提取、审批、回滚、编辑和删除
- 记忆中心可视化查看
- 可选联网搜索开关
- 独立的知识库页、记忆页和设置 / 支持浮层
app/core/: API 入口、RAG、路由、工作流、文档与系统状态app/memory/: 长期记忆、提取、审批、回滚、复用app/retrieval/: chunk 检索、父子片段选择、后端封装、重排app/frontend/: 聊天、知识库、记忆页和前端浮层面板data/docs/: 正式业务文档data/state/: 会话、文档注册表、循环状态、记忆状态等持久化状态data/backups/: 备份产物data/chroma/: 本地向量索引data/openviking_workspace/: OpenViking 工作区
- 文档检索只走
Chroma - 长期记忆只走
OpenViking conversation_threads.json只是对话回放和用户可见状态,不是主推理存储- 关闭联网开关时,本地检索和记忆仍然可用,但不会自动升级到联网
安装依赖:
.\.venv\Scripts\python.exe -m pip install -r requirements.txt构建或重建本地索引:
.\.venv\Scripts\python.exe -m app.core.rag index启动 API 服务:
.\.venv\Scripts\python.exe -m app.core.main打开页面:
Chat: http://127.0.0.1:8001/
Library: http://127.0.0.1:8001/library
Memory: http://127.0.0.1:8001/memory
如果你要使用联网搜索或 OpenAI 兼容模型,需要先配置对应环境变量。项目当前支持 OpenAI-compatible 的 chat 和 embedding provider。
OpenViking 不是基础文档问答的必需项,但它是长期记忆和回答时上下文体验的核心依赖。
- 文档上传与删除
- 本地索引重建
- Chroma 文档检索
- 基础聊天 / 知识库页面
- 长期记忆同步与复用
- 回答时记忆上下文组装
- 记忆中心里的长期偏好与稳定事实
.\.venv\Scripts\openviking-server.exe --config %USERPROFILE%\.openviking\ov.conf
.\.venv\Scripts\ov.exe healthGET /healthGET /conversationsPOST /conversationsGET /conversations/{conversation_id}DELETE /conversations/{conversation_id}GET /documentsPOST /documents/uploadDELETE /documents?source=...POST /askPOST /ask/streamGET /memoriesPOST /memories/extractPOST /memories/{memory_id}/approvePOST /memories/{memory_id}/rollbackPATCH /memories/{memory_id}DELETE /memories/{memory_id}GET /ops/statePOST /ops/rebuild-index
.\.venv\Scripts\python.exe -m unittest discover -s tests
.\.venv\Scripts\python.exe scripts\run_regression_eval.py- 代码已经按
core / memory / retrieval / frontend分层 - 前端已经有 Chat / Knowledge Base / Memory 三页和设置 / 支持浮层
- 文档简介类问法会优先走
local_doc_summary - 证据不足时会优先展示最相关片段,而不是直接空拒答
Open English version
A local-first AI knowledge workspace for document Q&A, durable memory, optional web search, and ongoing multi-turn conversations.
The current boundary is intentionally clear:
Chromahandles static document evidence and local retrievalOpenVikinghandles durable memory, answer-time context, and persisted remembered state- The main app now lives under
app/core/,app/memory/, andapp/retrieval/
- Streaming chat
- Multi-turn conversations with thread restore
- Upload and delete
.txt/.mddocuments - Local-first document Q&A
- Document overview / intro / summary questions
- Show related evidence when the evidence is incomplete
- Long-term memory extraction, approval, rollback, editing, and deletion
- A memory center for browsing stored memory
- Optional web search toggle
- Separate Chat, Knowledge Base, Memory, Settings, and Support surfaces
app/core/: API entrypoints, RAG, routing, workflow, document, and system state logicapp/memory/: long-term memory, extraction, approval, rollback, and reuseapp/retrieval/: chunk retrieval, parent selection, backend seam, rerankingapp/frontend/: chat, knowledge base, memory pages, and floating panelsdata/docs/: canonical project documentsdata/state/: persistent conversation, registry, loop state, and memory statedata/backups/: backup artifactsdata/chroma/: local vector indexdata/openviking_workspace/: OpenViking workspace
- Document retrieval is handled by
Chroma - Durable memory is handled by
OpenViking conversation_threads.jsonis user-facing replay state, not the primary reasoning store- When web search is disabled, local retrieval and memory still work, but the system will not auto-upgrade to web
Install dependencies:
.\.venv\Scripts\python.exe -m pip install -r requirements.txtBuild or rebuild the local index:
.\.venv\Scripts\python.exe -m app.core.rag indexStart the API server:
.\.venv\Scripts\python.exe -m app.core.mainOpen the pages:
Chat: http://127.0.0.1:8001/
Library: http://127.0.0.1:8001/library
Memory: http://127.0.0.1:8001/memory
If you want web search or OpenAI-compatible providers, configure the corresponding environment variables first.
OpenViking is not required for the basic document-Q&A workflow, but it is required for the full durable-memory experience.
- document upload and delete
- local index rebuild
- Chroma-backed document retrieval
- basic chat and library pages
- durable memory synchronization and reuse
- answer-time memory context assembly
- long-term preferences and stable facts in the memory center
.\.venv\Scripts\openviking-server.exe --config %USERPROFILE%\.openviking\ov.conf
.\.venv\Scripts\ov.exe healthGET /healthGET /conversationsPOST /conversationsGET /conversations/{conversation_id}DELETE /conversations/{conversation_id}GET /documentsPOST /documents/uploadDELETE /documents?source=...POST /askPOST /ask/streamGET /memoriesPOST /memories/extractPOST /memories/{memory_id}/approvePOST /memories/{memory_id}/rollbackPATCH /memories/{memory_id}DELETE /memories/{memory_id}GET /ops/statePOST /ops/rebuild-index
.\.venv\Scripts\python.exe -m unittest discover -s tests
.\.venv\Scripts\python.exe scripts\run_regression_eval.py- The codebase is now split into
core / memory / retrieval / frontend - The frontend includes Chat / Knowledge Base / Memory pages plus Settings / Support overlays
- Document-intro questions now route to
local_doc_summary - When evidence is incomplete, the app shows the most relevant snippets instead of returning a hard refusal immediately