Skip to content

feat(memory): LLM-powered entity and relation extraction pipeline (#1225)#1247

Merged
bug-ops merged 1 commit intomainfrom
feat-m31-graph-memory-1225
Mar 5, 2026
Merged

feat(memory): LLM-powered entity and relation extraction pipeline (#1225)#1247
bug-ops merged 1 commit intomainfrom
feat-m31-graph-memory-1225

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 5, 2026

Summary

  • Add GraphExtractor with LLM-powered entity/relation extraction via chat_typed_erased, 10-rule system prompt, truncation guards, and graceful parse-failure degradation (Ok(None))
  • Add EntityResolver with case-insensitive entity resolution (exact name+type match, unknown types coerced to Concept), edge deduplication, and temporal supersession of contradictory edges
  • Add entity/relation/fact sanitization: control-character stripping (ASCII controls + BiDi overrides), length caps (512/256/2048 bytes), empty-name rejection
  • Add GraphStore::edges_exact() for unidirectional edge queries (PERF-01 fix)
  • Feature-gated behind graph-memory with explicit zeph-llm/schema dependency

Test delta: 4084 → 4094 (+33 new tests, 10 from security/perf fixes)

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes (zero warnings)
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins passes (4094/4094)
  • All 7 acceptance criteria from feat(memory): LLM-powered entity and relation extraction pipeline #1225 verified by testing engineer
  • Security audit: all 3 medium findings (SEC-GRAPH-01/02/03) fixed
  • Performance review: PERF-01 (edges_exact) fixed
  • Implementation critique: IC-01 (entity_type lowercase) fixed

Closes #1225

)

Add GraphExtractor and EntityResolver for Phase 2 of graph memory.
GraphExtractor uses chat_typed_erased for structured LLM extraction
with graceful parse-failure degradation. EntityResolver performs
case-insensitive entity resolution with unknown-type coercion to
Concept, edge deduplication, and temporal supersession. Includes
entity name sanitization (control chars, BiDi overrides, length cap),
edges_exact() for unidirectional queries, and 33 new tests.
@github-actions github-actions bot added enhancement New feature or request size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes dependencies Dependency updates and removed enhancement New feature or request size/XL Extra large PR (500+ lines) labels Mar 5, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 5, 2026 21:27
@bug-ops bug-ops merged commit 31d1133 into main Mar 5, 2026
25 checks passed
@bug-ops bug-ops deleted the feat-m31-graph-memory-1225 branch March 5, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(memory): LLM-powered entity and relation extraction pipeline

1 participant