Skip to content

feat(askai): add Agent Studio memory support#2888

Merged
8bittitan merged 1 commit into
v5from
feat/agent-studio-memory-support
Jun 1, 2026
Merged

feat(askai): add Agent Studio memory support#2888
8bittitan merged 1 commit into
v5from
feat/agent-studio-memory-support

Conversation

@8bittitan
Copy link
Copy Markdown
Contributor

@8bittitan 8bittitan commented May 29, 2026

Why

Agent Studio can now persist and recall user-specific context across conversations through its memory feature. Without support in DocSearch, these memory operations were invisible to users, the agent would silently store and retrieve memories with no feedback, and there was no way to scope memory to an authenticated user.

This PR makes the memory feature first-class in the Ask AI experience so that:

  • Users get feedback when memory is used. Memory tool calls (algolia_ponder, algolia_memorize, algolia_memory_search) now surface clear messaging ("Saved to memory" / "Used memory to enhance results") instead of being dropped as unrecognized tool calls. This is opt-in via memory.enabled to avoid changing behavior for integrations that don't use it.
  • Memory can be tied to a specific user. A memory.userToken (JWT) is forwarded as the x-algolia-secure-user-token header so the agent reads/writes the correct user's memory, enabling per-user personalization without leaking memory across users.

Notes

  • Translations for the new memory messages are exposed and overridable for i18n.
  • Custom tool renderers still take precedence over the built-in memory rendering, preserving existing override behavior.
  • The shared ToolState primitive was extracted so the new MemoryTool and existing SearchTool render consistently.

Testing

  • Enable memory support for your agent on the Algolia Dashboard (docs)
  • Enable showing the memory tool calls on the DocSearch UI memory.enabled = true
  • Use something like jwt.io's (Agent Studio docs) encoder to generate a JWT to use and pass it through props memory.userToken = JWT

Screenshots

Screenshot 2026-05-29 at 12 59 13 PM

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for docsearch-demo failed.

Name Link
🔨 Latest commit 505f391
🔍 Latest deploy log https://app.netlify.com/projects/docsearch-demo/deploys/6a19cb940a108400080426ac

@codacy-production
Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:

⚠ 1 issue (≤ 0 issues of at least high severity)

Results:
1 new issue

Category Results
Security 1 high

View in Codacy

🟢 Metrics 104 complexity · 7 duplication

Metric Results
Complexity 104
Duplication 7

View in Codacy

TIP This summary will be updated as you push new changes.

Comment thread packages/docsearch-react/src/useAskAi.ts
@8bittitan 8bittitan merged commit 0101c92 into v5 Jun 1, 2026
6 of 11 checks passed
@8bittitan 8bittitan deleted the feat/agent-studio-memory-support branch June 1, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants