OpenProgram Docs

Virtual memory

A compact index distilled from the concrete layer (session DAG and project git), not a replacement for it. Every memory points back to its source, records event_time and ingestion_time, and is never deleted: a conflict tags the old record superseded_by. Designed, not built; see status.

TimelineKnowledge graphCore.md
AnswersWhat happened, and whenHow things relateThe minimum read on every model call (2 KB or less)
Stored in memory/timeline/YYYY-MM.jsonlgraph/entities.jsonl, graph/edges.jsonl, graph/views/entity/<slug>.mdcore.md
CreatedIdle session (30 minutes or more) through the watcher, daily 03:00 consolidation; extraction with a Provenance pointer, appended to the month's fileSame triggers; entities and relations from extraction, aliases resolved, contradictions tagged, appendedRegenerated at 03:00 from top-N events (recency × importance) and high-frequency, high-confidence graph facts; every line carries ↪ session:<id>
Readmemory_timeline(since, until), memory_timeline(entity=…); recent high-signal events reach Core.mdmemory_graph_neighbors(entity, hops=2), memory_search(query), filtered to global plus project:<current>Injected into every system prompt
UpdatedRe-distilled fact tags the old recordAliases merge into one node; a conflicting edge tags the old one; views re-projectedWhole file replaced
DeletedNever: an event is a historical factNever: full history staysOverwritten
Record formats

Timeline event. kind: work, decision, learning, event.

{
  "id": "ev_abc",
  "summary": "Fixed the Windows cp1252 encoding bug in OpenProgram, touching 38 files",
  "kind": "work",
  "provenance": {
    "project_id": "proj_openprogram",
    "session_id": "local_13d5",
    "commit": "<sha>",
    "event_time": 1779900000,
    "ingestion_time": 1779986400
  },
  "entities": ["project.openprogram", "issue.cp1252"]
}

Entity.

{
  "id": "project.openprogram",
  "type": "project",
  "name": "OpenProgram",
  "attrs": {"path": "~/OpenProgram", "lang": "python"},
  "scope": "global"
}

Edge.

{
  "from": "issue.cp1252",
  "to": "commit.<sha>",
  "relation": "fixed-by",
  "event_time": 1779900000,
  "ingestion_time": 1779986400,
  "provenance": {"project_id": "proj_openprogram", "session_id": "local_13d5"},
  "confidence": 0.95,
  "superseded_by": null
}
Scope on an entity or edgeVisible
globalAcross projects, such as a language preference
project:openprogramThis project
agent:researchThis agent

Files live under ~/.openprogram/projects/default/memory/.

What the model sees

OpenProgram Memory — project: OpenProgram, last consolidated <date>
[Timeline · recent]
· <date> Refactored the Programs page into a three-tab layout   ↪ session:local_fc03
· <date> Fixed the CLI attended-mode issue                       ↪ session:local_d125

[Graph · current project]
· OpenProgram at ~/OpenProgram (python, next.js)
· worker ──listens-on──► :18100

For details: memory_open_session(<id>) / memory_git_log(<project>)

Core.md; timeline or graph results are optional, per query. No raw chat is injected.

ToolReturnsFrom
memory_open_session(session_id, turn)Raw messagesSession git history
memory_git_log(project_id, since)Commit historyProject git
memory_git_show(project_id, commit)What one commit changedProject git
memory_timeline(entity|since|until)Timeline sliceTimeline
memory_graph_neighbors(entity, hops)NeighborsGraph
memory_search(query)Hybrid searchFull text and optional vectors

Distillation

TriggerWhenDoes
Session endIdle 30 minutes or moreDistills new turns
Daily03:00Consolidation, disambiguation, contradiction detection, Core.md rebuild
Pre-compressContext near its limitFlushes key information to the concrete layer
  1. Collect: commits since the last pass from session git and project git; every DAG node (user, llm, code, plus reads edges).
  2. Extract: one model pass for events, entities and relations, each with provenance. The costliest stage; a rules-based version can come first.
  3. Link: resolve aliases against the graph (worker, backend, daemon become one node).
  4. Reconcile: detect contradictions, tag old edges.
  5. Project: core.md, entity views, timeline shards.

Compared with today's memory

Built todayThis design
ReadsUser and assistant text from the session branchThe Call DAG, code nodes and reads edges, project commits
Keepstopics/, rewritten at 03:00; derived timeline/, recent_events.jsonl, relations.jsonAppend-only timeline and graph with two timestamps
Always-on blockCore section of MEMORY.md, from topics/core.mdcore.md projected from timeline and graph
Tool calls, decision inputs, project historyAbsentPresent

Implementation status

StatusItems
ImplementedRead layer openprogram/state/store/session/reading/provenance.py: iter_nodes_since(), node_provenance(), project_commits(), session_project_id(). Tool memory_search.
Not yetTimeline and graph stores, this core.md, the distillation stages, every other navigation tool, a per-session commit reader

Memory overview

Last updated · 2026-11-25