Hybrid Search
Postgram blends lexical and semantic retrieval so queries can match both exact terms and semantic intent.
What this page covers
Section titled “What this page covers”This page explains the default ranking model, fallbacks when embedding is unavailable, and practical search options for humans and agents.
Core workflow
Section titled “Core workflow”- Call search via REST:
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}'- Or use CLI with optional filters:
pgm search "private knowledge graph" --type=memory --limit 20- Expand graph context in result review:
pgm search "pgvector" --expand-graph- 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.