Skip to content

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

Hybrid Search

Postgram blends lexical and semantic retrieval so queries can match both exact terms and semantic intent.

This page explains the default ranking model, fallbacks when embedding is unavailable, and practical search options for humans and agents.

  1. Call search via REST:
Terminal window
curl -X POST http://127.0.0.1:3100/api/search \
-H "Authorization: Bearer $PGM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"private knowledge graph", "limit":20}'
  1. Or use CLI with optional filters:
Terminal window
pgm search "private knowledge graph" --type=memory --limit 20
  1. Expand graph context in result review:
Terminal window
pgm search "pgvector" --expand-graph
  1. For agent UIs, request compact output (--toon) or compact JSON when chaining results.
  • Default blend is 60% vector and 40% BM25, with recency-aware score adjustments.
  • If embeddings are unavailable, search falls back to BM25-only mode.
  • API responses include ranked results plus optional chunk text, similarity, and final score.