Expand description
Optional text → facts + entities extraction, the layer that makes the graph self-build.
The Agent Memory SDK is bring-your-own-links: crate::MemoryService::remember
only stores the links the caller supplies, so a graph is only ever as rich as
what the caller wires by hand. This module adds the missing commodity on top:
an Extractor turns a paragraph of raw text into atomic facts, each tagged
with the salient topics it mentions. crate::MemoryService::remember_extracted
then stores those facts and wires the fact↔entity graph automatically, so
why() has something to traverse without any manual relate().
Mirroring the crate::embedder pattern, the plug-point is dependency-free
(bring your own LLM by implementing Extractor) while a batteries-included
OllamaExtractor backend lives behind the extractor-http feature.
Structs§
- Extracted
Attribute - One extracted entity attribute:
entity.key = value. - Extracted
Fact - One extracted, graph-ready fact: a self-contained sentence plus the salient topics it concerns. The topics become shared graph hubs, so two facts about the same topic are reachable from one another even with no textual overlap.
- Extracted
Relation - One extracted entity→entity edge:
subject -[predicate]-> object. - Extraction
- Everything one passage yields: the atomic facts, the entity→entity edges between the topics they mention, and the attributes those entities carry.
- Ollama
Extractor - Extracts facts through a local Ollama
/api/generateendpoint, keeping the model — and therefore the source text — on the user’s own machine. - Open
AiExtractor - Extracts through any OpenAI-compatible
/v1/chat/completionsendpoint. - Outline
Extractor - Deterministic, network-free extractor: it reads the structure a passage STATES instead of inferring it.
Enums§
- Extract
Error - Failure produced by an
Extractorbackend (e.g. a network-backed model that cannot be reached, or output that cannot be parsed into facts). - Extractor
Selection - What a caller must do to honour a requested extraction backend.
Constants§
- DEFAULT_
OLLAMA_ URL - Default Ollama base URL for the generative extraction endpoint.
Traits§
- Extractor
- Turns a passage of raw text into atomic, graph-ready facts.
Functions§
- select_
extractor - Resolve an extraction backend name to what the caller must do about it.
Type Aliases§
- DynExtractor
- A shared, object-safe extractor. The MCP server and the language bindings
hold one of these (an
Option), so the extraction tool can be attached at runtime without the type being generic.