An owner-reviewed Brain beside a verified-experience ladder its own agent can certify

WaveMind

A local Python memory library with a verified-experience runtime and an owner-reviewed Brain of cited, time-bounded claims that agents read through scoped keys.

LicenceMIT in LICENSE and pyproject.toml; a vendored OpenShape inference adaptation keeps its Apache-2.0 text and notice
Size87,962 lines of Python in wavemind/, 64,873 in tests/ and 65,909 in benchmarks/; the memory is core.py (1,580) and storage.py (1,355), experience.py (2,233), experience_runtime.py (1,442), experience_compiler.py (776), memory_firewall.py (459) and brain/ (8,436)
Activity1,026 commits on main from 17 June to 11 September 2026, 1,022 of the counted contributions by one account; release v2.14.0 on 6 September 2026 predates Brain, which is 129 commits later
Tests1,718 pytest functions, 277 of them for Brain; CI runs tests/ on Python 3.10 and 3.11 on every push to main; none run for this reading

Carries 6 of 7 rubric mechanisms. Most systems here carry none or one (41%), and a dash means the mechanism was not found at this commit — not that the system needed it. Each mark is one LLM reviewer's reading of the code at this commit rather than a run of it — known limits.

  • Tombstone
  • Trust state
  • Bi-temporal
  • Scope enforced
  • Mutation audit
  • Human review
  • Negative evals

1. Executive Summary

WaveMind is three memory systems in one Python repository. The published 2.14.0 library stores namespaced text records in SQLite behind a vector index. The Verified Agent Experience Runtime turns tool runs into procedures and promotes them on verification counts. Brain D1, an unreleased local preview, holds cited claims that an owner reviews and agents read through capped keys. Notable: Brain derives an agent's authority from its credential, so an agent can propose and never approve. Weak: the runtime the README calls independently verified takes the verifier as a request field, and its MCP adapter registers approve_experience beside the tools that write.

Brain is the careful part. A claim needs citations into a stored source version, waits as proposed until the owner approves it, and enters context only while the asked-for moment is inside its validity interval (wavemind/brain/reconcile.py:354-375). A correction ends its predecessor's interval instead of overwriting it. A conflict is returned as uncertainty. A packet is invalidated when any source it came from changes.

The rest is uneven:

  • Verification is a label on the runtime. OutcomeVerification refuses only metadata.llm_self_assessed=true. A write-role HTTP caller, or a model holding the runtime MCP tools, can name its source test or operator and activate a procedure in three runs (wavemind/experience_runtime.py:137-158, wavemind/integrations/mcp_experience.py:266-317).
  • An HTTP writer can skip the ladder. /experience/trajectories takes trust and status from the body, and the firewall admits explicit_user with active (wavemind/api.py:1354-1361, wavemind/memory_firewall.py:206-237).
  • Brain re-derives everything on every write. Each proposal and review runs _reconcile over the whole Brain, compares every pair of live claims and rewrites every row (wavemind/brain/reconcile.py:463-622).
  • The wave field is a 4% term. The 128×128×6 field the project is named for is rebuilt from all records at load, weighted 0.04, and switched off past 1,000 candidates (wavemind/core.py:52-117, :1539-1542).

Licence. MIT in LICENSE and pyproject.toml. The one vendored component, an inference adaptation of OpenShape PointBERT, carries its Apache-2.0 text and a notice (wavemind/THIRD_PARTY_NOTICES.md). Benchmark manifests record some fetched datasets as CC-BY-NC-2.0 or unknown; none is committed.

Six marks, all evidenced on Brain: trust_state, bitemporal, scope_enforced, audit_log, human_review, negative_eval. Section 9 gives the reason tombstone is withheld and why none of the six rests on the experience runtime.

2. Mental Model

The three layers hold three different kinds of belief.

The library treats a record as ground truth until it is deleted. A memory is whatever a caller passed to remember. It dies by forget, by TTL or by the Memory OS worker lowering its priority. A caller can label a record through metadata (verification_status, stale, contradictory), and the confidence gate drops those labels from query results (wavemind/core.py:617-650). Nothing in the library sets them.

The experience store treats a procedure as a candidate until evidence accumulates. A finished run yields records for the tool sequence, the errors and any constraint or correction a step carried. Each starts in shadow. Two passing validations move it to canary, three to active, two failures to rejected (wavemind/experience_compiler.py:32-48, :255-350). Packets read active records only. What counts as a validation is whatever the caller reports with a source of test, tool, environment or operator.

Brain treats a claim as a proposal until the owner rules on it. The cycle is below. A claim's status is derived, never written: _reconcile computes it from the owner's decision, the claim's prerequisites, any correction that supersedes it and any other approved claim with the same kind and key whose validity overlaps (wavemind/brain/reconcile.py:463-622). Approval does not assert truth either. The module docstring says context must also check source authority, the recheck flag and the effective bounds, and _record_state does all three.

A claim stops counting in four ways. Rejection revokes it. An approved correction clips its interval and marks it superseded, so it still answers for the period before. A revoked or deleted source sets needs_recheck on everything derived from it, which returns those records to proposed until the owner rechecks them. An approved competitor with overlapping validity makes both conflicted.

Diagram — a Brain claim waits for the owner, counts only inside its validity interval, and drops back to proposed when a source changes
Diagram source
%% caption: a Brain claim waits for the owner, counts only inside its validity interval, and drops back to proposed when a source changes
flowchart TD
  P["agent or owner proposes<br/>a claim with citations"]
  P --> PR["proposed<br/>not in context"]
  PR -->|"owner rejects"| RV["revoked"]
  PR -->|"owner approves"| RC{"reconcile the<br/>whole Brain"}
  RC -->|"prerequisite unreviewed<br/>or no effective start"| PR
  RC -->|"same key, other text,<br/>overlapping validity"| CF["conflicted<br/>returned as uncertainty"]
  RC --> AC["active"]
  AC -->|"approved correction<br/>supersedes it"| SU["superseded<br/>interval clipped"]
  AC --> CTX{"build_context at a moment:<br/>approved, inside interval,<br/>every source readable"}
  SU --> CTX
  CTX --> PK["packet with citations<br/>and an expiry"]
  AC -->|"a source is revoked<br/>or deleted"| NR["needs_recheck"]
  NR --> PR

3. Architecture

The library, the experience store and Brain share a package and nothing else. Brain is not mounted on the library's routes, and the library cannot read Brain's databases (docs/brain/agent-contract.md, tested by test_existing_generic_apis_cannot_retrieve_brain_context).

  • Library. WaveMind in wavemind/core.py over SQLiteMemoryStore or PostgresMemoryStore (wavemind/storage.py), with memories and audit_events tables. The in-process state is a cache of every record, a token index, a vector index (NumPy exact by default, FAISS, Annoy, Qdrant or pgvector optional), a WaveField and an optional graph. An optional JSONL recovery journal records remember and forget for replay.
  • Experience. SQLiteExperienceStore in wavemind/experience.py, with records, trajectories, steps, candidate validations and an audit table. ExperienceCompiler ranks and packs; AgentExperienceRuntime captures runs and adds verification, injection-decision and event tables (wavemind/experience_runtime.py:270-340).
  • Brain. BrainService over three SQLite files in an owner-chosen directory: the authority store, a private experience store and an auth store holding SHA-256 digests of keys (wavemind/brain/store.py, wavemind/brain/auth.py:54-70).
  • Servers. A FastAPI app with Studio, 64 routes and optional role-and-prefix keys; wavemind-mcp for the library; an experience MCP builder; wavemind brain serve (loopback only) and wavemind brain mcp.
  • Scale tooling. Sharding, replication with CRDT field state, Redis job guards, Kubernetes manifests and Terraform modules. None of it touches Brain.

Deployment and ergonomics

pip install wavemind gives the library, CLI, HTTP server and Studio with no API key and no network: the default encoder hashes tokens into 384 dimensions. Sentence-transformers, FAISS, Qdrant, Postgres, Redis and MCP are extras. Brain needs a source checkout, pip install -e ".[mcp]", wavemind brain init with a new key-file path and wavemind brain serve. All stores are plaintext SQLite and readable with the sqlite3 shell. Brain's are not safe to edit by hand, because status is recomputed from payload fields on the next write.

4. Essential Implementation Paths

  • Library write. WaveMind.remember encodes, inserts, indexes, feeds the field and logs remember (wavemind/core.py:241-301).
  • Library read. query filters by namespace, expiry, tags and metadata, takes vector and token candidates, adds field, priority and optional graph terms, applies the confidence gate and the score floor (:438-595, :1459-1483).
  • Library delete. forget deletes rows, removes them from the index, graph and field, and logs one forget per row (:652-694).
  • Experience capture. CapturedRun records events; finalize_run stores the verification, ingests the trajectory as a shadow episode, derives candidates and calls review_candidate for each (wavemind/experience_runtime.py:697-785).
  • Experience promotion. ExperienceCompiler.review_candidate adds a validation row and moves status by count, with a firewall check before active (wavemind/experience_compiler.py:255-350).
  • Experience read. compile_packet lists active (and opt-in canary) records, runs the firewall's RETRIEVE decision, filters by applicability and ranks (:404-580); runtime.decide injects only above a 0.5 score.
  • Brain import. preview_import and commit_import parse up to 20 files, chunk them and store a versioned source (wavemind/brain/sources.py:371-689).
  • Brain proposal and review. propose_claims and _review, each ending in _reconcile (wavemind/brain/reconcile.py:710-882).
  • Brain context. ContextService.build_context and _select (wavemind/brain/context.py:158-283, :397-630).
  • Brain outcomes. begin_action, record_outcome, verify_outcome and the bridge into the private experience store (wavemind/brain/experience_bridge.py:113-410).
  • Brain access. require_access and allowed_sources (wavemind/brain/access.py:61-108).

5. Memory Data Model

Library record. text, vector, pattern, namespace, tags, metadata, created_at, updated_at, expires_at, priority, access_count (wavemind/storage.py:20-37). audit_events holds action, namespace, memory id and metadata JSON.

Experience record. Kind from twelve values, title, content, applicability (domains, task types, tools, conditions), outcome, confidence, a seven-value TrustClass, source, observed_at, trajectory provenance, version, status, supersedes_id, rollback_of_id, a content hash and a dedupe key (wavemind/experience.py:15-49, :643-668).

Brain. Twenty tables. Every child key includes brain_id (wavemind/brain/store.py:13-141). The memory tables are:

  • sources with a status of active, paused, revoked, quarantined or deleted and an optional reader list.
  • source_versions and chunks, unique on digest per source.
  • claims, entities and relations, each with a CHECK-constrained status.
  • dependencies, the materialized origin graph from each record to every source it rests on.
  • packets, receipts and outcomes for actions taken on context.
  • tombstones and audit.

A claim's kind is one of fact, goal, constraint, decision or commitment. It carries a topic key, content, citation_ids, entity_ids, depends_on, supersedes, valid_from, valid_until, event_time and a recorded_at set from the clock. The payload adds the owner's decision (_review) and the derived effective interval.

Scope. Library: a namespace string. Experience: a namespace and a firewall policy bound to one namespace. Brain: the Brain, then each source's reader list, then the credential's exact (brain, source) pairs.

6. Retrieval Mechanics

Library. Candidates come from the vector index (rerank_k 10) plus every record sharing a query token, restricted to the namespace's ids. The score is 0.94 vector, 0.20 token overlap (2.0 for queries of one or two tokens), 0.02 priority and 0.04 field resonance, with graph propagation off by default (wavemind/core.py:165-200). The confidence gate then drops a hashing-encoder hit that covers under a third of the query tokens or scores under 0.12. That gate is what stops the default install from returning noise for unrelated questions, and it also drops a short paraphrase.

Experience. Every active record in the namespace is scored on seven weighted signals: vector 0.38, token 0.18, applicability 0.12, confidence 0.10, trust 0.10, outcome 0.07 and recency 0.05. A record whose declared domains, task types or tools do not match the request is skipped. The packet is cut to a token budget, 800 by default and 400 in the runtime. Each item is cited E# with its experience id.

Brain. Up to 10,000 claims are scanned. Each is kept only if all of its sources are readable by the caller, then ranked by how many query words it shares. The top 128 are verified one by one through context_record_state. No vector is involved. With no project selected, matching chunks from sources that no record uses are added as citations marked review_status: unreviewed (wavemind/brain/context.py:248-281).

