Skip to content

fix(memory): MAGMA entity type prompt/enum mismatch — "technology" not recognized #2079

@bug-ops

Description

@bug-ops

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:

  1. LLM correctly follows the prompt and returns "technology" for programming languages, frameworks, tools (Rust, SQLite, gpt-4o-mini etc.) — but the EntityType parser doesn't know "technology", logs graph resolver: unknown entity type "technology", falling back to Concept and classifies them as Concept
  2. "tool", "language", "file", "config" variants exist in the enum but are never generated by the LLM because they are not listed in the prompt
  3. 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.rs lines 13–53
  • EntityType enum: crates/zeph-memory/src/graph/types.rs lines 62–117
  • Resolver fallback: crates/zeph-memory/src/graph/resolver/mod.rs lines 133–144

Severity

Medium — entity classification degrades silently, no crash or data loss. Affects BFS entity-type-aware queries and future type-based filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmemoryzeph-memory crate (SQLite)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions