feat: add Claude Agent SDK + Hindsight memory notebook#35
Open
DK09876 wants to merge 2 commits into
Open
Conversation
Interactive notebook demonstrating: - Explicit memory tools (retain, recall, reflect) via MCP server - Automatic memory hooks (auto-recall, auto-retain) - Knowledge compounding across sessions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ace all stored facts Audit finding (2026-06-02): cell 7 (Reflect) surfaced only Python/async out of 4 stored facts (Python+async, pytest, FastAPI, conventional-commits), and cell 9 (auto-recall hook) failed to surface conventional-commits despite the cell's markdown explicitly claiming it would. Not a Pattern-1 LLM-tool-choice issue (Claude doesn't typically have that quirk on explicit recall instructions) — both come down to recall/reflect query specificity: - Cell 7's "synthesize everything you know about my development stack and preferences" is broad enough that the server's reflect synthesis ranked Python/async highest and dropped the others. Sharpening the prompt to name the four categories explicitly forces reflect to cover each one (or say so when a category has none) — much more reliable. - Cell 9's "What commit message format should I use for this test file I just created?" is dominated semantically by "test file"; the auto-recall hook uses the raw user prompt as its query, so the test-related memories outrank the conventional-commits one. Prepending "Recall what you know about my commit conventions, then answer:" steers the recall query toward the right memory while still asking the same underlying question. Both edits live entirely in the notebook prompts — the integration code (create_memory_hooks, hindsight_reflect) is correct and unchanged. The recall_max_results=5 default is plenty; the issue is query semantics. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
notebooks/claude-agent-sdk.ipynbdemonstrating Claude Agent SDK with Hindsight persistent memoryhindsight-claude-agent-sdkpackage in vectorize-io/hindsightTest plan
getpassfor API key🤖 Generated with Claude Code