tooluniverse.memory_manager module

Memory Manager for Multi-Agent Systems Manages session-based memory for multi-agent workflows

class tooluniverse.memory_manager.MemoryManager[source]

Bases: object

Manages session-based memory for multi-agent systems.

__init__(max_sessions=1000, session_timeout=3600)[source]
create_session(user_id=None, session_name=None)[source]

Create a new session and return its ID.

get_session(session_id)[source]

Retrieve session data by ID, updating last-accessed timestamp.

update_session_context(session_id, updates)[source]

Update the context dictionary for an existing session.

add_agent_result(session_id, agent_name, result, phase=None)[source]

Record an agent execution result in the session history.

get_context_for_agent(session_id, agent_name)[source]

Build a JSON context string suitable for passing to an agent.

set_current_phase(session_id, phase)[source]

Set the current execution phase for a session.

get_session_summary(session_id)[source]

Return a summary dictionary for the given session.

list_user_sessions(user_id)[source]

List all sessions for a given user, sorted by last access time.

close_session(session_id)[source]

Mark a session as closed.