Skip to content

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

Configuration

This page focuses on environment variables you need to run and tune Postgram.

  1. Start from .env.example and populate mandatory values.
  2. Set server/runtime settings (DATABASE_URL, PORT, LOG_LEVEL).
  3. Choose provider settings for embeddings and optional extraction.
  4. Validate startup and queue behavior with health + search checks.
VariableRequiredDefaultMeaning
DATABASE_URLyesFull Postgres connection string.
OPENAI_API_KEYconditionalRequired for OpenAI embeddings or OpenAI extraction.
PORTno3100HTTP/MCP server port.
LOG_LEVELnoinfoLogger level.
ENRICHMENT_POLL_INTERVAL_MSno1000Enrichment worker polling interval.
VariableRequiredDefaultMeaning
EMBEDDING_PROVIDERnoopenaiopenai or ollama.
EMBEDDING_MODELnoprovider-defaultEmbedding model name.
EMBEDDING_DIMENSIONSnoprovider-defaultMust match active embedding model.
EMBEDDING_BASE_URLconditionallyOLLAMA_BASE_URL fallbackFor Ollama host.
EMBEDDING_API_KEYnoOptional bearer token.

For Docker + Ollama on the host, use EMBEDDING_BASE_URL=http://host.docker.internal:11434.

VariableRequiredDefaultMeaning
EXTRACTION_ENABLEDnofalseEnable extraction pass.
EXTRACTION_PROVIDERnoopenaiopenai, anthropic, ollama, openai-compatible.
EXTRACTION_MODELnoprovider-defaultLLM model name for extraction.
EXTRACTION_BASE_URLwhen provider-compatibleBase URL for compatible OpenAI-compatible API.
EXTRACTION_API_KEYnoOptional bearer token for extraction API.
ANTHROPIC_API_KEYconditionallyRequired for Anthropic provider.
OLLAMA_BASE_URLnohttp://localhost:11434Base URL for Ollama extraction.
VariableRequiredPurpose
PGM_API_URLyespgm server URL.
PGM_API_KEYyespgm authentication token.
DATABASE_URL or PGM_DATABASE_URLyes (admin)DB access for admin commands.
PGM_BACKUP_PASSPHRASEwhen encrypted backupGPG passphrase.
  • EXTRACTION_AUTO_CREATE_ENTITIES and semantic-neighbor settings allow relationship densification without re-processing everything manually.
  • Use admin embeddings migrate when changing vector dimensions after changing model family.