Skip to content

feat: add personal chat memory for chats outside a project (experiment) - #29291

Closed
f0ssel wants to merge 7 commits into
f0ssel/chat-project-memoriesfrom
f0ssel/chat-user-memories
Closed

f0ssel wants to merge 7 commits into
f0ssel/chat-project-memoriesfrom
f0ssel/chat-user-memories

Conversation

@f0ssel

@f0ssel f0ssel commented Sep 14, 2026 •

Copy link
Copy Markdown
Member
  • Experiment, stacked on feat: add shared project memory API for chats in a project #29301. UI is in feat: add chat project folders to the sidebar #29583.
  • Adds personal memory for chats outside a project, scoped to (user, organization) in chat_user_memories. A chat has exactly one scope: its project, else personal.
  • Same generic tools and extraction; scope-specific guidance (personal memory captures how the user works, not project facts).
  • Per-user toggle at /api/v2/chats/config/user-memory, default on. While off, extraction still advances the cursor so opted-out turns are never extracted later.
  • REST API under /api/experimental/chats/memories?organization=....
Screenshots (raw tool output expanded)

save_memory
read_memory
Toggle on
Toggle off


Generated with Coder Agents on behalf of @f0ssel.

@f0ssel f0ssel added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@f0ssel
f0ssel force-pushed the f0ssel/chat-projects branch from fca955e to 1970f72 Compare September 14, 2026 17:59
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 0c69c28 to b5b2f14 Compare September 14, 2026 18:00
@f0ssel
f0ssel changed the base branch from f0ssel/chat-projects to f0ssel/chat-project-memories September 14, 2026 18:01
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from a350928 to feef295 Compare September 14, 2026 19:22
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from b5b2f14 to 53fcc19 Compare September 14, 2026 19:22
@f0ssel

f0ssel commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T19:36:00.144475Z 6f1af5c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 53fcc19aa4

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/generation_preparer.go Resolved
Comment thread coderd/x/chatd/chattool/memory.go Resolved
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from feef295 to 55ca548 Compare September 15, 2026 15:32
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 53fcc19 to 4a251f2 Compare September 15, 2026 15:58
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from 55ca548 to cc67953 Compare September 15, 2026 16:20
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 4a251f2 to 2ec2d16 Compare September 15, 2026 16:21
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from cc67953 to 99d30ca Compare September 15, 2026 22:52
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 2ec2d16 to 8e9e951 Compare September 15, 2026 22:53
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from 99d30ca to ba13328 Compare September 16, 2026 14:51
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 8e9e951 to cb5979d Compare September 16, 2026 14:52
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from cb5979d to 8e6a51d Compare September 16, 2026 15:38
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from da3869f to 69c4eeb Compare September 17, 2026 16:43
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 8e6a51d to 11b612f Compare September 17, 2026 16:44
@f0ssel

f0ssel commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 11b612fe28

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/memory_extract.go Resolved
Adds the user-scoped memory table keyed by (user, organization), the
chat_user_memory RBAC resource with owner-scoped member permissions, the
chat_personal_memory_enabled user config, and renames the extraction
cursor table to chat_memory_cursors since it serves both scopes.
Memory tools, index rendering, and post-turn extraction now work against a
MemoryStore interface with project and personal adapters. A root chat in a
project uses project memory; a root chat without one uses the owner's
personal memory for that organization unless they disabled it. Tools are
renamed read_memory, save_memory, and delete_memory since the scope is
implicit.
…toggle

Exposes the caller's personal memories at /api/experimental/chats/memories
and the per-user enable flag at /chats/config/user-memory, with SDK
methods, audit entries, and cross-replica cache invalidation for the
toggle.
Personal memory reused the project guidance, so the model was told to
save project people, decisions, deadlines, and links into a scope the
intro said was personal. Guidance now follows the memory scope.

Also drops the memory Storybook stories in favor of Vitest coverage of
the loading and error states.
@f0ssel
f0ssel force-pushed the f0ssel/chat-project-memories branch from 69c4eeb to 6887a9a Compare September 17, 2026 20:56
@f0ssel
f0ssel force-pushed the f0ssel/chat-user-memories branch from 11b612f to ef732cd Compare September 17, 2026 20:57
@f0ssel

f0ssel commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: 6f1af5cb53

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/chat_user_memories.go Resolved
Comment thread coderd/x/chatd/generation_preparer.go Resolved
…ories

# Conflicts:
#	coderd/database/dbauthz/dbauthz.go
#	coderd/database/dbmetrics/querymetrics.go
#	coderd/database/querier.go
#	coderd/database/querier_test.go
#	coderd/database/queries.sql.go
#	coderd/x/chatd/memory_extract_internal_test.go
#	coderd/x/chatd/projectmemory_extract.go
@f0ssel

f0ssel commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

Superseded: personal memory is dropped from the stack. Users who want cross-chat memory create a private project; sharing is #29597 and project memory is #29301.

@f0ssel f0ssel closed this Sep 19, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant