forget
Delete memories permanently from your knowledge graph to remove outdated facts, reversed decisions, or duplicates.
Instructions
Remove a specific memory permanently from your knowledge graph.
This action is irreversible — the memory and its embeddings are deleted.
Use recall or list_memories first to find the correct memory_id.
Use this when:
A fact is no longer true:
forget("mem_abc123")A decision was reversed and the old one is misleading
Removing duplicate or incorrect memories
Do NOT use this to "update" a memory — instead, forget the old one
and remember the corrected version.
Args:
memory_id: The unique memory identifier (e.g., "mem_abc123") obtained
from remember, recall, or list_memories results.
Returns: Confirmation that the memory was deleted. Returns an error if the memory_id doesn't exist or has already been deleted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:89-112 (handler)The forget tool handler function. It is decorated with @mcp.tool() and accepts a memory_id parameter. The function proxies the call to a remote Astria instance via _proxy(). Includes full docstring describing the tool's purpose, arguments, and return values.
@mcp.tool() async def forget(memory_id: str) -> str: """Remove a specific memory permanently from your knowledge graph. This action is irreversible — the memory and its embeddings are deleted. Use `recall` or `list_memories` first to find the correct memory_id. Use this when: - A fact is no longer true: `forget("mem_abc123")` - A decision was reversed and the old one is misleading - Removing duplicate or incorrect memories Do NOT use this to "update" a memory — instead, forget the old one and `remember` the corrected version. Args: memory_id: The unique memory identifier (e.g., "mem_abc123") obtained from `remember`, `recall`, or `list_memories` results. Returns: Confirmation that the memory was deleted. Returns an error if the memory_id doesn't exist or has already been deleted. """ return await _proxy("forget", memory_id=memory_id) - server.py:432-452 (helper)The _proxy helper function that forwards tool calls to the remote Astria instance via SSE transport. All tools including forget use this to communicate with the backend memory service.
async def _proxy(tool_name: str, **kwargs) -> str: """Proxy a tool call to the remote Astria instance.""" headers = {} if API_KEY: headers["Authorization"] = f"Bearer {API_KEY}" try: transport = SSETransport(sse_url, headers=headers) async with Client(transport) as client: result = await client.call_tool(tool_name, kwargs) # FastMCP 3.2: result is CallToolResult with .content list if hasattr(result, 'content'): parts = result.content if parts and len(parts) > 0: return parts[0].text if hasattr(parts[0], 'text') else str(parts[0]) # Fallback for older API if hasattr(result, 'text'): return result.text return str(result) except Exception as e: return f"Connection error: {e}. Verify your ASTRIA_ENDPOINT and ASTRIA_API_KEY." - server.py:26-26 (registration)The FastMCP server instance creation. Tools are registered to this instance using the @mcp.tool() decorator.
mcp = FastMCP("Astria")