Repository navigation
feat(assistant): give each namespace its own assistant that remembers - #154
Merged
Merged
Conversation
Off until a namespace's owner turns it on. Conversations scoped to that namespace then talk to it: its name and instructions, and a memory of short facts kept across conversations, each cited to the moment it came from. Remembering is routine; forgetting from chat waits for approval. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TSYJbUHw4k8JEbfavcabQJ
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: every conversation started from nothing. The assistant could keep notes, but nothing was read back automatically, and a namespace had no assistant of its own.
After: a namespace's owner can turn on its own assistant, with a name and standing instructions. Every conversation scoped to that namespace alone talks to it. It keeps a memory of short facts across conversations, each tied to the exact moment it came from or to the conversation where it was told. An answer from memory cites [n] and opens the recording at that moment. Remembering happens on its own and shows as a step. Forgetting from chat waits for approval. Viewers' conversations can read the memory but can't add to it. It's off by default, so nothing changes until an owner turns it on.
How: it's the same assistant (
ai_tools.Toolbox, with the same extensions and approvals), not a second one.app/domain/ns_assistant.pykeeps the profile onspace.assistant, plus a newassistant_memorytable. Toolbox addsremember,recallandforget, and its system note now includes the persona and the newest 30 memories (pinned ones first). Memories from a moment are registered as numbered refs, so they are cited like excerpts. When an answer skips the tools but cites memory, the chat route and the chat-room bridge now keep it instead of falling back to a search. New API:GET/PATCH /namespaces/{name}/assistantand/namespaces/{name}/assistant/memories(list withq, add, edit/pin, forget, forget all). No model calls or index of its own, so it stays light on a Raspberry Pi.Motivation and Context
Backlog item "per-namespace persistent assistant". Adeel gave the go in the project chat.
Types of changes
Checklist:
tests/api/test_ns_assistant.py). Full backend suite run locally: 639 passed; the only failure is the known LibreOffice one in this container.docs/assistant.md("A namespace's own assistant").Next PRs: settings and memories in the web app, and chat rooms answered by a namespace's assistant.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TSYJbUHw4k8JEbfavcabQJ
Generated by Claude Code