A packet is stored with its digest, every origin and an expiry. The expiry is 900 seconds or the next validity boundary of any claim it touched, whichever is sooner. validate_packet re-runs the checks before reuse. A question whose words appear in no claim returns no claims, however close in meaning.

7. Write Mechanics

Nothing is extracted from conversation in any layer. The library stores what it is handed. The runtime derives records from the tool names a run called and the error codes it hit (wavemind/experience_runtime.py:918-1057). Brain stores what an owner or agent imports and proposes.

The runtime's evidence is the caller's word. verify_experience_run on MCP and POST /experience/runtime/runs/{run_id}/verify on HTTP accept source, verifier, success and evidence_id from the request. The HTTP route needs the write role, the same role that captures events (wavemind/api.py:2405-2433). A candidate's id is a hash of its content, so three runs of the same tool sequence verified by the same caller activate it. approve_experience runs three operator validations in a loop. It needs the admin role over HTTP, and on MCP it is one of the tools in the same adapter (wavemind/experience_runtime.py:787-808).

A write can enter active without the ladder. /experience/trajectories reads trust and status from the body. The firewall's INGEST rule accepts active when trust is system, explicit_user or verified_operator and the text matches no instruction pattern (wavemind/memory_firewall.py:206-237).

Brain writes are proposals. propose_claims accepts a fixed key set and sets _review to none, so neither an agent nor the owner can submit a status (wavemind/brain/reconcile.py:717-762). A citation must resolve to a chunk the caller may read. A correction must share kind and key with the claim it replaces and state when it takes effect, or it stays proposed with needs_effective_time.

Deletion is source-first in Brain. Revoking or deleting a source sets needs_recheck on every dependent record and invalidates packets. Delete also erases the versions, chunks and dependency rows, blanks the source row and writes a source_deleted tombstone (wavemind/brain/sources.py:777-842). The response says local deletion does not reach upstream files or backups.

Operational cost

  • No write blocks on a model. Nothing in the three layers calls one.
  • A library write is visible at once to the process that made it. Another process sharing the database sees it after shared_store_refresh_seconds, off by default.
  • Every Brain write re-derives the Brain. _reconcile loads every record, orders them, compares each pair of live claims for conflicts and runs _save on every row (wavemind/brain/reconcile.py:589-622). That is quadratic in claims and bounded at 10,000 records.
  • Every Brain read writes. build_context inserts a packet, its dependency rows and a packet_issued audit row (wavemind/brain/context.py:560-625).
  • Injection is on request. Brain packets default to 16 KiB and the runtime to 400 tokens. No layer injects into a prompt prefix automatically.
  • Background work runs when called. MemoryOSWorker.run_once reads query audit events (off unless audit_queries is set), purges expired records, consolidates clusters into concept memories, boosts hot records and decays unused ones older than seven days, 32 per run (wavemind/jobs.py:2284-2340).

8. Agent Integration

The library's wavemind-mcp gives a model remember, recall, feedback, forget, inspect_memory, explain_memory and manage_namespace. Every tool takes the namespace as an argument, and manage_namespace can clear one with confirm=true (wavemind/mcp_server.py:157-430). Adapters exist for LangChain, LangGraph, LlamaIndex, CrewAI, AutoGen, OpenAI Agents and Anthropic. The provider hooks wrap tool calls into runtime events.

The experience MCP builder registers compile_experience_packet and expand_experience, and with a runtime adds start, capture, verify, inspect, approve, reject and rollback. A test pins all seven on one adapter (tests/test_experience_runtime_contracts.py:310-321). The generated MCP starter passes no runtime, so it exposes only the two read tools (wavemind/onboarding.py:365-390).

Brain's MCP server lists every Brain operation as a tool and checks each call against the live credential (wavemind/brain/mcp.py:42-81). The documented agent flow is build_context, read_citation, begin_action before an action and record_outcome after it. The agent proposes and reports; the owner reviews and verifies in the local UI. The credential is re-checked on every call, so a revoked key stops working on an open connection.

9. Reliability, Safety, and Trust

Brain's gate is on the credential

_membership refuses any operation outside read, import, propose, record_outcome and export for a principal of kind agent, whatever the grant lists (wavemind/brain/access.py:16, :24-42). The kind comes from the credential row. issue_agent writes agent, only bootstrap_owner writes human, and issue_agent refuses a caller that is not human (wavemind/brain/auth.py:100-216). The HTTP and MCP layers build the principal from the key and never from the body. The test grants an agent all ten operations and requires five of them refused (tests/brain/test_store_access.py:295-334).

