Skip to content
Proyek

Tentang

Source-grounded MCP memory runtime and Obsidian-compatible vault template for LLM agents.

AI dan pembelajaran mesin

Cara angka ini diukur

158 bintang18 Fork +52 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+52
dalam 7 hari
+83
dalam 15 hari
+82
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

English · 한국어

osk-system — Let your sessions grow into knowledge.

Let your sessions grow into knowledge.
A local Markdown memory where your conversations with agents grow into sourced, connected knowledge that comes back to work in the next session.

Python Model Context Protocol Markdown Obsidian Git

Latest release MIT license Data stored in local files

Quick start · Getting started · Operating guide · How it grows · Benchmarks · Setup guide (KO) · Design & governance


Status: developer public beta. The maintainer uses it daily on Windows 11. CI runs the test suite on Windows and Linux, and on macOS as a non-blocking job; daily use on macOS is not yet verified. Your vault is a Git repository: keep it pushed to your own private remote, or otherwise backed up, before every update. See the known limitations.

Set it up with your agent. Paste this line into Claude Code, Codex, Kiro or Antigravity:

Read https://raw.githubusercontent.com/lpaiu-cs/osk-system/main/docs/INSTALL-AGENT.md and install osk-system on this device.

Why it exists

It began as a one-line request: build me an LLM wiki. What came back was an inconsistent storage scheme, blobs of unneeded information, and a structure people could not comfortably read. Left alone, a memory like that drifts into a plausible-sounding graph with no evidence behind it.

So osk-system started with a constitution. What to keep as memory, how to merge or connect it with what is already there, and when to split a topic that has grown: these choices are written down as rules, and the engine and the agents grow the memory by them. The aim is not a wiki that only looks impressive, but a working space that people can read and actually use. Not an archive where records pile up without end, but a place where experience grows into knowledge for the next decision.

The constitution defines the system in its first sentence:

osk-system sustains the memory that belongs to its user, with its sources, context, relations and authority, and puts it back to work for later understanding, judgment, audit and work.

A real osk-system vault in Obsidian: connected clusters of green and purple knowledge nodes
A real vault that has grown, in Obsidian. Fresh instances start with empty knowledge Spaces. Click to view full size.

What you need How osk-system does it
Context that carries into the next conversation Each session starts with the project's shared memory and an adaptive knowledge map (MOC); the agent searches and reads nodes as needed
Knowledge that grows instead of scattering The same claim updates its existing node; new knowledge grows by connecting to what is already there
Recall you can trace From a node to its source nodes and to specific conversation rounds, via lexical BM25 or opt-in local hybrid semantic search
Memory people can read and edit Local Markdown files, an Obsidian graph, and optional Git synchronization

How knowledge grows

Conversations become knowledge in a loop of five steps. On a host whose hooks are connected (Claude Code, Codex, Kiro, Antigravity), the loop runs within your sessions: capture is mechanical, and the agent reviews and distills when the hooks prompt it.

  1. Capture. The hooks track each finished turn of the conversation on your device, as a reference into the harness's own transcript and a hash. The conversation stays in that transcript; nothing is copied into the vault.
  2. Review and distill. At turns 9 and 15 (or, with a subscription fork, in the background after every 9 final answers), the agent reviews the new turns, which it holds in context, together with the shared memory and distills what will last into nodes. It cites only the turns a node needs as evidence: the engine copies your words from the transcript into _cited/, and the node's # 관측 (observation) section points to that round. A conversation that ends before its review is picked up later by the batch growth run, which reads only its unreviewed turns from the transcript on this device.
  3. Connect and organize. A node about the same claim is updated, not duplicated. New nodes stand first; a hub covering the topic links them afterwards and splits into branches as the topic grows. Knowledge used beyond one project is distilled again into Domain (by a scheduled run or on request).
  4. Recall. When the next session starts, the project's shared memory (scope memory) and an adaptive knowledge map (MOC) are loaded into context, and the agent searches (lexical BM25, or hybrid with opt-in local bge-m3 vectors) and reads nodes and their evidence.
  5. Recheck. When evidence changes, the nodes that cite it become recheck candidates, and the effect spreads along the citations.

A node is a function of its future reuse. Keep as a node what will serve later searches, decisions and work more than once; leave out one-off work state and anything cheap to recompute. And all knowledge starts at the periphery and grows toward the center through connection and consilience — different observations explained together by one hypothesis: center and periphery are one continuous spectrum, not layers.

Three Spaces

