Neocortex (TinyHuman) memory tools for Microsoft AutoGen.
Provides explicit Python functions that allow AutoGen agents to use a Mastra-aligned Neocortex tool surface.
NeocortexMemoryTools: Class wrapping the memory client and exposing the tool methods.register_neocortex_tools: Helper function to register the tools to AutoGen agents.
Tool methods:
save_memory,recall_memory,delete_memorysync_memoryinsert_document,insert_documents_batchlist_documents,get_document,delete_documentquery_memory_context,chat_memory_contextrecord_interactions,recall_thoughtschat_memory,interact_memoryrecall_memory_master,recall_memoriesget_ingestion_job
insert_documentrequiresdocument_id.insert_documents_batchrequiresdocument_idon every item initems_json.
pip install neocortex-autogenSet your API key:
export TINYHUMANS_API_KEY="your_token_here"NeocortexMemoryTools(...) only creates Python methods.
To make them callable by the agent, you must register them with register_neocortex_tools(...).
AutoGen uses a caller/executor split:
- caller: usually
AssistantAgent(LLM proposes tool calls) - executor: usually
UserProxyAgent(runs tool functions locally)
If you skip registration, the agent cannot see or call any Neocortex tools.
Instantiate the tools with a TinyHumanMemoryClient and register them to your agents.
import os
import autogen
from tinyhumansai import TinyHumanMemoryClient
from neocortex_autogen import NeocortexMemoryTools, register_neocortex_tools
client = TinyHumanMemoryClient(token=os.getenv("TINYHUMANS_API_KEY"))
memory_tools = NeocortexMemoryTools(client=client, default_namespace="autogen_memory")
assistant = autogen.AssistantAgent("assistant", llm_config={"config_list": [...]})
user_proxy = autogen.UserProxyAgent("user_proxy", human_input_mode="NEVER")
# The assistant proposes tools, the user_proxy executes them locally.
register_neocortex_tools(tools=memory_tools, caller=assistant, executor=user_proxy)
user_proxy.initiate_chat(assistant, message="Remember my name is Alice.")After registration, add clear instructions so your agent actually uses the tools:
assistant = autogen.AssistantAgent(
"assistant",
llm_config={"config_list": [...]},
system_message=(
"You have Neocortex memory tools. "
"Use save_memory for new facts, recall_memory/query_memory_context before answering "
"memory questions, and delete_memory only when explicitly requested."
),
)Run the package smoke example:
cd packages/plugin-autogen
python3 examples/autogen_agent.pyIt exercises registration and tool-calling across save/recall, documents, context/chat, interactions, sync, ingestion status, and cleanup.
register_neocortex_tools(...) registers:
save_memory,recall_memory,delete_memorysync_memoryinsert_document,insert_documents_batchlist_documents,get_document,delete_documentquery_memory_context,chat_memory_contextrecord_interactions,recall_thoughtschat_memory,interact_memoryrecall_memory_master,recall_memoriesget_ingestion_job