MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / remember

Function remember

examples/mcpserver/memory.py:266–273  ·  view source on GitHub ↗
(
    contents: list[str] = Field(description="List of observations or memories to store"),
)

Source from the content-addressed store, hash-verified

264
265@mcp.tool()
266async def remember(
267 contents: list[str] = Field(description="List of observations or memories to store"),
268):
269 deps = Deps(openai=AsyncOpenAI(), pool=await get_db_pool())
270 try:
271 return "\n".join(await asyncio.gather(*[add_memory(content, deps) for content in contents]))
272 finally:
273 await deps.pool.close()
274
275
276@mcp.tool()

Callers

nothing calls this directly

Calls 4

DepsClass · 0.85
get_db_poolFunction · 0.85
add_memoryFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected