Synap memory integration for Microsoft Agent Framework
Project description
synap-microsoft-agent
Synap memory integration for Microsoft Agent Framework (MAF).
Install
pip install synap-microsoft-agent
Requires agent-framework>=1.0, maximem-synap>=0.2.0.
Quickstart
from agent_framework import InMemoryHistoryProvider
from agent_framework.openai import OpenAIChatClient
from maximem_synap import MaximemSynapSDK
from synap_microsoft_agent import SynapContextProvider, SynapHistoryProvider
sdk = MaximemSynapSDK(api_key="sk-...")
client = OpenAIChatClient(model="gpt-4o-mini")
agent = client.as_agent(
name="MemoryAgent",
instructions="You are a helpful assistant.",
context_providers=[
SynapContextProvider(
sdk=sdk,
user_id="alice",
customer_id="acme",
),
SynapHistoryProvider(
sdk=sdk,
user_id="alice",
customer_id="acme",
),
],
)
session = agent.create_session()
result = await agent.run("What's my trial expiring?", session=session)
What each provider does
-
SynapContextProvider— on every turn, fetches Synap context (facts, preferences, episodes, emotions, temporal events) and appends it as instructions. After the turn, records the user + assistant messages back to Synap. -
SynapHistoryProvider— persists the conversation message log. Loads prior turns on session resume. Subclass of MAF'sHistoryProvider, so all its flags (load_messages,store_inputs,store_outputs,store_context_messages) work as documented.
You can use either or both; they coexist.
Error policy
- Read-side failures (
fetch,get_context_for_prompt) degrade gracefully — logged atERROR, empty result returned. An outage never crashes an agent turn. - Write-side failures —
SynapContextProvider.after_runlogs and swallows (context providers must not raise per MAF's hook contract).SynapHistoryProvider.save_messagessurfaces errors asSynapIntegrationErrorso explicit persistence failures are observable.
Project details
Release history Release notifications | RSS feed
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_microsoft_agent-0.1.2.tar.gz.
File metadata
- Download URL: maximem_synap_microsoft_agent-0.1.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4e7c5358236fc76fdd29da74b31adc5cd36b03cea909f4bfb04c192e6bab79
|
|
| MD5 |
7386c350f6e412b4f3742f57efb0748a
|
|
| BLAKE2b-256 |
55893b54a1d7e21795f59ef02dcd2cb9f1a2f36a768952d7fe4bf1e108b505a4
|
File details
Details for the file maximem_synap_microsoft_agent-0.1.2-py3-none-any.whl.
File metadata
- Download URL: maximem_synap_microsoft_agent-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83bcd4415f287c939227473eb20ca51ad8ea6bbcfc90d575d2baf3cb9980a065
|
|
| MD5 |
3d5d8b48166523718438bf8c94266bfb
|
|
| BLAKE2b-256 |
8a6ea62f2267309931880547598a1a259644ef257660e2d485742065f9034866
|