synap-agno
Synap integration for Agno — backs Agno's user memories with Synap's semantic memory store.
Install
pip install synap-agno
Requires agno>=2.0, maximem-synap>=0.2.0.
Quickstart
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from maximem_synap import MaximemSynapSDK
from synap_agno import SynapDb, create_synap_hooks
sdk = MaximemSynapSDK(api_key="sk-...")
agent = Agent(
db=SynapDb(sdk, customer_id="acme"),
model=OpenAIChat(id="gpt-4o-mini"),
enable_user_memories=True,
**create_synap_hooks(sdk, customer_id="acme"),
)
agent.run("Remember that I prefer tea over coffee", user_id="alice")
agent.run("What do you remember about me?", user_id="alice")
Reporting the turn
create_synap_hooks returns the pre_hooks / post_hooks an Agent takes. With
sdk.instance.listen() running they put the whole turn on Synap's live stream, which
is what the anticipation agent reads:
| Event | Source |
|---|---|
| user turn | pre-hook, run_input.input_content_string() |
| assistant turn | post-hook, run_output.content |
| tool call | post-hook, run_output.tools[].tool_call_id / .tool_name / .tool_args |
| tool result | post-hook, run_output.tools[].result, under the same tool_call_id |
| reasoning | post-hook, run_output.reasoning_content and run_output.reasoning_steps[] |
Notes:
- Silent without a stream, and never over REST. No
listen(), no events. This package has never recorded conversation turns over the REST API and these hooks do not start: writing the turn twice would extract it twice. - Tool events land at the end of the run, not during it. Agno's
tool_hooksfire around each call, but the arguments Agno passes them carry no call id (function_callis bound to the next link in the middleware chain, not to theFunctionCallthat holdscall_id).run_output.toolscarries Agno's owntool_call_idon both the call and the result, so that is what gets used. run()andarun().create_synap_hooksreturns plain functions, which Agno runs on both paths, bridged to the async SDK. If every call site isarun(), usecreate_synap_async_hooksinstead: the hooks are awaited natively and no event loop is patched. Agno's syncrun()skips coroutine hooks with a warning.- Scope.
conversation_iddefaults to Agno'ssession_id;user_idcomes off the run, so one agent serving many users reports each under their own scope.
Scope
Agno 2.x unifies every persistence concern (sessions, traces, evals, metrics, knowledge, culture, memories) under a single BaseDb with 46+ abstract methods. Synap natively backs only user memories, so SynapDb:
- Extends Agno's
InMemoryDb - Overrides user-memory methods (
upsert_user_memory,get_user_memory,get_user_memories,get_all_memory_topics) to route through Synap - Leaves sessions, traces, evals, metrics, knowledge, and culture in-process (inherited from
InMemoryDb)
Need durable sessions or traces? Use SqliteDb / PostgresDb from Agno directly — this package is scoped to memory specifically.
Error policy
- Reads (
get_user_memory,get_user_memories,get_all_memory_topics) degrade gracefully — SDK failures log atERRORand return empty results. - Writes (
upsert_user_memory,upsert_memories) surfaceSynapIntegrationErrorso ingestion outages are observable. - Deletes (
delete_user_memory,delete_user_memories,clear_memories) warn once and no-op — Synap has no public delete API. Same contract used by synap-crewai. - Stats (
get_user_memory_stats) warns once and returns([], 0)— Synap doesn't expose aggregate counts.
Metadata
Release files for maximem-synap-agno 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| maximem_synap_agno-0.2.1.tar.gz | 21.6 kB | Without provenance | Details for maximem_synap_agno-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| maximem_synap_agno-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for maximem_synap_agno-0.2.1-py3-none-any.whl |
Total release size: 35.6 kB
Release files / maximem_synap_agno-0.2.1.tar.gz
| Download URL | maximem_synap_agno-0.2.1.tar.gz |
|---|---|
| Size | 21.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd5eb6d26df70c5964c4de77e23e8d36012175727beeef795273d58b38046a95
|
|
BLAKE2b-256 checksum How to use checksums |
755523eb9094667eef27c67fc39b464098377709b9b69551e16dd4c175f64dff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / maximem_synap_agno-0.2.1-py3-none-any.whl
| Download URL | maximem_synap_agno-0.2.1-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
564a18292d3ae6365e9adc97fa43a5cd1c2fd10adca9c72467756620739351b5
|
|
BLAKE2b-256 checksum How to use checksums |
0157b899f09577bcdf5159ba99a3a5fbb525ba4b4a459ad9306190ebe10c2fad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Security for maximem-synap-agno 0.2.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.