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.1.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.

maximem_synap_microsoft_agent-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for maximem_synap_microsoft_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 358978ea2a25805c032e1bff905bdd77beea35baafa150223472a91e69643eff
MD5 976d02ee30c747f39d7e3306874866e8
BLAKE2b-256 d74ec1b87cc242e8174988bd0dad386106aa3a39e63a3a3a4a54e01ea7923b2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for maximem_synap_microsoft_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 958a981e1b308dda188c08142436e740389c72c730fba5b446c97bf0070992ec
MD5 e5299a9747520c9b5dd91d7d4b40b3dc
BLAKE2b-256 936b78bf49353d7650179439c2b4881e694f997636cef0ca78497f062a64b052

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