Put events in order
Attach a timestamp to each event so your application can reconstruct the sequence of the work.
Episodic memory is your agent’s history of what happened. Record a conversation, a decision, or an outcome, then recall it with its time and source. The next interaction can build on the last one.
Episodic memory
Monday · 10:08
The pilot moved forward after the accessibility review was completed.
Recall the outcome and the events behind it. Bring that history into your agent’s next response.
Fictional conversations illustrate how an application can store events and present their sources.
A customer changed their requirements on Tuesday. The team chose a new approach on Friday. Save both moments, with their sources, so the next conversation has a history to draw from.
Attach a timestamp to each event so your application can reconstruct the sequence of the work.
Label observations, decisions, errors, and other events. Search for the kind of experience you need.
Mark whether something was observed, reported, or inferred. A recollection keeps its source context.
Record whether an experience was positive, negative, neutral, or mixed alongside what happened.
Importance scores help separate significant experiences from routine activity during retrieval and consolidation.
Connect stored episodes to auditable forgetting, with a record of the reason for removal.
Record an investigation decision with its source and timestamp, then search for it by topic. Your application chooses which moments become part of the agent’s history.
// Run server-side with credentials scoped to this Mind.
const endpoint = process.env.AKASHA_URL;
const capability = process.env.AKASHA_CAPABILITY;
if (!endpoint || !capability) throw new Error("Configure your Mind connection");
async function request(method: string, path: string, body?: unknown) {
const headers: Record<string, string> = {
"Content-Type": "application/json",
"x-akasha-capability": capability!,
};
if (process.env.AKASHA_TOKEN) {
headers.Authorization = "Bearer " + process.env.AKASHA_TOKEN;
}
const response = await fetch(new URL(path, endpoint), {
method, headers,
body: body === undefined ? undefined : JSON.stringify(body),
});
if (!response.ok) throw new Error("Mind request failed: " + response.status);
return response.json();
}
await request("POST", "/v1/memory/episodic", {
event: {
id: crypto.randomUUID(), event_type: "Decision",
content: "Investigate the Q3 revenue change by sales channel.",
timestamp: new Date().toISOString(), source: "Quarterly review",
context: { project: "Q3 review" }, participants: [],
importance: 0.7, tags: ["revenue", "Q3"], related_events: [],
},
});
const events = await request("POST", "/v1/memory/episodic/search", {
text: "Q3 revenue", limit: 20,
});Give your agent a history it can return to, from the first question to the final decision.