Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add chat projects with shared project memory (experiment) - #29242

Draft
f0ssel wants to merge 12 commits into
mainfrom
f0ssel/chat-projects
Draft

feat: add chat projects with shared project memory (experiment)#29242
f0ssel wants to merge 12 commits into
mainfrom
f0ssel/chat-projects

Conversation

@f0ssel

@f0ssel f0ssel commented Sep 11, 2026

Copy link
Copy Markdown
Member

Warning

Experiment, work in progress. Everything is behind the chat-projects experiment and off by default. Not ready for review; opening early for visibility and dogfooding.

Adds projects: organization-scoped containers that group agent chats, plus project memory, a shared, agent-written memory store modeled on Claude Code's auto memory (index in the system prompt, read/save/delete tools, conservative post-turn extraction). Chats stay independent unless placed in a project.

Design notes and open questions live in the plan under Phase 2; ARCHITECTURE.md has TODO markers where docs still need writing.

Screenshots

Sidebar with projects
Sidebar

Project page: chats and memory
Project page

Memory expanded
Memory expanded

Editing a memory
Edit memory

Chat reading project memory before answering
Chat

Move a chat to a project
Move


Generated with Coder Agents on behalf of @f0ssel.

…cts experiment

Adds a lightweight chat_projects table and a nullable chats.project_id
binding so agent chats can be grouped inside an organization-scoped
project. Chats stay independent by default; deleting a project detaches
its chats instead of deleting them.

Backend: chat_project RBAC resource (org members read/create, creators
and org admins update/delete), audited CRUD under
/api/experimental/chats/projects, project_id on chat create/update and
list filter, codersdk client methods.

Frontend: experiment-gated Projects sidebar section with create/edit/
delete dialogs, /agents/projects/:projectId page, new-chat-in-project via
?project=, and a Move to project action in the chat menus.
Gives every chat in a project a durable, shared memory store modeled on
Claude Code's auto memory. Root chats in a project get a compact
<project-memory> index in the system prompt (guidance plus one line per
memory, capped at 200 lines / 25 KiB with an explicit truncation notice)
and read/save/delete tools that upsert by name. Memories carry a type
(user, feedback, project, reference), a one-line description, and a
markdown body, and are sanitized before storage.

After each completed root turn a detached, cursor-fenced extraction call
reviews the new transcript against the index and applies any upserts or
deletes the agent did not save itself. It never blocks the turn.

Adds the chat_project_memory RBAC resource (org members may read and
write), audited CRUD under /chats/projects/{project}/memories, and a
Memory section on the project page so users can inspect, edit, and
delete what the agent wrote. Gated by the chat-projects experiment.
…ation

Exercises extractProjectMemories end to end against a mocked store and an
intercepted model call: cursor fencing, transcript windowing by revision,
normalization of upserts and deletes, the per-project cap, and that model
failures leave the cursor untouched. Covers prepareGeneration placing the
project memory index and tools only on root chats in a project with the
experiment enabled.
Dogfooding with a small model surfaced three failure modes in the
background extractor: it deleted a correct memory because the assistant
said it did not know the fact, it re-recorded the assistant's restatement
of existing memories as new ones, and it split facts the agent had just
saved into duplicates.

The extractor is now upsert-only and reads only new user messages, skips
turns where the agent already used the memory tools, and the shared
guidance tells the agent to check the index before claiming something is
unknown and never to save unknowns.
A question-only turn led the extractor to rewrite a correct memory with
hallucinated content. Existing memories are now updated only by the main
agent's tool or the UI; extraction proposals that collide with an
existing name are dropped.
@f0ssel f0ssel added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 11, 2026
…d type

Memory rows now show only the name and type until expanded, where the
description, body, and edit/delete actions appear. Manual creation is
kept but demoted to a text button, since the agent is the expected writer.
Also drops the story-only state prop in favor of seeded queries.
The dialog stayed mounted across edits, so its form state never picked up
the selected memory. Remount it per memory.
Memories keep a name, one-line description, and body. The guidance still
tells the agent what kinds of facts are worth saving, without asking it to
categorize them.
Renumbers the chat projects migrations to 000595/000596 behind main's
000594_drop_task_tables and regenerates database and API artifacts.
@github-actions

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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