Skip to main content

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's HistoryProvider, 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 at ERROR, empty result returned. An outage never crashes an agent turn.
  • Write-side failuresSynapContextProvider.after_run logs and swallows (context providers must not raise per MAF's hook contract). SynapHistoryProvider.save_messages surfaces errors as SynapIntegrationError so explicit persistence failures are observable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maximem_synap_microsoft_agent-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file maximem_synap_microsoft_agent-0.2.0.tar.gz.

File metadata

File hashes

Hashes for maximem_synap_microsoft_agent-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5d9b21c2ba577a1028a7eed1399341b9065d782d8b912d077cb20ca5ed111243
MD5 920cbf7d3b1412815d2faed5b1fb600d
BLAKE2b-256 5e34cb91563894b3fc82c9c3ce2b9f4c8d50148e2af11ef2dcf74ab47f1db2ce

See more details on using hashes here.

File details

Details for the file maximem_synap_microsoft_agent-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for maximem_synap_microsoft_agent-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abd0e0ee3336ed0a8ec0a4b128aeb5a316746aa06447e20cf3d6c099d61de281
MD5 fd8032509932f189ab19d42ca17a6d57
BLAKE2b-256 393d8516bd43d975ee304b512d0ea0e7f942924ebc2ac603d257298855ae4ee3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page