Skip to content

feat(agent-memory): Adds UI for exploring Agent memory - #6228

Open
booleanhunter wants to merge 1 commit into
redis:mainfrom
booleanhunter:feat/agent-memory-inspector
Open

feat(agent-memory): Adds UI for exploring Agent memory#6228
booleanhunter wants to merge 1 commit into
redis:mainfrom
booleanhunter:feat/agent-memory-inspector

Conversation

@booleanhunter

@booleanhunter booleanhunter commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Adds an Agent Memory home tab and explorer for OSS and Redis Cloud endpoints for Agent Memory.

Home tab:

  • Manage agent memory endpoints for two backends: the OSS agent-memory-server and the Redis Cloud agent memory service.

Overview screen:

  • working memory for a selected user/namespace/session: messages with roles, timestamps, extraction status, session TTL, running summary; inject events (can create new sessions); clear a session
  • Long-term memories for the selected scope.
  • Adds opt-in auto-refresh

Long-term memory screen:

  • Search records: semantic + keyword search, filters (user/owner, namespace, sessions, memory type, topics, entities),
  • click-to-filter cards, per-record delete
  • summary views panel: browse LLM-computed profiles, recompute a profile, generate an empty view, create/delete views.
  • Adds opt-in auto-refresh

Configuration screen: Memory Store settings

Backend:

  • new NestJS module with encrypted endpoint storage

Tech decisions:

  • Uses Official SDKs: agent-memory-client (OSS) and @redis-iris/agent-memory (Cloud) (new API dependencies)
  • Direct HTTP for the few calls the SDKs don't cover.
  • Responses normalized to one shape so the UI is backend-agnostic; a capability model hides unsupported features per backend (e.g. Cloud has no summary views/namespaces).

References #6266

Screenshots and Recording

RAM-explorer.Redis.Insight.mp4
Redis Agent Memory - Overview Redis Agent Memory - Long-term memory

Note

Medium Risk
New external integrations and encrypted credential storage with broad read/write/delete proxy APIs; scope is isolated behind a feature flag and follows existing RDI patterns.

Overview
Introduces Agent Memory as a gated home-tab feature: users register OSS or Redis Cloud endpoints, connect, and inspect working memory, long-term search, summary views (OSS), and store config through a dedicated workspace UI.

The API adds a NestJS module with SQLite persistence (agent_memory_endpoint), encrypted API keys, pooled per-session clients (PooledClientStorage, shared with refactored RDI storage), and OSS/Cloud adapters using agent-memory-client and @redis-iris/agent-memory with normalized responses and capability-based feature gating. UI adds endpoint CRUD, routes under /agent-memory, Redux slices/API wiring (from the broader PR), auto-refresh, and inspector-style panes for overview and long-term memory.

Also bumps features config, registers the entity/migration, and adds i18n/notification strings for new endpoints.

Reviewed by Cursor Bugbot for commit c68930c. Bugbot is set up for automated code reviews on this repo. Configure here.

@CLAassistant

CLAassistant commented Jul 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@booleanhunter
booleanhunter marked this pull request as ready for review July 17, 2026 10:28
@booleanhunter
booleanhunter requested a review from a team as a code owner July 17, 2026 10:28
ids.map(async (id) => {
await this.clientProvider.deleteManyByEndpointId(id);
}),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale clients after delete

Medium Severity

