Conversation
The 7-tool surface (supermemoryai#1430, supermemoryai#1432, supermemoryai#1433) reached the TypeScript tools, the AI SDK and the OpenAI Python SDK, but SupermemoryTools in agent-framework-python still exposed only search_memories, add_memory and get_profile. Add the four missing tools with the same names and model-facing parameters as supermemory_openai: - document_list(limit, page) - document_delete(document_id) - document_add(content, title, description) - memory_forget(memory_id, memory_content, reason) All are scoped to the connection's container_tag. document_delete mirrors the guard in packages/tools: the delete endpoint takes no tag, so the document is fetched first and deletion is refused unless its container-tag set is non-empty and entirely within scope, and unless processing has reached a terminal done/failed state. Fetching first also resolves a custom ID to the real document ID. document_add deliberately does not pass the connection's custom_id, which keys the conversation document and would otherwise be overwritten. Every method used exists in supermemory 3.16.0, the minimum this package supports, so no dependency change is needed. Tests cover scoping, the delete guards, argument validation, the generated tool schemas, and one call through FunctionTool.invoke. They pass in both CI lanes (Python 3.10 + supermemory 3.16.0, Python 3.13 + 3.59.0).
The integration page said "The agent gets three tools". List all seven and note the container-tag scoping and delete guards, in the docs page and the package README.
Author
|
Quick note on the follow-up. This PR just fills in the four missing tools. While working on it I noticed the tool descriptions have drifted between the TS and Python SDKs (search_memories actually tells the model opposite things about when to search), so I wrote up an idea for a shared spec + conformance tests in #1731. I haven't built that part yet on purpose. It changes how the SDKs share their tool definitions and needs a call on which wording is the source of truth, so I didn't want to send a big PR you'd end up wanting structured differently. If the direction looks good to you, I'll pick it up right after this one. |
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 7-tool surface from #1430 / #1432 / #1433 reached the TypeScript tools, the AI SDK and
supermemory_openai, butSupermemoryToolsinagent-framework-pythonstill exposed only 3 tools, and the docs said "The agent gets three tools".This adds the missing four, with the same names and model-facing parameters as
supermemory_openai:document_listlimit,pagedocument_deletedocument_id(required)document_addcontent(required),title,descriptionmemory_forgetmemory_id,memory_content,reason(one of id/content required)get_tools()now returns all seven in the canonical order.Design notes
Scoping: every tool uses the connection's single
container_tag, like the existing three.document_deletemirrors the guard inpackages/tools(assertDocumentCanBeDeleted). The delete endpoint takes no tag, so the tool fetches the document first and refuses unless:done/failed).Fetching first also resolves a custom ID to the real document ID.
document_adddoesn't pass the connection'scustom_id. That ID keys the conversation document, so reusing it would overwrite the conversation.No dependency change. Every SDK method used exists in
supermemory==3.16.0, the package's minimum. I checked the signatures and response fields (container_tags,status,memories,pagination) on both 3.16.0 and 3.59.0.Tests
tests/test_tools.pygrows from 6 name/count checks to behavior tests covering:memory_forgetargument validationFunctionToolschemas (required and optional parameters matchsupermemory_openai)FunctionTool.invoke, the path the model actually usesVerified the way
ci-python.ymlruns it (build the wheel, install it,pip check,pytest):supermemory==3.16.0supermemory==3.59.0Against the previous
tools.py, 22 of the new tests fail.mypypasses ontools.py, andblackpasses on the changed files.Docs
Updated the integration page and the package README to list all seven tools and the delete guards.
I didn't bump the package version, since I assume releases are cut separately.