LLM Extraction
LLM extraction turns source content into typed edges for graph enrichment. Memory entities are embedded for recall by default, but graph extraction for memory is opt-in.
What this page covers
Section titled “What this page covers”Provider selection, model configuration, and practical flags for tuning graph quality, including memory-specific extraction policy.
Core workflow
Section titled “Core workflow”- For Docker Compose, set extraction in Admin Config, then save, validate, and apply it. For a non-Compose local process, set the environment before starting the server:
export EXTRACTION_ENABLED=true- Choose provider/model:
export EXTRACTION_PROVIDER=openaiexport EXTRACTION_MODEL=gpt-4o-mini- Leave memory extraction in semantic-recall mode unless you explicitly want memory-derived graph edges:
export EXTRACTION_MEMORY_MODE=embed_onlyUse extract_durable to extract only durable_memory, or extract_all to
extract both durable memory and session context.
- Run graph refresh if relationships were sparse:
./bin/pgm-admin reextract --type document --no-edges-only- Tune neighbor expansion when you need thematic links beyond explicit mentions:
export EXTRACTION_SEMANTIC_NEIGHBORS_ENABLED=trueexport EXTRACTION_SEMANTIC_NEIGHBORS_MIN_SIMILARITY=0.75- Supported providers:
openai,anthropic,ollama,openai-compatible. - Optional semantic neighbors create
related_toedges from embedding similarity. - Auto-creation is controlled via
EXTRACTION_AUTO_CREATE_ENTITIESand type allowlists. EXTRACTION_MEMORY_MODE=embed_onlykeeps all memories searchable through embeddings without graph/entity extraction.EXTRACTION_MEMORY_MODE=extract_durableextracts only durable memories.EXTRACTION_MEMORY_MODE=extract_allextracts durable memories and session context.