Two doors stay open. wavemind brain mcp runs with whatever key it is given, including the owner's (wavemind/brain/cli.py:135-138), and the owner key is a plaintext file under the same account. An agent with a shell can read it.

The runtime's gate is on the request

The same repository's runtime has the review machinery and no actor check. Verification source, verifier name and success are request fields. The only refusal is a metadata flag the caller would have to set against itself. The admission artifact reports unverified-auto-promotion: 0, which holds for a caller that declares nothing.

rollback passes consent_token="operator-approved" as a literal, so the firewall's consent check for protected kinds always passes on that path (wavemind/experience_runtime.py:854-865).

Injection and content

The firewall flags instruction-like text with a fixed pattern list and is applied to Brain claims and chunks at context time. An owner-approved claim that matches is dropped from the packet (tests/brain/test_context.py:107-131). An agent with import can add a source whose matching chunks reach other readers' packets as unreviewed citations. The packet carries a source_content_is_untrusted_data warning.

Concurrency and data loss

Brain writes take BEGIN IMMEDIATE and reject nested transactions (wavemind/brain/store.py:236-262). The library serializes SQLite calls with a lock and keeps a full in-process copy of every record, so memory use grows with the store. Backups are SQLite copies. Brain archives are size-, ratio- and path-checked on restore.

Marks withheld

  • tombstone. Brain's tombstones table has one writer, source_deleted, keyed on the source id and consulted only by restore. Deleting a source also deletes its version digests, so the same file imported again is a new source. A rejected claim is revoked under its own id. A runtime candidate's id is a hash of its content, so a rejected procedure is not re-derived from the same runs. But the hash includes verified_track, so the verified twin of a rejected unverified candidate is a new record. Deleting the row removes the block.

The six awarded marks rest on Brain. The experience store's eight-state status would satisfy the shape of trust_state, and its writer is the caller.

10. Tests, Evals, and Benchmarks

The Brain suite is the strongest code in the repository: 277 functions, most asserting exact lists over a populated Brain. They cover disjoint agents, project selectors, half-open validity, expired ancestors, conflicts as uncertainty, packet tampering, revocation through issued packets, restarts and restores. CI runs all of tests/ on Python 3.10 and 3.11.

The runtime's tests check the contract each surface exposes and assert that approve_experience is present. No test asserts that a caller cannot verify its own run.

The headline benchmark, benchmarks/verified_experience_admission_results.json (150 frozen tasks in three domains, success 20% to 100%), has no model in it. Its protocol records no_llm_api_gpu: true. The harness executes the stored tool_plan of the top packet item verbatim and calls a task a success when that plan equals the expected one (benchmarks/verified_experience_benchmark.py:344-389). The 0.8 uplift is identical in all three domains. It measures that the runtime returns the recorded plan for the matching task, not that an agent uses it.

Other committed artifacts include LoCoMo and LongMemEval retrieval runs (recall@5 0.548 and 0.782), a failed 451-question LongMemEval-V2 uplift experiment that the README reports as failed, and admission files for safety, scale and multimodal retrieval. Each is a self-assessment against the project's own gates.

No paper describes WaveMind. research/ is a quantum-sensing simulation track the README calls separate from the library. Its citations are about pulse control, not memory.

Missing before relying on it: a runtime case where a write-role caller attempts to verify its own run; a Brain test that the audit table cannot change; a measurement of _reconcile at a few thousand claims.

11. For Your Own Build

Steal

  • Derive the actor's kind from the credential and cap verbs by kind. A grant list can only narrow, and the review verbs are not grantable to an agent at all.
  • Never let a status be an input. Accept a decision and recompute status from decisions, prerequisites and validity on every write.
  • Correct by clipping, not overwriting. A replacement states when it takes effect and ends the old claim's interval there, so "what applied then" still answers.
  • Bind a context packet to every origin it used and expire it at the next validity boundary it touched. Revoking a source then revokes the packets built on it.
  • Return a conflict as uncertainty. Two approved claims that disagree on one key go out under conflicts, never under claims.

