aidememo-agent-sdk
Agent-friendly memory SDK for code-executing agents, including Codex, Claude Code, Hermes, CI jobs, and local scripts.
The SDK uses aidememo-python when available and otherwise falls back to the aidememo
CLI. This keeps the first-use path portable while still taking the fast
in-process route in environments that install the native binding.
Use it when memory needs to be a programmable working set: fan out searches, dedupe rows, check coverage, aggregate exact counts/timelines, and batch-write facts without spending model-visible tool calls on every intermediate step.
Install
# From a checkout, until the PyPI release lands:
python -m pip install -e packages/aidememo-agent-sdk
# After the PyPI release:
python -m pip install aidememo-agent-sdk
The fallback path needs the aidememo CLI on $PATH. After aidememo-python
is published, python -m pip install "aidememo-agent-sdk[binding]" enables the
optional in-process binding fast path.
Quick Start
from aidememo_agent import Memory
mem = Memory.open(
source_id="project:aidememo",
actor_id="codex:account-a",
storage_backend="libsqlite",
)
rows = mem.search_rows([
"release preflight decisions",
{"query": "Hermes source_id lock retry lessons", "topic": "Hermes"},
])
coverage = mem.coverage_by(rows, ["fact_type"])
timeline = mem.aggregate_many([
{"query": "release preflight", "op": "timeline"},
])
mem.remember([
{
"content": "Lesson: use source-scoped SDK fanout for multi-agent memory checks.",
"fact_type": "lesson",
"entities": ["aidememo", "Codex"],
}
])
pack = mem.client.workflow_start(
"Fix Redis timeout in worker",
source="github:org/app#123",
source_id="project:aidememo",
actor_id="codex:account-a",
)
canvas = mem.session_canvas(pack["session_id"], limit=20)
profile = mem.project_profile(limit=80)
mem.remember(
[
{
"content": "Decision: Redis timeout follow-ups stay attached to the workflow session.",
"fact_type": "decision",
"entities": ["Redis"],
}
],
source_id="project:aidememo",
actor_id="codex:account-a",
session_id=pack["session_id"],
)
branch = mem.branch_push(
"candidate-b",
"./shared",
base="./shared/backup-01...",
)
print(branch["records_exported"])
main = Memory.open(store_path="./main.sqlite", storage_backend="libsqlite")
main.branch_merge("./shared", branch="candidate-b")
Use MCP/tools for one-off model-visible calls. Use this SDK when the agent
needs memory as code: fanout retrieval, dedupe, coverage checks, aggregation,
artifact hydration, branch-log experiments, or session-aware batch writes
without spending model turns on intermediate state. session_canvas(...) and
project_profile(...) return read-only Markdown strings suitable for direct
prompt injection before resuming long work.
source_id can be passed to Memory.open(...) or inherited from
AIDEMEMO_SOURCE_ID, matching the MCP aidememo mcp-install --source-id <namespace> path.
Use it for the project/upstream namespace. actor_id, inherited from
AIDEMEMO_ACTOR_ID, records which account or agent wrote each fact without
splitting shared project retrieval.
storage_backend is optional and matches the CLI/native binding selector:
omit it or pass an empty string for the compiled default, pass "sqlite" or
"libsqlite" for the default local SQLite backend, or pass "redb" when the
installed native binding / CLI was built with the Cargo redb feature. The SDK
passes the selector to both the aidememo-python fast path and the CLI fallback
(aidememo --backend ...).
branch_push(...) and branch_merge(...) use the native binding for local
paths when available. S3 branch URIs fall back to the CLI so the installed
aidememo --features s3 binary owns AWS credentials and compression behavior.
Metadata
Release files for aidememo-agent-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aidememo_agent_sdk-0.1.0.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aidememo_agent_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.2 kB
Release files / aidememo_agent_sdk-0.1.0.tar.gz
| Download URL | aidememo_agent_sdk-0.1.0.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21d1cfbb8782253dfa7781860f0aa1684b6b5fa7feac213ae1284f5f4226dc61
|
|
BLAKE2b-256 checksum How to use checksums |
48264f645270f0b69f693b8acbb400e32374744ab71e27a78f7c077735c202e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logRelease files / aidememo_agent_sdk-0.1.0-py3-none-any.whl
| Download URL | aidememo_agent_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f14ef61a46b83ef0c7031b89ca9254d2cb5103f6310a4ce2bc6f344eceefb472
|
|
BLAKE2b-256 checksum How to use checksums |
c3ba3d620c5c0bb985f4483c38ed2b48889b8b1934bb20a5118213d2a1b7dd28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency log