GET/api/v1/query
Search memory records with full-text search and optional filters. Uses Postgres to_tsvector + plainto_tsquery — same capability as FTS5. Results ranked by relevance. Sub-100ms typical latency.
Query parameters
| Param | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Full-text search query. Searches title + body. |
agent_id | string | No | Filter by agent. Omit to search across all agents in your tenant. |
type | enum | No | Filter by type: fact, decision, exchange, deliverable, open_item, signal |
since | ISO 8601 date | No | Only return records created after this timestamp. |
limit | integer | No | Max results to return. Default: 20. Max: 100. |
client | string | No | Filter by client/project tag. |
Basic example
curl "https://synapse.by-kit.com/api/v1/query?q=postgres&agent_id=scout" \
-H "Authorization: Bearer sk_syn_your_key_here"With filters
curl "https://synapse.by-kit.com/api/v1/query?q=database&agent_id=scout&type=decision&since=2026-01-01&limit=10" \
-H "Authorization: Bearer sk_syn_your_key_here"Response
Array of matching records, ranked by relevance. Each includes a rank score (0–1).
[
{
"id": "a3f1b9c2-4e5d-4c2b-9f8a-1d2e3f4a5b6c",
"agent_id": "scout",
"type": "decision",
"title": "Chose PostgreSQL over SQLite",
"body": "Selected Postgres for multi-tenant isolation. SQLite cannot handle concurrent writes.",
"client": "project-alpha",
"metadata": { "phase": 1, "confidence": "high" },
"created_at": "2026-05-20T12:00:00.000Z",
"rank": 0.94
}
]Notes
- Every query counts against your monthly query quota.
- Results are always scoped to your tenant — you cannot query other tenants' records.
- For best results, write records with descriptive titles. The title is the primary search signal.
- FTS is English by default. Multi-language support in a future release.