Each node belongs to one of three Spaces, by where it mainly applies.

Space What it holds
Scope Memory formed within a project or activity. The conversation rounds its nodes cite live in the root _cited/ compartment, outside every Space
Domain Knowledge reused across contexts, not tied to one project
Person The user model: records the user leaves, understanding about the user, and delegation. An agent's inference about the user is not taken as the user's fact without the user's confirmation

The governing documents belong to no Space: the rules that define the system are not knowledge the system organizes.

Your memory, your authority

  • The memory belongs to you. Agents run it under your authority. A delegation that outlasts a session holds only once you approve a delegation node stating its subject, scope and conditions; when its scope is unclear, the agent holds back.
  • Agents are not blocked. They write and revise nodes directly, and every node records who decided its content (author) and who drafted it (drafter). MCP writes pass through node-contract validation.
  • Trust comes from sources, relations and history, not from an approval stamp. You can trust what you can trace.
  • Protected regions make changes reviewable and reversible. In the parts you choose (the governing documents and delegation are always protected), edits still take effect at once. The engine keeps the state you last approved (the approved snapshot), and the difference remains as a changeset for you to approve or revert. Protecting, unprotecting, approving and reverting are yours alone. These records live in ledgers outside the nodes, and records from several devices are judged by causality (a DAG), not by timestamps.
  • The system does not claim to enforce what it cannot. Protected regions undo honest mistakes; they are not a security boundary against someone with arbitrary write access to the vault. Authorization checks hold back when they cannot be evaluated mechanically. See the engine's limitations.

The stack

A Python engine exposes 13 MCP tools over stdio and stores knowledge in plain Markdown files. Retrieval uses character-bigram BM25 (weighted by recency, dependency centrality, and scope locality) by default, with opt-in local hybrid semantic search (osk search-index via local Ollama bge-m3:latest, 1024-dim vectors cached in .osk/search-vectors.sqlite3, RRF fusion with a 0.42 cosine floor and automatic lexical fallback — zero external API calls). Obsidian is an optional way to explore the graph; Git synchronization is opt-in. Capture and periodic-review adapters currently support Codex, Claude Code, Kiro and Antigravity. See the runtime dependencies.

Quick start

Let your agent install it. Paste this line into Claude Code, Codex, Kiro or Antigravity:

Read https://raw.githubusercontent.com/lpaiu-cs/osk-system/main/docs/INSTALL-AGENT.md and install osk-system on this device.

The agent asks where to create the vault and which optional features you want, clones the newest release and runs the setup tool. The setup tool shows you its plan and applies it only after you confirm.

Operate it with your agent, too. Updates, connection checks, optional features and removal go the same way; say what you want:

Read https://raw.githubusercontent.com/lpaiu-cs/osk-system/main/docs/OPERATE-AGENT.md and check osk-system on this device.

New to osk-system? Follow the Getting started tutorial. It goes from an empty folder to your agent's first saved memory, on macOS, Linux and Windows, with a check after every step. To see how OSK finds a customer reply that cites an outdated refund policy, try the decision-change walkthrough.

Updating a v3 vault? Read Upgrading before you apply v4: it lists the placements v4 no longer reads and how to move them.

To install by hand, you need Python 3.11 or newer and Git. Start from a release tag rather than main (newer tags are on the releases page):

git clone --branch v6.2.1 https://github.com/lpaiu-cs/osk-system.git my-osk-vault
cd my-osk-vault
git switch -c main
python _governance/_engine/scripts/setup.py --interactive

Use python3 if python is missing, or py -3.12 on Windows. The setup tool creates .venv, installs the dependencies and records the release baseline, so that later updates can tell release files from your own edits. It then connects the hosts it finds on this device (Claude Code, Codex, Kiro and Antigravity) by registering the MCP server and the three hooks. It shows the plan and asks before it writes. Afterwards, python _governance/_engine/scripts/setup.py doctor checks each connection. Getting started shows the same steps one command at a time.

  • Another MCP client: copy .mcp.json.example and replace <REPO> with the vault's absolute path (on Windows the interpreter is .venv/Scripts/python.exe). The setup guide covers client-specific registration, hooks and Windows commands. The detailed operations and governance documents are currently in Korean.
  • Obsidian: open my-osk-vault as a vault.
  • Sync: before enabling synchronization, point your instance at your own private remote. Do not push personal notes, ledgers, or transcripts to the public upstream repository.

The MCP server alone does not turn on automatic capture or periodic review; the hooks do. The setup tool registers both. If you connect a client by hand, add its hooks too. See harness coverage.

