feat: persistent per-user memory with pgvector #13

Closed
Jc-965 wants to merge 0 commits from persistent-user-memory into main
Jc-965 commented 2026-08-06 04:57:26 +00:00 (Migrated from codeberg.org)

Summary

Signed-in users now have durable memory across chats. The agent remembers facts a user shares or explicitly asks it to keep, and recalls them in later conversations.

  • Facts are stored in PostgreSQL with pgvector (text-embedding-3-large, halfvec(3072) HNSW index) and recalled by semantic similarity each turn; without DATABASE_URL the store falls back to in-memory for dev and CI
  • The model gets remember/forget tools, and a rate-limited background pass distills durable facts from normal conversation; raw chat turns are never stored
  • GET/DELETE /memory/{user_id} endpoints power the Surface's memory manager: substring search, filter by learned vs remembered, per-item delete, clear all
  • Memory is namespaced per user behind the shared secret; user ids are allowlisted so they can never form a cross-tenant LIKE pattern, recalled facts are wrapped as untrusted data, and memory tools are trusted by identity rather than name, so an MCP tool named remember stays untrusted
  • /api/health reports the memory backend, readiness, and whether semantic search is active
  • Moderate user messages and agent replies
### Summary Signed-in users now have durable memory across chats. The agent remembers facts a user shares or explicitly asks it to keep, and recalls them in later conversations. - Facts are stored in PostgreSQL with pgvector (`text-embedding-3-large`, `halfvec(3072)` HNSW index) and recalled by semantic similarity each turn; without `DATABASE_URL` the store falls back to in-memory for dev and CI - The model gets `remember`/`forget` tools, and a rate-limited background pass distills durable facts from normal conversation; raw chat turns are never stored - `GET/DELETE /memory/{user_id}` endpoints power the Surface's memory manager: substring search, filter by learned vs remembered, per-item delete, clear all - Memory is namespaced per user behind the shared secret; user ids are allowlisted so they can never form a cross-tenant LIKE pattern, recalled facts are wrapped as untrusted data, and memory tools are trusted by identity rather than name, so an MCP tool named `remember` stays untrusted - `/api/health` reports the memory backend, readiness, and whether semantic search is active - Moderate user messages and agent replies
docs: improve comments for persistent memory
Some checks failed
CI / build (pull_request) Failing after 10s
CI / check-1 (pull_request) Failing after 12s
CI / check (pull_request) Failing after 0s
CI / test-agent (pull_request) Has been skipped
kennel/build build succeeded
kennel/deploy deployment healthy
8074ca92bc

Kennel Deployments

Torn down at 2026-08-13 04:12:23 UTC.

<!-- kennel-deployment --> ### Kennel Deployments Torn down at 2026-08-13 04:12:23 UTC.
feat: make memory forgetting more robust
Some checks failed
kennel/build build succeeded
kennel/deploy deployment healthy
CI / build (pull_request) Failing after 12s
CI / check-1 (pull_request) Failing after 13s
CI / check (pull_request) Failing after 0s
CI / test-agent (pull_request) Has been skipped
7e390baac4
Jc-965 changed title from WIP - feat: persistent per-user memory with pgvector to feat: persistent per-user memory with pgvector 2026-08-11 04:57:36 +00:00
feat: add chat title generation endpoint
Some checks failed
CI / build (pull_request) Failing after 10s
CI / check-1 (pull_request) Failing after 12s
CI / check (pull_request) Failing after 0s
CI / test-agent (pull_request) Has been skipped
kennel/build build succeeded
kennel/deploy deployment healthy
13dba7a277
feat: moderate user messages and agent replies
Some checks failed
CI / build (pull_request) Failing after 10s
CI / check-1 (pull_request) Failing after 11s
CI / check (pull_request) Failing after 0s
CI / test-agent (pull_request) Has been skipped
kennel/build build succeeded
kennel/deploy deployment healthy
27dc1c6122
Jc-965 closed this pull request 2026-08-13 04:12:22 +00:00
Some checks failed
CI / build (pull_request) Failing after 16s
CI / check-1 (pull_request) Failing after 18s
CI / check (pull_request) Failing after 0s
CI / test-agent (pull_request) Has been skipped
kennel/build build succeeded
kennel/deploy deployment healthy

Pull request closed

Sign in to join this conversation.
No description provided.