---
id: search-memories
title: "Search memory"
description: "Search memory using semantic similarity and spreading activation."
sidebar_label: "Search memory"
hide_title: true
hide_table_of_contents: true
api: eJztWN1vG7kR/1cI3kNaYyWtZMfX25dCSZzUQHLJ2eoVqGMYo92RlicuuUdyJauC/vdiSO56LcdK4T60BaoXSbszP873B3fcwdLy7IZ/wkqbLftcowEntLL8NuEF2tyImv7zjF8jmLxkVaBsrFBLZrEC5UTOrKiEBCPcloEqmK0NQkEUkDux9pDDr+qrYoyxWYlsAbm7c9saWQ0GKnRomLBM+8NAepCqsY7NkWmFTC+ywDxgrzbayOJVxj6gQgOSrZTeSCyWyGCuG8dq1LXEhNUScrQJwzUqZxOP6Uqhlpa5Ehwroa5RdbCwROVeZcybQqCNaBsidSWy6SXzJKwQReL10soyBytUERvsyrIazUKbCosOWNdCCa1eZV7zcIxlgYjNUQpc2IT4bI1kLYyyrgVuai2UszzhuvXMZcEzbr0v7qooKk94Z0Zy544rqJBn3B92JwqecEE+rMGVPOEGf2+EwYJnzjSYcJuXWAHPdpxcQvjOCLXkCXfCSXow9ZpfFny/vw38aN0bXWyJ6RAu18qhcvQK6lqK3As++s1SHO16p9WG1HKkQbbjvzdotseE+MUT7BPeRY8/Qm0/L7zSwmFlnwLsk/YBGAME0FGoRkpOGrVHvIfcsRm9JK5SqJVQy7t5UyzR9ZCFcrhE05NtFmnZm0BL2bOARjqejdN0n/AK7u+cXqGyR3E+wT2bBbIexFn60zkJZCDHHvtca4mg+mJ4ih7nAqTFfcK9w4RWdwW4A7MdWut56/wSQdg7Atk/GFbPf8PcPYqsm+jPHnuoIFchePhhfYnPWaULlJQeLEQ5Q1X4NBjyhOM9VLX0CvSC4Ib7msCTEPB0Zt/cZL2kDS/+N0roQhRsKkWOzMI2ZnoFeSkUMolglFDLP/MnZuOTdHI6SF8PTtPZ5DQ7S7M05d8IlHGadt6inNjTh6xja61sCPdJmtLXQZFt8hytXTSSXUVi/uKEMmgb6fzPLjUeU4jiWL5Ruifc4b07RjWj910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UN/k2c7zpqLpSpaFB4oFkWkNeIpsMqX40RvKMl87VNhuNNpvNEPzroTbLUeS1o4+Xby9+vr4YTIbpsHSVJGCSMZSL8TAdpvSIam0FqnfWo8ugwzqze+is/781+o/eGsUGSyVlVEsQfnbwobGLnfOGQy14wtfjttURX9a7OOpdMsUWepvwkrpvdsN3OypPfzVyv6fHsSHe3CZ8DUbAnPrSzY4XwtLvIt5HHImXP1zFgeOP7Dn527lCUeCtQTb0jyd8hdv+lZcfpUqEAo2XIbx+G04a+IHngf3J/EezWeCY5jnW7ijtbW8u+fL5esYTPo93YzTO84wb2NAwBZsgaojYsKTTsx1v+xDPeMCkzz8B+ztj2Q==
sidebar_class_name: "post api-method"
info_path: docs/api-reference/endpoints/agent-memory-api
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Search memory"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/agents/{agent_id}/memories/search"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Search memory using semantic similarity and spreading activation.

    The fact_type parameter is optional and must be one of:
    - 'world': General knowledge about people, places, events, and things that happen
    - 'agent': Memories about what the AI agent did, actions taken, and tasks performed
    - 'opinion': The agent's formed beliefs, perspectives, and viewpoints

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"type":"string","title":"Query"},"fact_type":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Fact Type"},"thinking_budget":{"type":"integer","title":"Thinking Budget","default":100},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096},"trace":{"type":"boolean","title":"Trace","default":false},"question_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Date"}},"type":"object","required":["query"],"title":"SearchRequest","description":"Request model for search endpoint.","example":{"fact_type":["world","agent"],"max_tokens":4096,"query":"What did Alice say about machine learning?","question_date":"2023-05-30T23:40:00","thinking_budget":100,"trace":true}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"results":{"items":{"properties":{"id":{"type":"string","title":"Id"},"text":{"type":"string","title":"Text"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"event_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Date"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"}},"type":"object","required":["id","text"],"title":"SearchResult","description":"Single search result item.","example":{"context":"work info","document_id":"session_abc123","event_date":"2024-01-15T10:30:00Z","id":"123e4567-e89b-12d3-a456-426614174000","text":"Alice works at Google on the AI team","type":"world"}},"type":"array","title":"Results"},"trace":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trace"}},"type":"object","required":["results"],"title":"SearchResponse","description":"Response model for search endpoints.","example":{"results":[{"context":"work info","event_date":"2024-01-15T10:30:00Z","id":"123e4567-e89b-12d3-a456-426614174000","text":"Alice works at Google on the AI team","type":"world"}],"trace":{"num_results":1,"query":"What did Alice say about machine learning?","time_seconds":0.123}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"}}}}}}
>
  
</StatusCodes>


      