maximem-synap-smolagents
Synap memory integration for Smolagents
— give a CodeAgent / ToolCallingAgent persistent memory through Synap.
pip install maximem-synap-smolagents smolagents
Surfaces
Smolagents keeps its own fixed step log (no pluggable memory backend), so Synap plugs into the two extension points it does expose, plus static instructions:
| Surface | Smolagents extension point | Purpose |
|---|---|---|
create_synap_tools |
@tool |
Explicit search_memory / store_memory the model can call |
create_synap_recorder |
step_callbacks={ActionStep: ...} |
Record each completed action into Synap |
synap_st_instructions |
CodeAgent(instructions=...) |
Fold Synap short-term context into the agent's instructions |
Example
from smolagents import CodeAgent, InferenceClientModel
from smolagents.memory import ActionStep
from maximem_synap import MaximemSynapSDK
from synap_smolagents import create_synap_tools, create_synap_recorder, synap_st_instructions
sdk = MaximemSynapSDK(api_key="sk-...")
agent = CodeAgent(
model=InferenceClientModel(),
tools=create_synap_tools(sdk, user_id="alice", customer_id="acme"),
instructions=synap_st_instructions(
sdk, conversation_id="conv_abc",
instructions="You are a concise, friendly assistant.",
),
step_callbacks={
ActionStep: create_synap_recorder(
sdk, user_id="alice", conversation_id="conv_abc", customer_id="acme"
)
},
)
agent.run("Remind me what plan I'm on and my open ticket.")
Because CodeAgent calls tools as plain Python, search_memory / store_memory
compose naturally into agent-written code.
Notes
- Synchronous framework. Smolagents runs synchronously and its tools do not
support
async, so every surface bridges to the async Synap SDK internally. Run the agent on its own thread if your app is otherwise async. - Error policy. The
search_memorytool degrades (returns a not-found message);store_memoryraisesSynapIntegrationError; the recorder logs and never raises — it runs inside the agent loop, where a raising callback would abort the run. - Per-step documents. The recorder writes each
ActionStepto its own Synap document, so multi-step runs are captured in full.
Requires Python 3.11+ and smolagents>=1.26.
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 maximem_synap_smolagents-0.1.0.tar.gz.
File metadata
- Download URL: maximem_synap_smolagents-0.1.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdeec44c959039dbcf0e7869eb34702c6ce7c9119a873aa0108c180ce45af23c
|
|
| MD5 |
f779e11b9235322539ab50e87fa0fe49
|
|
| BLAKE2b-256 |
8abfee1a6ff6586cacda1ece325b4c666c6189020481d1df80dbeba40dc1e771
|
File details
Details for the file maximem_synap_smolagents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maximem_synap_smolagents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e89e96526621ce28a0c9bad4f5661cdd06fcc1f13744ba400b2202a7066d0db
|
|
| MD5 |
e1f1c20d2fc8ce0d48debd3b66e7c131
|
|
| BLAKE2b-256 |
39dcdc2f412265871de668f70065a314b18a70130cc604dec18b65f725ab1b3e
|