search_memories
Search through saved conversation memories using vector similarity to find relevant information from previous interactions.
Instructions
Search the vector store for memories that match the query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- server.py:39-58 (handler)The @mcp.tool() decorator registers the search_memories handler function, which performs a vector store search using OpenAI client and returns matching memory texts.
@mcp.tool() def search_memories(query: str): """Search the vector store for memories that match the query.""" vector_store = get_or_create_vector_store() print(vector_store.id) results = client.vector_stores.search( vector_store_id=vector_store.id, query=query, ) print(results) # Handle SyncPage response - iterate through the data content_text = [] for item in results.data: if hasattr(item, 'content'): for content in item.content: if content.type == "text": content_text.append(content.text) return {"status": "success", "results": content_text}