Avoid

  • Verification evidence the caller describes. A source: test field is not a test. Bind evidence to something the caller cannot write, such as a registered verifier or a separate credential.
  • Approve and write on one tool surface. An adapter that registers both gives the producing model the review.
  • A consent token as a literal. A check that a constant satisfies is not a check.
  • A benchmark whose agent replays the stored answer. It tests retrieval routing and reads as task success.
  • Global re-derivation on every write without a measured ceiling.

Fit

Brain suits one person or a small team who will review each fact they want an agent to act on, and who need to say later what was believed when and from which file. It assumes an owner who opens the UI. A workflow that wants memory to accumulate without that person should look elsewhere.

The library is a competent local vector store with TTL and an audit table. Its wave field does not change what it returns at any size that matters.

Do not build on the experience runtime's activation as a safety property. Treat it as a ranking aid behind a key the agent does not hold. Brain is a source preview outside the published release, so pin a commit.

12. Open Questions

  • Will Brain's credential model replace the runtime's caller-declared verification, or will the two stay separate?
  • How does _reconcile behave at a few thousand claims, and is incremental reconciliation planned?
  • Is the owner key meant to stay a plaintext file once D2 adds an installer?
  • Which surfaces is the runtime MCP adapter with runtime= meant to be given to?

Appendix: File Index

  • Library: wavemind/core.py, wavemind/storage.py, wavemind/encoders.py, wavemind/indexes.py, wavemind/mcp_server.py, wavemind/jobs.py
  • Experience: wavemind/experience.py, wavemind/experience_compiler.py, wavemind/experience_runtime.py, wavemind/memory_firewall.py, wavemind/workspace_experience.py, wavemind/integrations/mcp_experience.py
  • Brain: wavemind/brain/store.py, access.py, auth.py, models.py, reconcile.py, context.py, sources.py, experience_bridge.py, mcp.py, http.py, cli.py, ui/panels.js
  • HTTP: wavemind/api.py
  • Tests: tests/brain/test_context.py, test_store_access.py, test_reconcile.py, test_experience_bridge.py, tests/test_experience_runtime_contracts.py, benchmarks/verified_experience_benchmark.py

Recorded searches

Run from the repository root at the pinned commit with /usr/bin/git grep.

  • One tombstone writer. git grep -n 'INTO tombstones' -- wavemind returns wavemind/brain/sources.py:836.
  • The Brain audit is never changed. git grep -n -E 'DELETE FROM audit|UPDATE audit' -- wavemind returns nothing; the control git grep -n 'INTO audit' -- wavemind/brain returns store.py:275.
  • No vector in Brain. git grep -n -i -E 'embedding|encode_vector|vector' -- wavemind/brain returns nothing; the control git grep -c encode_vector -- wavemind/core.py counts 4.
  • The runtime's only evidence refusal. git grep -n llm_self_assessed -- wavemind returns experience_runtime.py:155.
  • Who exposes the runtime MCP tools. git grep -n -E 'build_experience_mcp_server\(|ExperienceMCPAdapter\(' -- . returns the definition, a docs table, the onboarding template and the admission module without a runtime, and five test calls, two of them with a runtime.
  • No tombstone in the library. git grep -n -i tombstone -- wavemind/core.py wavemind/storage.py returns nothing; the control git grep -c -i delete -- wavemind/storage.py counts 16.
  • No paper, no submodules. .gitmodules and CITATION.cff are absent; git grep -n -i -E 'arxiv|bibtex|@article|@misc|doi\.org' -- README.md docs CHANGELOG.md returns benchmark references to LoCoMo, LongMemEval and LongMemEval-V2 and two related-work links in a design spec.

History

2026-12-02 — f1b21eb0…. First reading, read at the user's request from the 2026-12-02 triage shortlist, from a shallow clone (--depth 1) at the head of main, read only; commit counts and dates come from the GitHub API. Screened: no auto-run surface; tests/conftest.py executes on pytest collection; nothing inside the cooldown, a weak check on a shallow clone; pyproject.toml without a lockfile and unpinned requirements.txt and requirements-optional.txt; two package-lock.json files unchanged for 82 days. The library, experience runtime, Brain and their tests were read; scale, replication, multimodal and research/ were not. Nothing was installed, built or run, and no test was run. Six marks (section 9).