Integrate memory capabilities into your voice agents using Zentry and OpenAI Agents SDK
@function_tool
decorator transforms Python functions into callable tools for the OpenAI agent. Here are the key memory tools:
add()
methodprompt_with_handoff_instructions
to include standard voice agent behaviorsUSER_ID
variable for simplicity, but can be extended to manage multiple users.
record_from_microphone()
function that captures actual voice input from your microphone.
save_memories
: Stores user memories in Zentrysearch_memories
: Searches for relevant past informationprint()
statements inside @function_tool
decorated functions don’t appear in your console output. This is because the Agents SDK captures and redirects standard output when executing these functions.
To effectively debug your function tools, use Python’s logging
module instead: