feat: lat.md integration, knowledge cross-references, and integrity checking#65
Merged
feat: lat.md integration, knowledge cross-references, and integrity checking#65
Conversation
…hecking Add three new capabilities inspired by lat.md's knowledge graph approach: 1. lat.md/ directory reader — automatically indexes sections from lat.md/ files into FTS5, includes them in recall results via RRF fusion, and injects relevant sections into the system prompt alongside LTM entries. Content-hash-based change detection skips unchanged files. 2. Knowledge cross-references — entries can link to each other via [[uuid]] (curator, O(1) lookup) or [[Title Text]] (human edits, FTS5 search). Refs are tracked in a knowledge_refs join table. Dead refs are cleaned automatically when entries are deleted or consolidated. 3. Integrity checking — ltm.check() detects duplicate entries, oversized content, and empty entries. Runs after curation/consolidation on idle. DB migration 10 adds lat_sections + FTS5 and knowledge_refs tables. Bumps version to 0.8.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lat.md/ reader: Automatically indexes sections from lat.md knowledge graph files. Sections are FTS5-indexed and included in recall results via RRF fusion. Relevant sections are injected into the system prompt alongside LTM entries. Content-hash-based change detection skips unchanged files on re-scan.
Knowledge cross-references: Entries can link to each other with
[[uuid]](curator — O(1) lookup) or[[Title Text]](human AGENTS.md edits — FTS5 search). Tracked inknowledge_refsjoin table. Dead refs are auto-cleaned when entries are deleted or consolidated.Integrity checking:
ltm.check()detects duplicate entries (by FTS5 title similarity), oversized content (>1200 chars), and empty entries. Runs after curation/consolidation on idle.Changes
src/lat-reader.tssrc/db.tslat_sections+ FTS5 +knowledge_refstablessrc/reflect.tslat-sectionsource in RRF fusionsrc/ltm.tsresolveRef,extractRefs,syncRefs,cascadeRefReplace,cleanDeadRefs,check(), lat.md sections inforSession()src/index.tssrc/curator.tssyncRefsafter create/updatesrc/prompt.tssrc/search.tsfilterTerms()README.mdpackage.jsontest/lat-reader.test.tstest/refs.test.tstest/integrity.test.ts329 tests pass, 0 failures.