Claude Agent SDK integration for Hindsight - persistent memory tools and hooks for Claude agents
Project description
hindsight-claude-agent-sdk
Persistent memory tools and hooks for the Claude Agent SDK, powered by Hindsight.
Installation
pip install hindsight-claude-agent-sdk
Quick Start
Tools (explicit memory)
Give your Claude agent retain/recall/reflect tools so it can decide when to use memory:
from claude_agent_sdk import query, ClaudeAgentOptions
from hindsight_claude_agent_sdk import create_hindsight_server
server = create_hindsight_server(
bank_id="my-agent",
hindsight_api_url="http://localhost:8888",
)
async for msg in query(
prompt="Remember that I prefer dark mode. Then check what you know about me.",
options=ClaudeAgentOptions(
mcp_servers={"hindsight": server},
allowed_tools=["mcp__hindsight__*"],
),
):
print(msg)
Hooks (automatic memory)
Auto-recall relevant memories before each prompt and auto-retain results after each session:
from claude_agent_sdk import query, ClaudeAgentOptions
from hindsight_claude_agent_sdk import create_hindsight_server, create_memory_hooks
server = create_hindsight_server(bank_id="my-agent", hindsight_api_url="http://localhost:8888")
hooks = create_memory_hooks(bank_id="my-agent", hindsight_api_url="http://localhost:8888")
async for msg in query(
prompt="Help me refactor the auth module.",
options=ClaudeAgentOptions(
mcp_servers={"hindsight": server},
allowed_tools=["mcp__hindsight__*"],
hooks=hooks,
),
):
print(msg)
Global configuration
from hindsight_claude_agent_sdk import configure
configure(
hindsight_api_url="http://localhost:8888",
api_key="your-api-key",
budget="mid",
)
Hook Configuration
Fine-tune automatic memory behavior:
from hindsight_claude_agent_sdk import MemoryHookConfig, create_memory_hooks
hooks = create_memory_hooks(
bank_id="my-agent",
hook_config=MemoryHookConfig(
auto_recall=True, # inject memories before each prompt
auto_retain=True, # save results after each session
retain_on_tools=["Bash"], # also retain notable Bash outputs
recall_max_results=5, # max memories to inject
retain_tags=["source:my-app"],
),
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hindsight_claude_agent_sdk-0.1.0.tar.gz.
File metadata
- Download URL: hindsight_claude_agent_sdk-0.1.0.tar.gz
- Upload date:
- Size: 120.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d92c743fc6a7b5bff4048e29c9fde763d1eecbd445d85eb9e4719ecc3ffc764e
|
|
| MD5 |
7999bda44fa294a36aff4f7f150f894a
|
|
| BLAKE2b-256 |
f2a7b64ef65c9864f742186c626d6f2f970f67b57952e83c7c53185665f86253
|
Provenance
The following attestation bundles were made for hindsight_claude_agent_sdk-0.1.0.tar.gz:
Publisher:
release-integration.yml on vectorize-io/hindsight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hindsight_claude_agent_sdk-0.1.0.tar.gz -
Subject digest:
d92c743fc6a7b5bff4048e29c9fde763d1eecbd445d85eb9e4719ecc3ffc764e - Sigstore transparency entry: 1754939739
- Sigstore integration time:
-
Permalink:
vectorize-io/hindsight@36fd44500371d1967bdf05fba86b4306f27b1ac5 -
Branch / Tag:
refs/tags/integrations/claude-agent-sdk/v0.1.0 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-integration.yml@36fd44500371d1967bdf05fba86b4306f27b1ac5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dab63c7c5bad823d0891d2890fcab0b433f091ed670259d822bab0c89adde37
|
|
| MD5 |
5bc76edea512566d98e93c8d8f0152e6
|
|
| BLAKE2b-256 |
e4d22fa26d8c28fc5dfa4cdd06d5ec496392ca1553b60bd7b25524aecc0f428b
|
Provenance
The following attestation bundles were made for hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl:
Publisher:
release-integration.yml on vectorize-io/hindsight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl -
Subject digest:
0dab63c7c5bad823d0891d2890fcab0b433f091ed670259d822bab0c89adde37 - Sigstore transparency entry: 1754939752
- Sigstore integration time:
-
Permalink:
vectorize-io/hindsight@36fd44500371d1967bdf05fba86b4306f27b1ac5 -
Branch / Tag:
refs/tags/integrations/claude-agent-sdk/v0.1.0 - Owner: https://github.com/vectorize-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-integration.yml@36fd44500371d1967bdf05fba86b4306f27b1ac5 -
Trigger Event:
push
-
Statement type: