Historical snapshot: this document describes the initial wiki-memory framing. The current product direction is memory-substrate first, with wiki output as a derived projection.
Build a wiki-based memory system for a single user that supports:
- coding agent workflows
- project management workflows
- reusable knowledge management across papers, code docs, specs, notes, and repos
This system is not a generic memory backend. It is a wiki-based context substrate for agents:
- ingest external input
- assemble usable context for work
- let the agent continue exploration
- crystallize successful results back into the system
- keep the system healthy over time
- The system exists to provide durable, usable working context across sessions.
- Memory is not just storage. It must be traceable, correctable, and evolvable.
- The semantic core must stay stable even if projections, indexes, or adapters change.
- Search, graph, embeddings, and markdown pages are derived layers, not the semantic core.
- Agents should enter through structured context, not through ad hoc search alone.
- The system should not try to pre-structure every detail in advance.
- The system should build a navigable knowledge terrain; the agent explores within it.
- High-value exploration results should be crystallized back into the system.
Ingest
-> Query
-> Agent work
-> Crystallize
-> Lint
Meaning:
Ingest: bring external input into the systemQuery: provide a structured context entrypointAgent work: perform task-specific exploration and reasoningCrystallize: write back reusable resultsLint: detect and repair drift, inconsistency, and decay
The system is built around five core domain objects:
SourceNodeKnowledgeActivityWorkItem
These answer five irreducible questions:
- what has the system seen
- what stable objects exist in the system world
- what does the system currently believe
- what work has happened
- what work needs to be tracked or advanced
Represents stable ingested input from the outside world.
Responsibilities:
- preserve a stable internal representation of input
- support traceability and re-interpretation
- provide locally referenceable segments for evidence
Non-responsibilities:
- not the system's conclusion
- not the definition of a stable object
- not a work process record
- not a task, bug, issue, or requirement
Allowed kinds:
repofilepdfwebmarkdownnoteopenapiofficeconversationmeeting_record
Minimum fields:
idkindorigintitlefingerprintcontent_typepayloadsegmentsmetadatastatuscaptured_atupdated_at
Field notes:
origin: path, URL, repo+commit, document identifier, or equivalentfingerprint: stable content hashcontent_type:text | markdown | structured | repo_map | binary_stubpayload: normalized content bodysegments: local reference units for evidence
Each segment should contain:
segment_idlocatorexcerpthash
Suggested status:
activeinvalidarchived
Represents a stable object in the system world.
Responsibilities:
- act as the stable center for relationships
- act as the anchor for knowledge, activity, and work items
Non-responsibilities:
- not the fact about an object
- not the process around an object
- not the task around an object
- not raw source content
Allowed kinds:
projectrepomoduleserviceapidocumentpaperconceptpersonteamcomponentdatasetspec
Minimum fields:
idkindnameslugaliasessummarystatuscreated_atupdated_at
Suggested status:
activemergedarchived
Creation rule:
Create a Node only if the object is expected to be reused across multiple knowledge items, activities, or work items. Not every noun becomes a node.
Represents system-recognized cognition.
Responsibilities:
- hold reusable recognized knowledge
- support updating, contesting, superseding, and aging
- support agent work without forcing re-derivation every time
Non-responsibilities:
- not raw input
- not a full work log
- not a task tracker
- not the object definition itself
Allowed kinds:
factproceduredecisionconstraintpreference
Minimum fields:
idkindtitlesummarysubject_refsevidence_refspayloadstatusconfidencevalid_fromvalid_untillast_verified_atcreated_atupdated_at
Suggested status:
candidateactivecontestedsupersededstalearchived
Payload rules by kind:
fact
subjectpredicateobjectorvalue
procedure
stepspreconditionsexpected_outcome
decision
questionoutcomerationalealternatives
constraint
rulescopeviolation_impact
preference
statementscope
Design constraints:
- knowledge must be able to become invalid, stale, contested, or superseded
- knowledge must not degrade into an unstructured text bucket
Represents work that has already happened.
Responsibilities:
- record completed or completed-enough work processes
- provide the main basis for reports, retrospectives, and crystallization
Non-responsibilities:
- not long-term knowledge itself
- not the work item itself
- not raw source storage
Allowed kinds:
episodedebugreviewresearchimplementationmeetingreading
Minimum fields:
idkindtitlesummarystatusstarted_atended_atrelated_node_refsrelated_work_item_refssource_refsproduced_object_refsartifact_refscreated_atupdated_at
Suggested status:
draftfinalizedarchived
Field notes:
produced_object_refs: knowledge, node, or work item outputsartifact_refs: PRs, docs, reports, file paths, or other external artifacts
Represents a tracked unit of work that needs to be advanced, resolved, or closed.
Responsibilities:
- unify tasks, requirements, issues, bugs, and investigations
- support tracking, blocking, dependency, and closure
Non-responsibilities:
- not long-term recognized knowledge
- not raw source content
- not a complete work process log
Allowed kinds:
taskrequirementissuebugimprovementquestioninvestigation
Minimum fields:
idkindtitlesummarystatuslifecycle_statepriorityowner_refsrelated_node_refsrelated_knowledge_refssource_refsdepends_onblocked_byparent_refchild_refsresolutiondue_atopened_atupdated_at
Suggested work status:
openin_progressblockedresolvedclosedcancelled
Suggested lifecycle state:
activearchived
These are important, but they are not part of the semantic core object set.
Purpose:
- connect
Knowledgeback to concreteSourcesegments
Minimum fields:
source_idsegment_id
Purpose:
- provide structured working context to an agent
Minimum fields:
idtasksummaryscopeitemsconflictsmissing_contextrecommended_next_readscitationsgenerated_atexpires_at
Purpose:
- express mutations before they are applied
Minimum fields:
idsourceoperationscreated_at
Purpose:
- append-only record of meaningful system mutations
Minimum fields:
idevent_typeactortargetbeforeafterreasontimestamp
Sourceis what the system sawKnowledgeis what the system currently recognizes from what it saw
Nodeis the objectKnowledgeis what is known about the object
Activityis work that already happenedWorkItemis work that needs tracking or advancement
Activityis the processKnowledgeis the durable result that may be extracted from that process
Identity must not depend on path, filename, or page title.
Rules:
- All internal references use stable
id. - Page names and file paths are projections.
- External references may break; internal references must not.
- Merge and supersede are different operations.
Recommended ID prefixes:
src:node:know:act:work:ctx:patch:aud:
The system is stateful. Objects do not become durable merely by being written.
Suggested status:
activeinvalidarchived
Suggested status:
activemergedarchived
Suggested status:
candidateactivecontestedsupersededstalearchived
Suggested status:
draftfinalizedarchived
Work status:
openin_progressblockedresolvedclosedcancelled
Lifecycle state:
activearchived
The system should not try to fully pre-structure all possible future questions.
Instead, query should work in two steps:
- provide a structured starting context
- allow deeper expansion around relevant objects and sources
That means:
- the system builds a navigable knowledge terrain
- the agent continues task-specific exploration inside that terrain
- high-value findings can later be crystallized back into the system
Adapters isolate source-specific parsing from the semantic core.
All adapters should follow the same broad pattern:
identify
read
normalize
segment
propose
Adapters may produce:
Source- candidate
Node - candidate
Knowledge - initial
Activity - initial
WorkItem
Adapters do not:
- define final semantic truth
- bypass lifecycle rules
- bypass patch application
Primary first-stage adapter for coding workflows.
Internal implementation may use:
- Tree-sitter
- file classification
- symbol extraction
- dependency extraction
- config parsing
The repo adapter should create a useful knowledge terrain, not an exhaustive final answer database.
The architecture should be grouped into three stability zones.
Most stable. Should change rarely.
Contains:
- five core domain objects
- identity rules
- lifecycle rules
- context, patch, and audit contracts
- patch apply
- audit append
Fully rebuildable.
Contains:
- markdown/wiki projections
- indexes
- graphs
- embeddings
- overview and index pages
These are not the source of truth.
Most changeable.
Contains:
- adapters
- MCP
- CLI/UI
- jobs
- automation hooks
Expose exactly four top-level tools:
wiki.ingestwiki.querywiki.crystallizewiki.lint
All expansion should happen through mode, not new top-level tools.
Purpose:
- bring external input into the system
Typical modes:
sourcepathrepourlstatus
Purpose:
- provide usable context, then allow deeper expansion
Typical modes:
contextsearchpagerelatedrecentexpand
Default preference:
- start with
context - then use
expandor targeted retrieval
Purpose:
- turn successful work into reusable system state
Typical modes:
activityknowledgework_itempromotesupersede
Purpose:
- detect drift, inconsistency, and repairable problems
Typical modes:
structuresemanticrepairreindexaudit
All top-level tools should follow the same outer request shape:
{
"mode": "...",
"scope": {},
"input": {},
"options": {}
}Phase 1 should prioritize semantic stability over breadth.
Build only:
- repo ingest
- query context
- activity crystallization
- structural lint
Closed loop:
repo
-> ingest into Source / Node / candidate Knowledge
-> query context
-> agent work
-> crystallize Activity and reusable results
-> lint and audit
Do not prioritize:
- vector DB first
- graph DB first
- multi-user collaboration
- rich UI
- full source-type coverage
- full ahead-of-time structure extraction
These are expansion concerns and should not reshape the core.
The final architecture is:
- five stable semantic core objects
- four stable top-level MCP tools
- query as context-first, then expand
- crystallization as the main compounding mechanism
- projections and indexes as derived layers
- adapters as replaceable edge logic
This keeps the kernel stable while preserving enough flexibility to support coding, project management, knowledge reuse, time-window reporting, issue tracking, and source-driven exploration.