feat(knowledge): expose memory_name in results; correct memory embedding PRD - #252
Merged
Merged
Conversation
…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
enabled auto-merge (squash)
June 24, 2026 09:01
Deploy Outputs
|
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.
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 #2 —
memory_namein knowledge resultsPreviously 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.memoryNameadded toMemoryKnowledgeResult(both the semantic and non-search paths inknowledgeMemory.ts). TheMemoryassociation is already loaded, so there's no extra query.memory_nameadded (required) to the OpenAPIMemoryKnowledgeResultschema → SDK/CLI regenerated (generated files are gitignored, rebuilt in CI).[Memory: <name>](agentKnowledge.ts).memory_name; the label unit test expects the memory name.Fix #1 — memory embedding resilience (docs only)
The review flagged a
MemoryEntry.embedding NOT NULLvsDocumentChunk.embeddingnullable mismatch. On inspection, the code already aligns memory to documents —MemoryEntry.embeddingis nullable andwriteMemoryEntryis non-fatal on embedding failure (stores the entry, skips dedup). Only the PRD text was stale.prd-memories.md:NOT NULL→NULL, write-algorithm STEP 1 non-fatal note, design-principle wording.Docs
prd-knowledge.mdresponse examples andknowledge.mddata model gainmemory_name.Test plan
pnpm --filter @soat/server typecheck— cleanpnpm eslint --fixon touched files — cleanas any/as unknownaddedTEST_DB_HOSThook, since this environment has no Docker runtime)🤖 Generated with Claude Code
https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF
Generated by Claude Code