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.1.2.tar.gz (5.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.1.2.tar.gz.

File metadata

File hashes

Hashes for maximem_synap_microsoft_agent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6b4e7c5358236fc76fdd29da74b31adc5cd36b03cea909f4bfb04c192e6bab79
MD5 7386c350f6e412b4f3742f57efb0748a
BLAKE2b-256 55893b54a1d7e21795f59ef02dcd2cb9f1a2f36a768952d7fe4bf1e108b505a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for maximem_synap_microsoft_agent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83bcd4415f287c939227473eb20ca51ad8ea6bbcfc90d575d2baf3cb9980a065
MD5 3d5d8b48166523718438bf8c94266bfb
BLAKE2b-256 8a6ea62f2267309931880547598a1a259644ef257660e2d485742065f9034866

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