Foresight.EntityExtractors.LLM (Foresight v0.1.0)

Copy Markdown View Source

LLM-backed fallback entity extractor (the last C2 slice).

Used ONLY on the path where retain-time atomic-fact extraction is off, so items carry no fact.entities and the seam would otherwise fall back to the regex Simple. It asks a complete_json_schema/4-capable LLM for the salient named entities in the content.

This is a Foresight convenience, not a Hindsight port: Hindsight's slim path has no standalone NER pass — its entities come from fact.entities. Faithful to the rest of the pipeline's LlmCore isolation, it DEGRADES to Simple when the LLM is absent/incapable, on any error, timeout, or unparseable result — extraction never fails a retain. A COMPETENT empty result ({"entities": []}) is respected as "no entities" and returned as [], not backfilled with regex noise, mirroring the fact.entities or [] discipline in Retain.FactExtraction.