Onboarding memory
Collect user context at sign-up and batch-ingest it so your app is personalised from the first message — no waiting for organic conversation.
Note
The idea: most apps have a sign-up or onboarding flow that collects role, goals, experience level, preferences. Ingest all of it at once. The user's memory profile is ready before they send their first message.
Why use batch ingest at onboarding
The standard POST /v1/ingest handles one item per call. For onboarding where you're writing 5–20 facts at once, POST /v1/ingest/batch sends them all in a single HTTP request and triggers synthesis once.
Single ingest × 10
10 HTTP calls, synthesis triggered 10 times. Fine for conversation, wasteful for onboarding.
Batch ingest × 1
1 HTTP call, synthesis triggered once. The right choice when you have the data upfront.
Batch ingest endpoint
shell
POST https://anansimemory.com/v1/ingest/batch
Authorization: Bearer ans_your_key
Content-Type: application/json
json
{
"items": [
{
"userId": "user_abc",
"content": "Role: Senior backend engineer. Focus area: distributed systems and event-driven architecture.",
"sourceType": "onboarding",
"metadata": { "step": "role" }
},
{
"userId": "user_abc",
"content": "Primary goal: reduce API latency below 100ms p99 in production Kubernetes cluster.",
"sourceType": "onboarding",
"metadata": { "step": "goal" }
},
{
"userId": "user_abc",
"content": "Tech stack: Node.js, TypeScript, BullMQ, Postgres, Redis, GKE.",
"sourceType": "onboarding",
"metadata": { "step": "stack" }
},
{
"userId": "user_abc",
"content": "Prefers: concise technical answers, no preamble, code examples over prose.",
"sourceType": "onboarding",
"metadata": { "step": "preferences" }
}
]
}
{
"queued": 4,
"ids": [
"api:ws_xyz:user_abc:a1b2c3",
"api:ws_xyz:user_abc:d4e5f6",
"api:ws_xyz:user_abc:g7h8i9",
"api:ws_xyz:user_abc:j0k1l2"
]
}
Onboarding wizard example
Wire batch ingest to the final step of your onboarding wizard — after the user completes all the steps, send everything at once:
typescriptonboarding.ts
"kw">const ANANSI_URL = "https:">class="cm">//anansimemory.com";
"kw">const ANANSI_KEY = process.env.ANANSI_API_KEY!;
"kw">interface OnboardingAnswers {
userId: "kw">string;
role: "kw">string;
goal: "kw">string;
stack: "kw">string;
experience: "kw">string;
preferences: "kw">string;
}
"kw">export "kw">async "kw">function ingestOnboarding(answers: OnboardingAnswers) {
"kw">const items = [
{ content: `Role: ${answers.role}`, metadata: { step: "role" } },
{ content: `Primary goal: ${answers.goal}`, metadata: { step: "goal" } },
{ content: `Tech stack: ${answers.stack}`, metadata: { step: "stack" } },
{ content: `Experience level: ${answers.experience}`, metadata: { step: "experience" } },
{ content: `Communication preferences: ${answers.preferences}`, metadata: { step: "preferences" } },
].map((item) => ({
userId: answers.userId,
sourceType: "onboarding",
...item,
}));
"kw">const res = "kw">await fetch(`${ANANSI_URL}/v1/ingest/batch`, {
method: "POST",
headers: {
Authorization: `Bearer ${ANANSI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ items }),
});
"kw">if (!res.ok) "kw">throw "kw">new Error(`Anansi batch ingest failed: ${res.status}`);
"kw">return res.json(); "kw">class="cm">// { queued: 5, ids: [...] }
}
"kw">class="cm">// Call this at the end of your onboarding flow
"kw">await ingestOnboarding({
userId: req.user.id,
role: "Senior backend engineer — distributed systems",
goal: "Reduce API latency below 100ms p99 in production",
stack: "Node.js, TypeScript, BullMQ, Postgres, Redis, GKE",
experience: "10 years backend, 2 years on this codebase",
preferences: "Concise answers, code examples, no preamble",
});
Tip
Synthesis happens once: Even if you batch 20 items, synthesis is triggered once after all items are ingested. The user's profile is ready within seconds of completing onboarding.
What to collect during onboarding
| Category | Example questions | Why it matters |
|---|
| Role | "What's your job title / team?" | Informs the expertise level Anansi synthesizes |
| Goal | "What are you trying to accomplish?" | Surfaces as dynamic context immediately |
| Stack | "What technologies do you use?" | Enables tech-specific suggestions |
| Preferences | "How do you like answers formatted?" | Shapes every future LLM response style |
| Experience | "How long have you been doing this?" | Calibrates depth of explanations |