Usage

Obsidian with an osk-system design note, its metadata and linked records on the left, and a local graph on the right
Read a knowledge note alongside its local graph. Original capture from a Korean-language vault; click to view full size.

Recall → inspect the evidence → update the memory. With the hooks connected, capture and recall happen on their own. When you need to, ask your agent:

Find prior decisions about this project. Read the source notes before drawing conclusions.

Record the verified outcome of this task in the project's memory and link its evidence.

In Obsidian, explore connections between clusters in the global graph, then open a note beside its local graph to read the surrounding context. The graph shows connections, not approval status. Use the engine's status command to check protected regions; review their changesets in the human approval workflow.

PYTHONPATH=_governance/_engine .venv/bin/python -m osk.cli status
PYTHONPATH=_governance/_engine .venv/bin/python -m osk.cli search "project decisions"

Harness coverage

Automatic capture and periodic integration currently have adapters for Codex and Claude Code (Grade A), and Kiro and Antigravity (Grade B). KV-cache-preserving background subscription forks are for Codex and Claude Code only. Antigravity runs isolated fresh-session background conversation review via agy CLI in v6.2 (without parent KV-cache inheritance, avoiding active-session context pollution) and falls back to in-session integration at turns 9 and 15 when agy is unavailable or fails version, source-model, or containment checks; it also has a Windows cmd /c path-quoting constraint. Kiro integrates in-session at turns 9 and 15. Being able to call MCP tools from another client does not mean session hooks or autonomous knowledge growth are connected.

Runtime conditions Conversation review path
Supported hooks and subscription CLI; authentication, version, and containment checks pass A background review using the same harness and model after every 9 successful final-answer Stop events (fork on Codex/Claude; isolated fresh session on Antigravity)
CLI unavailable or unconfigured; login, subscription, version, or permission checks fail; Codex task directory is neither a Git worktree nor a trusted Codex project; the last two fork reviews did not finish (the fork is tried again a day later) A review warning and in-session integration at input turns 9 and 15 (UserPromptSubmit; PreInvocation on Antigravity)
Harness without an adapter No guarantee of automatic capture, counting, or fallback; integration and verification are still required

Input counts continue in background mode. Switching paths does not reset pending reviews or either counter; a pending review already past turn 9 is surfaced immediately. When login recovers, or a day after two fork reviews in a row failed to finish, review returns to Stop-based execution. Failed subscription checks do not silently fall back to paid API calls.

Cache evidence, review boundaries, and future harness support

Cache reuse is a separate verification target. A fork immediately after a final answer in the Codex app, using the same Sol model, achieved a 98.74% cache hit rate in one measured experiment. The default CLI configuration on the same source session achieved 0%, so app-originated forks preserve app tool definitions automatically. This is not a universal guarantee across versions or models. Implementation, installation, cache hits, and actual node growth are different claims. See setup and fallback behavior and experimental evidence and limitations.

Updates belong together when they concern the same claim and applicability conditions, not simply the next task in a project. Organization review records the ranges actually read; reading only part of a cluster does not complete the whole cluster's review. See bounded review and safe splitting.

Each additional harness needs verification of conversation and completion IDs, transcript boundaries, hook events, subscription authentication, one-shot execution, and failure fallbacks.

Benchmarks and measured evidence

Reproducible scripts and recorded measurements live in benchmarks/README.md. All figures below are self-measured under stated scope limits:

  • 5-arm comparative memory benchmarks (v1 720 runs + Astra-designed v2 400 runs across two independent worlds up to 1,536 nodes) (benchmarks/compare_memory.py, benchmarks/compare_v2.py, results/compare-v2-20261202.json, Claude Code sonnet-5-5 & Codex gpt-5.6-sol, identical local bge-m3:latest): at 1,536 Multi-Scope nodes with lexical traps, conflicts, and ABSENT controls (no-memory content 0.0% on both hosts), osk-hybrid on Claude reached 30/32 PASS at $0.0691/PASS (2.29M tokens, 369.3 s) — 2.67× cheaper and 63.6% fewer tokens than basic-memory 1.0.0 (28/32, $0.1847/PASS, 6.30M tokens, failed F3 0/2) and 2.62× cheaper than 200-line-capped native (31/32, $0.1810/PASS, 5.82M tokens, 695.5 s); on Codex at 1,536 nodes, osk-bm25 reached 32/32 (100%) with 35.3% fewer tokens than basic-memory (31/32, W1 E4 timeout), while C2 implicit capture exposed MCP write-contract friction on W0 osk-hybrid and skipped writes on Claude MCP arms (tracked in #455; Codex USD unreported).
  • Cross-lingual & paraphrase hybrid search (benchmarks/search_paraphrase.py, results/search-paraphrase-20261202.json): on the 26-node Korean harbor fixture, opt-in local bge-m3 hybrid search lifted cross-lingual English queries from 0/2 (BM25) to 2/2 at rank 1 while keeping all 3/3 unrelated negative controls at 0 hits (warm MCP latency 35–92 ms).
  • Fixed-task surface baseline (benchmarks/task_baseline.py, v6.1 milestones): 20/21 completion across 7 fixed tasks (15/15 write runs cited turns via cite_round; 24/26 on unprompted convention recall, dropping to 0/3 after 30 unrelated prelude turns when the agent stopped calling search).
  • Live-vault shadow recall (benchmarks/recall_shadow.py, 376 Claude Code transcripts, 2,431 nodes): agent-issued searches hit 69.4% within top 8 (60% rank 1, 85% top 3, 97% top 300), vs. 25.0% (30.9% with preceding reply) for raw user utterances on first-used nodes.
  • Index latency (docs/performance-index.md, results/lexical-index-20261203.json, results/index-20260922.csv): at 5,000 / 25,000 synthetic nodes, with the persistent lexical SQLite cache (.osk/search-lexical.sqlite3, #454), steady-state cold search runs in 147.5 / 787.5 ms (14.2× / 14.0× faster, 0 unchanged files parsed, down from 2.09 / 11.02 s), single-node edit search runs in 198.0 / 977.6 ms (1 file parsed), warm search runs in 35.5 / 156.6 ms, warm read_node runs in 16.8 / 74.1 ms, and process RSS drops from 205 / 746 MiB to 88 / 171 MiB (one-time initial build 2.33 / 12.92 s).
  • Not yet measured: external standard benchmarks (LoCoMo, LongMemEval, MemDev-Bench), comparative benchmarks at 5,000+ nodes or against server-DB memory systems (Graphiti, Mem0) on a shared multi-month coding corpus, and long-term autonomous growth impact (issue #19, follow-up to closed #20).

Known limitations

  • Folders outside Git share by name. The session key is the repository folder's name (worktrees fold into their main repository; submodules and bare repositories use their own name). Since v4 an unrelated Git repository whose root commits differ from the key's owner gets <name>-<first 8 hex of its root> instead, so it neither receives nor writes the other's Scope memory. Folders outside Git, repositories without commits and shallow clones have no identity and still share by folder name.
  • Codex and Claude fork reviews inherit the source session's permissions. A subscription fork review runs unattended with the reviewed session's own Claude Code permission mode, or Codex approval and sandbox policy (non-OSK tool calls are blocked by PreToolUse hooks and post-hoc auditing). This is by design. The fork carries that conversation as its context, including any untrusted text it contains. Antigravity agy background reviews run in an isolated fresh session under request-review + a PreToolUse gate restricted to OSK MCP tools.
  • Node bodies are not secret-filtered. This is by design. The secret filter covers cited records, Scope memory, and writes distilled from cited records. Keep secrets out of notes: they are committed and synchronized.
  • Protected regions are not a security boundary. They help prevent and recover from honest mistakes; see Your memory, your authority.
  • Antigravity on Windows needs plain paths. It runs hooks through cmd, which cannot read a quoted path. The vault and Python paths must not contain spaces or cmd special characters (& | < > ^ % ! ( ) , ; =). The setup tool refuses such a path before writing anything; --harness connects the other hosts.
  • Autonomous growth is experimental. Its effect is still being measured (issue #19 and #178; initial lever measurement in closed #20).
  • The governing documents are in Korean only. (docs/GOVERNANCE-SUMMARY.md provides a 1-page English summary, docs/OPERATING.md covers everyday CLI/MCP operations and troubleshooting in English, and docs/FORMAT.md provides an English non-normative commentary covering the on-disk layout, node contract, ledgers, approval store, and MCP surface.)

Governance

The rules defining the system live in _governance/, outside the knowledge Spaces: the rules that organize knowledge are not themselves knowledge being organized by the system.

Document Responsibility
Constitution Spaces, nodes, reference topology, delegation, protected regions, cases, and amendments
Bylaws Operating rules for node and cited-record contracts, clusters, pins, delegation, and protected regions
Mechanism Physical layout, identifiers, timestamps, ledgers, MCP contracts, link syntax, and secret filtering
Workbench contract The special status and organization rules of the operational Workbench scope

Read Constitution → Bylaws → Mechanism. Mechanism §3 (approval ledger) and §6-2 (external surface) specify the protected regions and MCP writes described above. These documents are currently in Korean; this README and docs/GOVERNANCE-SUMMARY.md are English orientations, not replacements for the governing text.

docs/OPERATING.md is the concise English operational and troubleshooting guide, and docs/FORMAT.md is an English, non-normative commentary on the on-disk format that the Mechanism defines.

Ratification is the user's explicit act in the canonical repository, fixed by the release attestation (release.json, containing file content hashes). Release declaration can run noninteractively without a separate version approval. The first update-apply attempt shows its changeset and the required harness restart, then stops for explicit user confirmation. A matching retry applies it and records acceptance of the protected governance region in the same transaction. On an install where the governance region was never protected, the same confirmed retry protects it, but only when its files match the release attestation exactly. A newer release is announced at every session start, and in overview, until the agent acknowledges it; nothing is applied until you ask for the update. See installation and operations.

What's in this repository

The engine, governing documents, and operating guides. Not your knowledge corpus, approval ledgers, other operational ledgers, or session transcripts.

The empty 00_Scope/, 00_Domain/, and 00_Person/ directories are starting points for your own instance. Personal data belongs in that instance, not in this public repository.

The v5.0.0 growth milestones (Korean) describe the development sequence and acceptance criteria. v5.1.0 tracks conversations that have no scope yet and lets their review decide where they belong. v5.2.0 keeps cited records in one root _cited/, binds scopes to the project, and runs the scheduled growth run in daily batches sized each week (plan). v5.3.0 ranks search by recency, centrality and locality as well as relevance. It also fixes conversation review where the live instance showed it falling short. v5.3.1 fixes the capture defects and the copy-test gap found while testing the v5.3.0 release. v5.3.2 fixes the scheduled growth run's Claude worker fallback, which never ran. v5.3.3 fixes the weekly limit adjustment slipping a day and conversation reviews picking stalled jobs again and again. v5.4.0 separates node and non-node evidence: derived-from takes nodes only, non-node evidence goes to each node's evidence section (with a command that moves older entries), and files outside the vault come only from registered external roots. It also has the sync daemon report when it stops sending and puts a CLI launcher at the vault root. v5.4.1 turns a validator rule on by itself once it has no violations, applies the evidence migration without a terminal confirmation, and stops counting harness notices as your input. v5.4.2 lets an anchor edit match text the tag defence spaced and lets a Scope node cite ledger records. v5.5.0 lets an agent edit a large node by reading only the passage and the paragraphs around it, allows an evidence line without a body change only for supporting evidence, and reads Claude transcript copies, harness notices and rewinds correctly. v5.6.0 redefines knowledge as a hypothesis that explains observations and centrality as two axes (explanatory and dependency), renames the evidence section to the observation section # 관측, gathers bulk migrations under osk doctor --migrate, lets the scheduled growth run rest at 90% weekly use instead of keeping a budget, and has an agent search before it writes a new node. v5.7.0 was not released: the items of its plan moved to the v6 line. v6.0.0 adds no feature — it restructures the engine (plan and record). The tools and commands are unchanged; only scripts that call engine functions directly need a fix (upgrading). v6.1.0 cuts what the engine spends: write responses carry only what the call changed, and the organization review runs in the daily run and looks only at scopes with a signal (plan and counts). v6.2.0 adds opt-in local semantic search (osk search-index), an adaptive session-start knowledge map (MOC) and hub link previews, node and sub-cluster rename (rename_node, move_cluster) with semi-automatic hub link cleanup, engine-aligned observation dates, fork-copy deduplication, routine worker metrics, MCP surface ergonomics improvements, and Antigravity background conversation review via agy CLI (upgrading). v6.2.1 adds the persistent local lexical BM25 index (.osk/search-lexical.sqlite3, #454), surface auto-normalization, fail-all validation, and concise English operational/governance docs (#455), plus Codex Desktop and Local Work compatibility fixes (#456). Remaining work — simplification and governance trimming, cross-project reuse, and external recall validation — is tracked in the v6 roadmap (in Korean).

License

MIT

The governing documents (the Constitution, the Bylaws, and their archives) are the work of lpaiu-cs. They are distributed under the same MIT license as the rest of the repository.

Jelajahi proyek terkait

Memuat…