OpenViking
volcengine
Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:melandlabs/opencontext
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
The agentic context runtime, powering applications that act on your behalf.
A temporal context graph, a memory API, retrieval primitives, and a multi-platform integration mesh — designed to be embedded into any host process or agents.
⭐ If you find opencontext useful, please consider giving us a star on GitHub! It helps more people discover the project and motivates us to keep building. 🙏
OpenContext is the agentic context runtime that sits underneath an agentic application — and the substrate you build your own agent on top of. It is not a UI, a chat surface, or a model provider — it is the glue between the things that make an agent useful: durable memory, retrieval, context correction, multi-platform connectivity, scheduled awareness, and a deterministic loop engine, all behind one dependency.
→ Read docs/architecture.md for the full
data model, the lifecycle of a fact, and the transport surface map.
OpenContext fits teams who need to engineer their context — that is, teams whose day-to-day work runs straight into the problems OpenContext was built to solve. Each bullet spells out the pain and how OpenContext addresses it:
valid_from / valid_until, so "what did we believe last quarter?" is a real, citable query — not a guess.IntegrationRecord hides credentials, rate-limits, and reconnect logic, while platform + messageId is the natural audit trail for personal and work data.packages/loop ships exactly that separation.| Capability | What it does | |
|---|---|---|
| 🧠 | Temporal Context Graph | A directed acyclic graph where every fact has valid_from / valid_until. Supersession, contradiction, and merge are first-class edges — corrections are append-only, not destructive. |
| 🔌 | Platform Integration Mesh | One uniform IntegrationRecord shape across Gmail, Slack, Telegram, Linear, Jira, iMessage, Feishu, Weixin, … — credential rotation, rate-limit handling, and reconnect logic live behind the adapter. |
| ⏰ | Deterministic Loop Engine | A scheduler that wakes up, decides whether there is real work, and only then calls into the agent runtime. LLM calls are not the foundation — they are the last step. |
| 🔍 | Retrieval Primitives | Chunking, embeddings, parsers (PDF/ZIP/text), sqlite-vec + pgvector + Chroma adapters. Mix backends without rewriting the recall pipeline. |
| 🤖 | Agent Runtime | AI SDK wrappers, sandbox providers (native / Claude / Vercel), MCP server, memory-consolidation job, image + audio generation. |
| 🪶 | Library-First API | Install once with pnpm add @melandlabs/opencontext and get the contracts, memory store, retrieval primitives, loop engine, and agent runtime. No React, Next, or Tauri required. |
| 🛡️ | Audit + Encrypted Storage | Structured audit logging to ~/.opencontext/logs/audit.jsonl, Fernet symmetric encryption for secrets, URL allowlist/blocklist for outbound calls. |
Third-party memory and long-context recall benchmarks (numbers current as of 2026-08):
| Benchmark | Score | What it measures |
|---|---|---|
| LongMemEval-S | 97.6% | Long-term memory recall across long sessions |
| LoCoMo-V2 | 97.4% | QA over long multimodal conversations |
| BEAM @ 10M | 67.0% | Factual recall at a 10M-token context window |
There are four ways to get opencontext into your project. Pick the one that matches what you're building.
pnpm add @melandlabs/opencontext
A 30-second example of the memory API:
import { createMemoryStore, getRawMessageManager } from "@melandlabs/opencontext";
// The store defaults to SQLite at MEMORY_STORE_DB_PATH (./memory.db by
// default). Each call returns an awaitable handle.
const store = await createMemoryStore();
const messages = await getRawMessageManager();
// A message is one fact: a single piece of content attributed to a user.
// `messageId` makes the call idempotent across re-ingest.
const now = Date.now();
await messages.storeMessages([
{
messageId: "msg-1",
userId: "u-42",
content: "User prefers dark mode in all tools",
platform: "test",
botId: "bot-1",
timestamp: now,
createdAt: now,
},
]);
// Unified search fans out to memory + insights + knowledge. Sources you
// haven't wired up just emit a warning — fine for a single-backend deploy.
const hits = await store.search({
userId: "u-42",
query: "What does the user prefer?",
limit: 5,
});
// hits.count — number of results
// hits.sources — which sub-indexes were actually consulted
// hits.warnings — per-source degradation (e.g. missing embedder)
git clone https://github.com/melandlabs/opencontext.git
cd opencontext
pnpm install
pnpm -r build
# After `pnpm add -g @melandlabs/opencontext`, the bin is on PATH:
opencontext http \
--embedding-provider local \
--memory-backend sqlite-vec \
--host 127.0.0.1 --port 7421
# Or, without a global install, via npx:
npx -y @melandlabs/opencontext http \
--embedding-provider local --memory-backend sqlite-vec
curl http://127.0.0.1:7421/health
opencontext mcp \
--embedding-provider local \
--memory-backend sqlite-vec
OpenContext is available as a DSH plugin that gives any DSH agent durable memory and retrieval-augmented context:
# Install the plugin from npm
dsh plugin --profile web add dsh-opencontext
# Confirm it's mounted
dsh --profile web --dump-config | grep dsh-opencontext
# ... should contain `id: dsh-opencontext`
# Start DSH web and verify
dsh web
# Visit http://127.0.0.1:3080/plugins and confirm dsh-opencontext shows "Enabled"
The plugin exposes 16 oc_* tools (e.g., oc_search, oc_remember, oc_memory_list) and automatically:
See plugins/dsh-opencontext/README.md for configuration options and the full tool reference.
opencontext doctor # human-readable health checks
opencontext doctor --json # CI-friendly { ok, exit, results } envelope
opencontext doctor --section memory-store
doctor is read-only and exits 0 on a healthy install. It scans nine
sections (runtime, filesystem, loop, memory-store, embedding,
policies, audit, security, integrations) and reports pass /
warn / fail for each. No auto-fix in v1.
Next: Tutorials — get started, user guide, developer guide, advanced patterns, and best practices
The examples/ workspace ships a runnable example per
capability area. Clone, install, and run:
git clone https://github.com/melandlabs/opencontext.git
cd opencontext/examples
pnpm install
pnpm test
See examples/README.md for the full walkthrough.
OpenContext is not a memory library and not a vector DB. It is a
runtime substrate — the @melandlabs/opencontext package bundles
contracts, memory-store, retrieval primitives, the loop engine, and
the agent runtime behind one dependency.
| Compared with… | opencontext adds |
|---|---|
| A flat vector DB (Pinecone, Weaviate, Qdrant) | A temporal graph — facts have valid_from / valid_until and get superseded, not just similarity-matched |
| A context/memory library | A runtime, not a library — HTTP daemon, MCP server, CLI, plus the integrations mesh and the loop engine |
| Wiring your own agent loop | A separable Loop engine that schedules when to wake the agent, instead of an LLM loop all the way down |
| Embedding opencontext just to get its integrations | Single-package install — one pnpm add gets every capability, no React/Next/Tauri required to use |
┌────────────────────────────┐
│ Host application │ ← your UI, CLI, or daemon
│ (a reference app, │
│ or your own embedder) │
└─────────────┬──────────────┘
│
┌────────────────────────┴────────────────────────┐
│ @melandlabs/opencontext │
│ contracts · memory · rag · loop · agent │
└────────────────────────┬────────────────────────┘
│
┌─────────────────────────────┴─────────────────────────────┐
│ Storage backends │
│ sqlite-vec · postgres · indexeddb · chroma · pgvector │
└─────────────────────────────┬─────────────────────────────┘
│
┌─────────────────────────────┴─────────────────────────────┐
│ Integrations mesh (gmail, slack, …) │
└───────────────────────────────────────────────────────────┘
Full data-flow diagrams, transport surfaces, and storage backends are
in docs/architecture.md.
docs/tutorials/README.md — Tutorial index and learning pathdocs/tutorials/00-getting-started.md — Get up and running in 5 minutesdocs/tutorials/01-user-guide.md — Understand the four verbs and temporal memorydocs/tutorials/02-developer-guide.md — Integrate OpenContext into your appdocs/tutorials/03-advanced-usage.md — Production patterns and advanced featuresdocs/tutorials/04-best-practices.md — Tips and common pitfallsdocs/tutorials/use-cases/README.md — Real-world use cases: personal assistant, support agent, research trackerdocs/architecture.md — data model, lifecycle, data plane and control planedocs/philosophy.md — why this shapeREADME.md — API surface, examples, migration notesSee CONTRIBUTING.md.
Apache-2.0. © 2026 Meland Labs.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: context、memory。