Give an agent company context
Warm-start an agent session and ground its answers in company history.
A typical agent turn uses three calls. Give the agent's key context:read, search:read, rules:read and read access to the resources it should search.
Load the rulebook and what's in flight
const headers = { Authorization: `Bearer ${process.env.SYNQED_API_KEY}` };
const [rules, context] = await Promise.all([
fetch('https://api.synqed.dev/v1/rules', { headers }).then((r) => r.json()),
fetch('https://api.synqed.dev/v1/context', { headers }).then((r) => r.json()),
]);Put both in the system prompt. context.people is included when the key has people:read.
Search before answering
const search = await fetch('https://api.synqed.dev/v1/search', {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: userQuestion, limit: 8 }),
}).then((r) => r.json());
const sources = search.data.map((h) => `[${h.resource}/${h.id}] ${h.snippet}`).join('\n');Restrict to some resources with "resources": ["tickets", "discussions"], or to recent records with "since": "2026-01-01T00:00:00Z". Each hit includes the full record, shaped like its resource.
Write back what was decided
await fetch('https://api.synqed.dev/v1/memories', {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json', 'Idempotency-Key': taskId },
body: JSON.stringify({
kind: 'decision',
title: 'Retry Stripe webhooks with exponential backoff',
body: 'Stripe redelivers for 3 days; we retry 5× with jitter, then dead-letter to the ops queue.',
}),
});This needs memories:write. The next agent's search finds it.
Ground, don't obey
Search results contain text written by third parties — Slack messages, ticket descriptions, meeting notes. Present them to your model as reference data, and don't let that text trigger tool calls on its own.