Skip to content

Add actor-bound memory tools for Python - #8

Merged
cuevaio merged 1 commit into
mainfrom
sync/python-e44ba8d
Oct 6, 2026
Merged

cuevaio merged 1 commit into
mainfrom
sync/python-e44ba8d

Conversation

@cuevaio

@cuevaio cuevaio commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Add framework-neutral memory_tools and async_memory_tools factories for memory_ingest and memory_search. The application binds the user while model arguments exclude scope, credentials and endpoint settings. Search results are bounded and retain score, version and retrieval evidence. Errors are safe, and writes are never automatically retried.

Make HTTP 202 ingest explicit through PendingIngestError, validate backend ID arrays, add a separate-process save/recall/correction example and prepare package version 1.1.4. The new version is not published yet.

Validation: CI passes on Python 3.10, 3.11, 3.12 and 3.13. Local verification passes 622 tests and 76 tools/example tests from an installed wheel, plus Ruff, strict mypy and Vulture. Four live tests are gated; three sync/async parameter combinations are inapplicable. Local fixture correction does not prove actual engine or hosted correction behavior. Hosted persistence remains unverified.

Add framework-neutral `memory_tools` and `async_memory_tools` factories for `memory_ingest` and `memory_search`. The application binds the user while model arguments exclude scope, credentials and endpoint settings. Search results are bounded and retain score, version and retrieval evidence. Errors are safe, and writes are never automatically retried.

Make HTTP 202 ingest explicit through `PendingIngestError`, validate backend ID arrays, add a separate-process save/recall/correction example and prepare package version 1.1.4. The new version is not published yet.

Validation: CI passes on Python 3.10, 3.11, 3.12 and 3.13. Local verification passes 622 tests and 76 tools/example tests from an installed wheel, plus Ruff, strict mypy and Vulture. Four live tests are gated; three sync/async parameter combinations are inapplicable. Local fixture correction does not prove actual engine or hosted correction behavior. Hosted persistence remains unverified.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T04:56:03.463999Z 48ce639 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48ce639378

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread atomicmemory/tools.py
bound_user = _user_scope(user)

def ingest(parsed: IngestArguments) -> IngestResult:
return client.ingest(TextIngest(content=parsed.content, scope=Scope(user=bound_user)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require a content class for tool ingests

Against an AtomicMemory core using the documented default RAW_CONTENT_POLICY=reject, both factories construct TextIngest without content_class, so _build_ingest_body omits the classification and every memory_ingest call is rejected. Because the tool arguments deliberately provide no classification field, applications cannot make this new ingest tool work with the default backend; require an application-owned content_class when creating the tools and pass it through rather than silently defaulting one.

AGENTS.md reference: AGENTS.md:L40-L40

Useful? React with 👍 / 👎.

*,
method: str = "GET",
json: Any | None = None,
require_completed: bool = False,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply pending detection to handle ingests

When Core returns HTTP 202 through the public AtomicMemoryHandle.ingest_full or ingest_quick APIs, this opt-in defaults to false because both AtomicMemoryHandle._post_ingest and AsyncAtomicMemoryHandle._post_ingest still call fetch_json/afetch_json without require_completed=True. Those ingest paths therefore parse the pending body as a terminal result (or leak a Pydantic error) instead of raising the newly documented PendingIngestError, which can cause callers to treat a pending write as failed or completed and retry it; enable this check in both handle implementations as well.

Useful? React with 👍 / 👎.

@cuevaio
cuevaio merged commit 65bc2e5 into main Oct 6, 2026
4 checks passed
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.

1 participant