LLM Extraction
LLM extraction turns document content into typed edges for graph enrichment.
What this page covers
Section titled “What this page covers”Provider selection, model configuration, and practical flags for tuning graph quality.
Core workflow
Section titled “Core workflow”- Enable extraction:
export EXTRACTION_ENABLED=true- Choose provider/model:
export EXTRACTION_PROVIDER=openaiexport EXTRACTION_MODEL=gpt-4o-mini- Run graph refresh if relationships were sparse:
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.