When endpoint deletion removes database rows before pooled clients are cleared, a failure during pool cleanup leaves live clients for ids that no longer exist in storage. getOrCreate can reuse those clients, so memory data remains reachable after the endpoint was removed from RedisInsight.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d2604d1. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2604d1443

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (isStatusSuccessful(status)) {
dispatch(clearWorkingMemorySuccess())
onSuccess?.()
await dispatch(fetchWorkingMemoryAction(endpointId))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid refetching cleared working memory

When the DELETE actually removes the working-memory record for the selected session, this immediately re-fetches the same still-selected session and turns a successful clear into a 404/error state in the pane. Clear or unselect the session, or refresh the session list, instead of re-querying the deleted record.

Useful? React with 👍 / 👎.

const longTermMemory = useAppSelector(agentMemoryLongTermSelector)
const summary = useAppSelector(agentMemorySummarySelector)

const isConnected = connectedEndpoint.id === endpointId

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reconnect when opening an edited endpoint

If a user previously connected to an endpoint, edits that same endpoint's URL/backend/credentials from the home page, and then opens its workspace again, this id-only check still treats the cached endpoint as connected. The workspace then renders stale URL/backend/capabilities and bypasses the explicit connect failure path for the updated configuration; reset/refresh the connected endpoint after edits/deletes or compare more than just the id.

Useful? React with 👍 / 👎.

dto: UpdateAgentMemoryEndpointDto,
): Promise<AgentMemoryEndpoint> {
const oldEndpoint = await this.get(metadata.id);
const newEndpoint = await deepMerge(oldEndpoint, dto);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear cloud credentials when switching backend types

When an existing Cloud endpoint is changed to OSS, the edit form cannot include the old API key and hides the store id, so the DTO only carries the changed fields. This merge preserves the previous Cloud apiKey/storeId, and the OSS client sends any retained apiKey as a bearer token to the new URL; clear Cloud-only fields when backendType changes to OSS.

Useful? React with 👍 / 👎.

@booleanhunter
booleanhunter force-pushed the feat/agent-memory-inspector branch from d2604d1 to 7d0a9e2 Compare July 17, 2026 10:50
await dispatch(fetchSummariesAction(endpointId))
const { partitions } = stateInit().agentMemory.workspace.summary
if ((partitions[viewId] ?? []).length) break
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary recompute polling stops early

Medium Severity

After triggering a full summary-view recompute, the poll loop exits as soon as any partitions exist for that view. Partitions from before the run still satisfy that check, so polling can stop while the background recompute is still in progress and the UI marks the run finished too early.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d0a9e2. Configure here.

Comment thread redisinsight/ui/src/slices/agentMemory/thunks/working-memory.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d0a9e2d58

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const options: SdkSearchOptions = {
text: dto.text ?? '',
limit: LONG_TERM_MEMORY_SEARCH_LIMIT,
optimizeQuery: dto.optimizeQuery || undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Forward optimize_query for OSS searches

When users enable Optimize query on an OSS endpoint, this flag is passed only through agent-memory-client's SearchOptions; in the 0.3.1 SDK implementation, searchLongTermMemory builds the POST body without optimizeQuery and does not add the server's optimize_query query parameter, so the server always uses its default false. Route this request through axios or otherwise send ?optimize_query=true so the UI control actually changes OSS search behavior.

Useful? React with 👍 / 👎.

@booleanhunter
booleanhunter force-pushed the feat/agent-memory-inspector branch from 7d0a9e2 to e4c70d8 Compare July 21, 2026 04:03
Comment thread redisinsight/ui/src/slices/agentMemory/endpoints.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4c70d8660

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +74 to +75
: typeof memory?.dist === 'number'
? memory.dist

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Convert OSS distances before showing similarity scores

When OSS results come back with only dist, that value is a distance (lower is better—the TypeScript SDK examples convert it with 1 - dist for relevance), but this stores it unchanged as score and the UI labels it as a similarity score where higher is better. Searches against OSS servers that return dist will therefore display the least relevant matches with the largest score; convert the distance to a similarity value or label/render it as a distance.

Useful? React with 👍 / 👎.

Adds an Agent Memory home tab and explorer for OSS and Redis Cloud endpoints for Agent Memory.

Home tab:

- Manage agent memory endpoints for two backends: the OSS agent-memory-server and the Redis Cloud agent memory service.

Overview screen:

- working memory for a selected user/namespace/session: messages with roles, timestamps, extraction status, session TTL, running summary; inject events (can create new sessions); clear a session
- Long-term memories for the selected scope.
- Adds opt-in auto-refresh

Long-term memory screen:

- Search records: semantic + keyword search, filters (user/owner, namespace, sessions, memory type, topics, entities),
- click-to-filter cards, per-record delete
- summary views panel: browse LLM-computed profiles, recompute a profile, generate an empty view, create/delete views.
- Adds opt-in auto-refresh

Configuration screen: Memory Store settings

Backend:

- new NestJS module with encrypted endpoint storage

Tech decisions:

- Uses Official SDKs: agent-memory-client (OSS) and @redis-iris/agent-memory (Cloud) (new API dependencies)
- Direct HTTP for the few calls the SDKs don't cover.
- Responses normalized to one shape so the UI is backend-agnostic; a capability model hides unsupported features per backend (e.g. Cloud has no summary views/namespaces).

References redis#6266
@booleanhunter
booleanhunter force-pushed the feat/agent-memory-inspector branch from e4c70d8 to c68930c Compare July 29, 2026 17:13

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit c68930c. Configure here.

dto: UpdateAgentMemoryEndpointDto,
): Promise<AgentMemoryEndpoint> {
const oldEndpoint = await this.get(metadata.id);
const newEndpoint = await deepMerge(oldEndpoint, dto);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deepMerge mutates oldEndpoint causing unintended object aliasing

Low Severity

deepMerge (which wraps lodash mergeWith) mutates its first argument in place and returns the same reference. The variable newEndpoint is the exact same object as oldEndpoint — the naming falsely implies a new object was created. While not immediately catastrophic (since oldEndpoint isn't used after the merge), this is fragile: any future code referencing the result of this.get() before the merge would see the contaminated object, and the merged full-endpoint is then redundantly re-merged inside repository.update().

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c68930c. Configure here.

value={values.backendType}
valueRender={defaultValueRender}
onChange={(value) => setFieldValue('backendType', value)}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Form storeId not cleared when switching backend to OSS

Medium Severity

When the user switches the backend type from Cloud to OSS via the RiSelect, the storeId field is visually hidden but its value remains in Formik state. If a user edits a Cloud endpoint, switches to OSS, and submits, the stale storeId value will be compared against the stored value. If the user also changed storeId before switching, the diff will include it in the update payload — sending a storeId to the backend for an OSS endpoint where it's meaningless, and triggering an unnecessary re-connection validation via isConnectionAffected.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c68930c. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c68930c2ae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +175 to +181
context: current.context ?? null,
data: current.data ?? {},
memories: current.memories ?? [],
messages: [
...(current.messages ?? []),
{ role: message.role, content: message.content },
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve working-memory metadata on append

When adding an event to an OSS session that already has a TTL or custom working-memory settings, this read-modify-write PUT replaces the whole record but only carries over context/data/memories/messages. Fields such as ttl_seconds, long_term_memory_strategy, tokens, and timestamps are omitted and reset to server defaults, so using RedisInsight to append a debug message can make expiring sessions persistent or change extraction behavior; include the rest of the current record in the replacement payload.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Addressed the remaining automated review findings in stacked PR booleanhunter#1.

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.

3 participants