Skip to content

Finding a base's name facts without vectors reads only its name facts (#1318, ahead of upstream) - #10

Merged
gedaiu merged 2 commits into
re-devfrom
rc/name-facts-by-predicate
Oct 19, 2026
Merged

gedaiu merged 2 commits into
re-devfrom
rc/name-facts-by-predicate

Conversation

@gedaiu

@gedaiu gedaiu commented Oct 19, 2026

Copy link
Copy Markdown

Brings deeplethe#1318 into re-dev ahead of upstream's review, so Lore can run it now. Its head e2557d62 is cherry-picked unchanged. name_vectors::pending finds a base's live known_as facts without vectors through an index on (kb_id, predicate_id, id) WHERE invalidated_at IS NULL, instead of reading every fact of the base by id. That's 200,000 rows per document on a 200,000-fact base, for a handful of names.

Fork adaptation, one commit. Upstream's migration 0115 is 9001_a_name_fact_is_found_by_its_predicate.sql here (RE-CINQ.md: fork migrations from 9000, idempotent). It has the same CREATE INDEX IF NOT EXISTS facts_live_predicate_idx …, the name and columns name_vectors_plan_tests.rs asserts. When a sync brings 0115, whichever runs second is a no-op, and CURRENT_SCHEMA_VERSION is recounted then (105). It is 104 now: 102 upstream files, 9000 and 9001.

re-dev's fork job that fills name vectors once per base (0c56fd13) still calls pending with the same signature. deeplethe#1318 only rewrites its SQL. Whether that job is still needed now that this index exists is a separate decision.

Checked with the author session (utopia-8b), which isn't changing deeplethe#1318.

🤖 Generated with Claude Code

gedaiu and others added 2 commits October 19, 2026 10:23
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Bogdan Szabo <[email protected]>
(cherry picked from commit 8ed5ef6)
@gedaiu
gedaiu force-pushed the rc/name-facts-by-predicate branch from 80aad17 to 040eed1 Compare October 19, 2026 08:23
@gedaiu
gedaiu merged commit de0d240 into re-dev Oct 19, 2026
6 checks passed
gedaiu added a commit to re-cinq/lore that referenced this pull request Oct 19, 2026
0.1.0-re.16 = re.15 + re-cinq/utopia#10 (a base's name facts are read
through a predicate index, fork migration 9001) + #12 (containment
recall: JIT off, alias facts through that index, a pg_trgm index on
entity names in fork migration 9002, and the reverse branch matched by
the mention's substrings). Containment took 1.1 s per call on
re-cinq/lore's base and pinned the Utopia DB during memory extraction;
seeded at the same size it now takes ~15 ms.

Tag `v0.1.0-re.16` (re-dev `807cd59f`), digest
`sha256:04294e27650ddb17b1884bce6b8d9f2384afd2075e3b0e58094c8519fcfbd1a6`.
Two migrations run on start. Needs a terraform apply from main.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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