8000 feat(assistant): give each namespace its own assistant that remembers by adeelahmad · Pull Request #154 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(assistant): give each namespace its own assistant that remembers - #154

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-3598ol
Oct 5, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-3598ol

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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.py keeps the profile on space.assistant, plus a new assistant_memory table. Toolbox adds remember, recall and forget, 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}/assistant and /namespaces/{name}/assistant/memories (list with q, 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

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (ruff, mypy, tsc pass).
  • I added or updated tests (tests/api/test_ns_assistant.py). Full backend suite run locally: 639 passed; the only failure is the known LibreOffice one in this container.
  • I have updated docs/assistant.md ("A namespace's own assistant").
  • CHANGELOG: the title covers it.

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

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
@adeelahmad adeelahmad self-assigned this Oct 5, 2026
@adeelahmad
adeelahmad merged commit 408da9d into main Oct 5, 2026
2 of 5 checks passed
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.

2 participants

0