Skip to content

feat(memory): add holographic fact store and MCP tools - #11

Merged
ScriptedAlchemy merged 17 commits into
masterfrom
split/holographic-memory-core
Jun 8, 2026
Merged

feat(memory): add holographic fact store and MCP tools#11
ScriptedAlchemy merged 17 commits into
masterfrom
split/holographic-memory-core

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Add the Rust-native holographic memory store, encoding, retrieval, trust scoring, and migrations.
  • Expose fact storage/feedback/status and project-local transcript message search through MCP.
  • Add memory, migration, MCP handler, and Cursor transcript ingestion tests.

Test plan

  • cargo fmt --check
  • cargo test --test mcp_handler_test message_search_reads_project_local_session_db
  • cargo test --test cursor_transcript_ingest_test
  • cargo test --test memory_test
  • cargo test --test migration_test
  • cargo check

Stacked on #10.

@changeset-bot

changeset-bot Bot commented Jun 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6103418

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 487f76fa08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/memory/retrieval.rs
Comment thread src/memory/store.rs
ScriptedAlchemy added 8 commits June 8, 2026 01:47
Eliminate the per-id N+1 round-trips in the holographic search/probe/reason
paths by adding batched MemoryStore::get_facts and fact_vectors (chunked at
256 to stay under SQLite's 999-parameter limit). search now hydrates missing
candidates and preloads candidate vectors in single batched queries, and
holographic scoring becomes a pure helper fed those preloaded vectors;
results_for_fact_ids does one batched fetch while iterating the original id
order so probe/reason ordering is preserved. Worst case drops from ~1,100
round-trips to ~6.

Also bind the user-derived strings in reason and entity_candidates as
anonymous ? placeholders instead of interpolating string literals (escape_like
still governs LIKE wildcards, now bound rather than inlined), and factor the
repeated BEGIN IMMEDIATE/COMMIT/ROLLBACK boilerplate in add_fact, update_fact,
remove_fact, and record_feedback_event into a with_immediate_tx combinator.
Behavior is unchanged; all memory tests pass.
Cursor transcript ingestion previously re-read the whole transcript and
re-upserted every message on every beforeSubmitPrompt, which is O(n^2) over a
session under the 5s hook budget. Make ingestion incremental: resume from the
byte offset tracked in the project session DB's parse_offsets table (mirroring
the Claude accounting parser), seek + stream only newly-appended lines, and
upsert just those. Handle truncation/rewrite (restart at offset 0) and a
partial final line at EOF (defer until newline-terminated). Session start
time and title are preserved across appends; ended_at advances to the latest
message.

Move the bulk catch-up off the hot path: register a Cursor stop hook
(end-of-turn, generous timeout) as the primary ingest point and also ingest on
sessionStart for resumed sessions. beforeSubmitPrompt now does at most a small
tail read, bounded by a byte cap and wrapped in tokio::time::timeout so it
fails open and can never exceed the prompt budget; the ingest runs inline
(not a detached task) since CLI hook processes exit immediately. Upserts stay
idempotent via INSERT ... ON CONFLICT, so concurrent short-lived hooks
converge to the same rows.

Behavioral change: re-ingesting an unchanged transcript is now a no-op, and
the message ordinal/fallback id derives from the line's byte offset rather
than a dense line index. Tests updated/added for the no-op, incremental
append, and partial-line cases, plus the new stop-hook registration.
Introduce a shared TranscriptSource driver that persists ByteOffset,
ContentHash, and RowCursor progress through the existing parse_offsets table,
then refactor Cursor ingestion onto it without changing its hook behavior.
The driver centralizes idempotent session/message upserts, source offsets,
partial-line handling, full-rewrite content hashes, and row-cursor support.

Add serve-side catch-up ingestion for hookless, path-discoverable adapters and
implement the feasible sources verified in this pass: Claude Code JSONL,
Codex rollout JSONL, Mistral Vibe messages.jsonl, and the Cline/Roo/Kilo
full-rewrite task-history stores. Gemini transcript ingestion is intentionally
omitted per user request; Hermes remains excluded.

Add focused fixture tests for every integrated adapter plus framework tests for
ByteOffset, ContentHash, and RowCursor cursor behavior.
Ensure Cline-family transcript fixtures are written under the same OS-specific VS Code data root that the provider scans, so macOS CI exercises the intended ingest path.
@ScriptedAlchemy
ScriptedAlchemy changed the base branch from split/holographic-cursor-local-base to master June 8, 2026 02:10
Align message-search providers with ingested session sources, bound transcript storage and catch-up reads, and ensure memory transactions roll back when COMMIT fails.
@ScriptedAlchemy
ScriptedAlchemy merged commit 6ce367e into master Jun 8, 2026
5 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the split/holographic-memory-core branch July 4, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant