osk-system

osk-system

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

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 · How it grows · Setup guide · 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 needHow osk-system does it
Context that carries into the next conversationEach session starts with the project's shared memory loaded; the agent searches and reads nodes as needed
Knowledge that grows instead of scatteringThe same claim updates its existing node; new knowledge grows by connecting to what is already there
Recall you can traceFrom a node to its source nodes and to specific conversation rounds
Memory people can read and editLocal 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 derived-from 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) is loaded into context, and the agent searches 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.

SpaceWhat it holds
ScopeMemory formed within a project or activity. The conversation rounds its nodes cite live in the root _cited/ compartment, outside every Space
DomainKnowledge reused across contexts, not tied to one project
PersonThe 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 MCP tools over stdio, stores knowledge in Markdown, and retrieves it with BM25. 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.1.5 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), Kiro (Grade B), and Antigravity (Grade C). Subscription-backed background forks with KV-cache reuse are for Codex and Claude Code only; Kiro and Antigravity integrate in-session at turns 9 and 15. Antigravity is rated Grade C because it lacks cache-preserving background forks (in-session review adds latency to the active ~340k–470k context, while a cold side branch incurs ~64k–470k uncached input) and rejects spaced/special-character paths on Windows cmd /c. Being able to call MCP tools from another client does not mean session hooks or autonomous knowledge growth are connected.

Runtime conditionsConversation review path
Supported hooks and subscription CLI; authentication and version checks passA background fork using the same harness and model after every 9 successful final-answer Stop events
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 adapterNo 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.

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.
  • Background 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. This is by design. The fork carries that conversation as its context, including any untrusted text it contains.
  • 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 #20).
  • The governing documents are in Korean only.

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.

DocumentResponsibility
ConstitutionSpaces, nodes, reference topology, delegation, protected regions, cases, and amendments
BylawsOperating rules for node and cited-record contracts, clusters, pins, delegation, and protected regions
MechanismPhysical layout, identifiers, timestamps, ledgers, MCP contracts, link syntax, and secret filtering
Workbench contractThe 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 is an introduction, not a replacement for the governing text.

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). What comes after — a measurement baseline, recall, cost, then simplification — is 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.

Related

How to Install

  1. Download the ZIP or clone the repository
  2. Open the folder as a vault in Obsidian (File → Open Vault)
  3. Obsidian will prompt you to install required plugins

Stats

Stars

75

Forks

11

License

MIT

Last updated 2h ago

Categories

Tags

agent-memoryai-agentsdeveloper-toolsduckdbknowledge-managementllm-memorylong-term-memoryltmmcpobsidianollamaragsecond-brain