Agents that answer from the policy in force today
The HR agent confidently quotes the parental leave policy. It is the one from 2024. The current one is in the same drive, one folder over, with a very similar title.
The mixture
- 01 · Persistent memory
- Light
- 02 · Current context
- Leads
- 03 · Traceable decisions
- Uses
- 04 · Shared context
- Uses
- 05 · Scoped retrieval
- Uses
Three versions of every policy
Internal knowledge bases do not fail because the answer is missing. They fail because four answers are present and only one is true.
- 01
Old and new look identical to search
The superseded policy and the current one share ninety per cent of their words. Similarity cannot tell them apart, so the agent returns whichever chunk scored higher.
- 02
Nobody deletes, everybody uploads
Policy updates arrive as new files. The old ones stay, because someone might need them. The agent reads all of them as equally true.
- 03
Regional variants collide
The India leave policy and the US leave policy both answer "how many days do I get." Without scope, the employee in Bengaluru gets the California answer.
Mostly current context. Then three others.
Every application on Alchemyst is a different mixture of the same five jobs. That mixture is what makes this a different piece of software from the one next to it, even though the API underneath is identical.
Only the version in force reaches the window
Each policy is stored with a stable fileName. When it changes, the old version is removed and the new one added, so the two never compete. Subtraction runs before ranking, and only the version in force reaches the window.
- Superseded versions never reach the model.
- Region and entity scopes are enforced.
- Updates land without re-indexing everything.
Uses · Scoped retrieval
This employee's policy
Region, entity and employment type are intersected, so the answer fits the person asking.
Uses · Traceable decisions
Which document said so
Every answer carries the policy file it came from, for HR to verify.
Uses · Shared context
HR, IT and Finance agree
Benefits, laptops and expenses agents read one set of definitions.
That is four of the five. The fifth, persistent memory (preferences and corrections survive the session, the handoff and the model swap), is what leads in Assistant agents, Commerce agents and EdTech & tutoring instead. Same API, different mixture.
The sources you already have
Bring sources in through the data-source integrations (PostgreSQL, MongoDB, Google Docs, Google Sheets, Amazon S3), an n8n workflow, or a direct context.add call. Each one lands scoped, so retrieval can intersect it with everything else.
01 · Ingest
Scope what you ingest
Every document lands with a groupName: the sets it belongs to. Those sets are what retrieval intersects later, so the structure you choose here is the precision you get there.
context.addimport AlchemystAI from "@alchemystai/sdk";const client = new AlchemystAI(); // reads ALCHEMYST_AI_API_KEYawait client.v1.context.add({ context_type: "resource", scope: "internal", source: "hr-policies/leave-in", documents: [{ content: "Parental leave (India), effective 1 April 2026: 26 weeks for birthing parents, 8 weeks for non-birthing parents.", }], metadata: { fileName: "leave-policy-in.md", groupName: ["hr", "policy", "india"], // the sets this belongs to },});02 · Write
Replace the policy, do not append it
Policies change by replacement. Delete the superseded version, then add the new one under the same fileName, so the old text can never outrank the new.
context.delete → context.add// Same fileName without a delete returns 409 Conflict, by design.await client.v1.context.delete({ organization_id: ORG_ID, source: "hr-policies/leave-in", by_doc: true,});await client.v1.context.add({ context_type: "resource", scope: "internal", source: "hr-policies/leave-in", documents: [{ content: updatedPolicy }], metadata: { fileName: "leave-policy-in.md", groupName: ["hr", "policy", "india"], lastModified: "2026-04-01T00:00:00Z", },});03 · Search
Search before answering
Search intersects the scopes, subtracts superseded and duplicate content, and ranks what survives. Only that reaches the model, and the whole decision is recorded as a Context Trace.
context.searchconst { contexts } = await client.v1.context.search({ query: "How much parental leave do I get?", scope: "internal", similarity_threshold: 0.8, minimum_similarity_threshold: 0.5, metadata: { groupName: ["hr", "policy", "india"] }, // ∩ narrow scope});// − superseded, deduplicated → ranked → into the window// Every search is recorded as a Context Trace.const reply = await llm.respond(message, { context: contexts });
npm install @alchemystai/sdk or pip install alchemystai, both ship the same client. Full reference in the docs.
Policy questions are employee data
Employees ask about leave, health, pay and performance. The questions, and the answers, are personal data. Keep them scoped per employee and region, encrypted, and deletable, with SSO in front of every agent that can read them.
Security & complianceManaged cloud
Encrypted in transit and at rest, isolated per organization, and scoped at write time.
Dedicated infrastructure
EnterpriseSingle-tenant, with VPC peering when your data cannot share a network boundary.
Self-hosted
On-premiseRun the context layer on your own infrastructure, with OpenTelemetry for observability.
The same API, a different mixture
Each of these leads with a different job, pulls from a different set of sources and needs a different call. All of them, by job.
Bring the policy question it gets wrong.
The one where the answer was right two years ago.