Skip to content

Search Results Now Show Graph Affordances

July 2, 2026

Postgram search now gives agents a cheap signal when a result has graph context behind it. Compact REST, MCP, and CLI search output may include an edges summary with a total count and relation labels. That lets an agent notice connected context without immediately pulling neighbor content into the prompt.

The result is a smaller, more deliberate retrieval loop: search first, inspect the edge summary, then expand only when the user’s question actually needs graph context.

Postgram PR #77 adds search edge affordances across the main agent surfaces:

  • POST /api/search can include edges.count and edges.relations on search results.
  • MCP search compact output preserves the same edge summary.
  • pgm search --json and pgm search --toon include the summary when edges exist.
  • The MCP tool description now tells agents when to use expand_graph.
  • CLI --version handling was tightened while shipping the same release window.

Example compact search result:

{
"id": "mem_123",
"type": "memory",
"score": 0.82,
"content": "Decision note...",
"chunk": "Decision note...",
"edges": {
"count": 3,
"relations": [
{ "relation": "mentioned_in", "count": 2 },
{ "relation": "blocked_by", "count": 1 }
]
}
}

The summary intentionally does not include neighbor content. It only says that traversable context exists.

Use the compact edge summary as a routing hint:

  • Expand when the question asks about causes, provenance, decisions, dependencies, blockers, ownership, involvement, related discussions, or ambiguous search hits.
  • Skip expansion when the compact result already answers a direct factual question.
  • Use expand_graph: true, pgm search --expand-graph, or pgm expand <id> when connected context is actually needed.

This keeps common recall cheap while still making graph context discoverable.