-
Notifications
You must be signed in to change notification settings - Fork 2
fix(memory): MAGMA entity type prompt/enum mismatch — "technology" not recognized #2079
Description
Problem
The MAGMA graph extractor's system prompt and the EntityType Rust enum use different taxonomies, causing entity type classification failures.
Extraction prompt (tells LLM to use):
person | project | technology | organization | concept
EntityType enum (actual code):
Person | Tool | Concept | Language | Organization | Project | File | Config
Consequences:
- LLM correctly follows the prompt and returns
"technology"for programming languages, frameworks, tools (Rust, SQLite, gpt-4o-mini etc.) — but theEntityTypeparser doesn't know"technology", logsgraph resolver: unknown entity type "technology", falling back to Conceptand classifies them asConcept "tool","language","file","config"variants exist in the enum but are never generated by the LLM because they are not listed in the prompt- Entity type granularity is lost — all technologies get classified as Concept
Reproduction (CI-39, 2026-03-21):
RUST_LOG=debug cargo run --features full -- --config .local/config/testing.toml
Prompt: "Alice works on the Zeph project using Rust and SQLite."
Log:
graph resolver: unknown entity type "technology", falling back to Concept (×9 in session)
Expected
Prompt and enum should be in sync. One of:
Option A (preferred — align prompt to enum):
Update the extraction prompt to use person | project | tool | language | organization | concept matching the actual enum variants. Add a note: "tool" covers frameworks and software tools, "language" covers programming languages.
Option B (add Technology to enum):
Add Technology variant to EntityType with "technology" parse string, and update Display/FromStr.
Files
- Extraction prompt:
crates/zeph-memory/src/graph/extractor.rslines 13–53 - EntityType enum:
crates/zeph-memory/src/graph/types.rslines 62–117 - Resolver fallback:
crates/zeph-memory/src/graph/resolver/mod.rslines 133–144
Severity
Medium — entity classification degrades silently, no crash or data loss. Affects BFS entity-type-aware queries and future type-based filters.