Expand description
LLM fact-extraction wrapper around any oxicode_agent::tools::MemoryBackend.
When settings.memory_llm_extract = true, every put(content, …)
is sent through a structured extraction prompt and the model’s
JSON response is fanned out into one inner.put(fact_text, …)
per atomic fact.
Gap-2 design: the LLM call must run inside the async runtime.
The LLM extractor is implemented directly as an async function
that awaits the provider stream. The sync FactExtractor
trait is retained only for the heuristic path (pure CPU, no
I/O).
Failure policy: when the extractor errors, returns no facts,
or returns malformed JSON, the wrapper falls back to storing
content verbatim so memory_retain never silently drops user
input.
Structs§
- Extracted
Fact - One atomic fact returned by the LLM extractor.
- Extracting
Memory Backend - Wrapper around any
MemoryBackend. - Heuristic
Fact Extractor - Default heuristic — splits on sentence boundaries.
- LlmExtractor
- Async LLM fact extractor. Owns a
Providerand aModel.
Constants§
- STAGE_
ONE_ SYSTEM_ PROMPT - omp
stage_one_system.md, truncated to the parts that drive our extraction contract (we don’t needrollout_slughere — we only store a flat list of facts). - STAGE_
ONE_ USER_ TEMPLATE - omp
stage_one_input.mduser template ({{content}}).
Traits§
- Fact
Extractor - Sync, no-IO extractor (heuristic). Safe to call anywhere.
Functions§
- try_
make_ llm_ extractor - Resolve the LLM extractor from the wired
Oxicodeengine. ReturnsNonewhen the user hasn’t configuredmemory_llm_extract_modelor the pattern doesn’t resolve. - wrap_
with_ extractor - Wire the wrapper on top of an existing memory backend.