Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

LLM Extraction

LLM extraction turns document content into typed edges for graph enrichment.

Provider selection, model configuration, and practical flags for tuning graph quality.

  1. Enable extraction:
Terminal window
export EXTRACTION_ENABLED=true
  1. Choose provider/model:
Terminal window
export EXTRACTION_PROVIDER=openai
export EXTRACTION_MODEL=gpt-4o-mini
  1. Run graph refresh if relationships were sparse:
Terminal window
pgm-admin reextract --type document --no-edges-only
  1. Tune neighbor expansion when you need thematic links beyond explicit mentions:
Terminal window
export EXTRACTION_SEMANTIC_NEIGHBORS_ENABLED=true
export EXTRACTION_SEMANTIC_NEIGHBORS_MIN_SIMILARITY=0.75
  • Supported providers: openai, anthropic, ollama, openai-compatible.
  • Optional semantic neighbors create related_to edges from embedding similarity.
  • Auto-creation is controlled via EXTRACTION_AUTO_CREATE_ENTITIES and type allowlists.