Skip to content

Microsoft Agent Framework integration

Astrocyte memory tools for the Microsoft Agent Framework.

Module: astrocyte.integrations.microsoft_agent Pattern: OpenAI-compatible tool definitions + handler dispatch Framework dependency: microsoft-agent-framework (optional)

Terminal window
pip install astrocyte microsoft-agent-framework
from astrocyte import Astrocyte
from astrocyte.integrations.microsoft_agent import astrocyte_ms_agent_tools
brain = Astrocyte.from_config("astrocyte.yaml")
tools, handlers = astrocyte_ms_agent_tools(brain, bank_id="user-123")
from microsoft.agent_framework import Agent
agent = Agent(tools=tools)
# Dispatch tool calls
result = await handlers["memory_retain"](content="Calvin prefers dark mode")
result = await handlers["memory_recall"](query="preferences")

Uses the same OpenAI-compatible format as the OpenAI Agents SDK integration. See OpenAI Agents SDK for the full tool schema format.

ToolHandlerAstrocyte call
memory_retainhandlers["memory_retain"]brain.retain()
memory_recallhandlers["memory_recall"]brain.recall()
memory_reflecthandlers["memory_reflect"]brain.reflect()
memory_forgethandlers["memory_forget"]brain.forget()

astrocyte_ms_agent_tools(brain, bank_id, *, include_reflect=True, include_forget=False)

Section titled “astrocyte_ms_agent_tools(brain, bank_id, *, include_reflect=True, include_forget=False)”

Returns tuple[list[dict], dict[str, Callable]] — same signature as astrocyte_tool_definitions().