Skip to content

feat(knowledge): expose memory_name in results; correct memory embedding PRD - #252

Merged
arantespp merged 1 commit into
mainfrom
claude/memory-embedding-resilience
Jun 24, 2026
Merged

feat(knowledge): expose memory_name in results; correct memory embedding PRD#252
arantespp merged 1 commit into
mainfrom
claude/memory-embedding-resilience

Conversation

@arantespp

Copy link
Copy Markdown
Member

Summary

The two follow-up items flagged during the knowledge/memory PRD review, done on a dedicated branch (keeping the docs PR #249 clean).

Fix #2memory_name in knowledge results

Previously memory results carried only memory_id, so the agent context-injection label was the opaque [Memory: mem_abc]. Now results include the human-readable memory name.

  • memoryName added to MemoryKnowledgeResult (both the semantic and non-search paths in knowledgeMemory.ts). The Memory association is already loaded, so there's no extra query.
  • memory_name added (required) to the OpenAPI MemoryKnowledgeResult schema → SDK/CLI regenerated (generated files are gitignored, rebuilt in CI).
  • Context-injection label is now [Memory: <name>] (agentKnowledge.ts).
  • Tests: REST knowledge search asserts memory_name; the label unit test expects the memory name.

Fix #1 — memory embedding resilience (docs only)

The review flagged a MemoryEntry.embedding NOT NULL vs DocumentChunk.embedding nullable mismatch. On inspection, the code already aligns memory to documentsMemoryEntry.embedding is nullable and writeMemoryEntry is non-fatal on embedding failure (stores the entry, skips dedup). Only the PRD text was stale.

  • prd-memories.md: NOT NULLNULL, write-algorithm STEP 1 non-fatal note, design-principle wording.

Docs

  • prd-knowledge.md response examples and knowledge.md data model gain memory_name.

Test plan

  • pnpm --filter @soat/server typecheck — clean
  • pnpm eslint --fix on touched files — clean
  • No as any / as unknown added
  • Full suite: 76 suites / 1641 tests pass (run serially against a local Postgres + pgvector via the TEST_DB_HOST hook, since this environment has no Docker runtime)
  • TDD: affected tests confirmed red → green

🤖 Generated with Claude Code

https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF


Generated by Claude Code

…y embedding docs

Fix #2 — memory_name in knowledge results:
- Add memoryName to MemoryKnowledgeResult (both semantic and non-search
  paths in knowledgeMemory.ts); the Memory association is already loaded, so
  no extra query.
- Add required memory_name to the OpenAPI MemoryKnowledgeResult schema;
  regenerate SDK/CLI (generated files are gitignored, rebuilt in CI).
- Inject context label now uses the human name: [Memory: <name>] instead of
  the opaque [Memory: <id>] (agentKnowledge.ts).
- Tests: assert memory_name in REST knowledge search; label test expects the
  memory name.

Fix #1 — memory embedding resilience (docs only):
- The code already aligns memory to documents (MemoryEntry.embedding is
  nullable and writeMemoryEntry is non-fatal on embedding failure). The PRD
  was stale: correct prd-memories.md (NOT NULL -> NULL, write-algorithm
  STEP 1 non-fatal note, design-principle wording).

Docs: prd-knowledge.md response examples and knowledge.md data model gain
memory_name.

Verified: pnpm --filter @soat/server typecheck, eslint --fix, and the full
test suite (76 suites / 1641 tests) pass against a local Postgres + pgvector.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF
@arantespp
arantespp enabled auto-merge (squash) June 24, 2026 09:01
@github-actions

Copy link
Copy Markdown

Deploy Outputs

Package Stack Output Key Output Value
@soat/website SoatWebsite-claude-memory-embedding-resilience BucketWebsiteURL http://soatwebsite-claude-memory-embedding-r-staticbucket-izwzvtli0b9b.s3-website-us-east-1.amazonaws.com

@arantespp
arantespp merged commit 60df773 into main Jun 24, 2026
4 checks passed
@arantespp
arantespp deleted the claude/memory-embedding-resilience branch June 24, 2026 09:07
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