78 lines
No EOL
11 KiB
Text
78 lines
No EOL
11 KiB
Text
---
|
|
id: recall-memories
|
|
title: "Recall memory"
|
|
description: "Recall memory using semantic similarity and spreading activation."
|
|
sidebar_label: "Recall memory"
|
|
hide_title: true
|
|
hide_table_of_contents: true
|
|
api: eJztWW1v2zgS/isDfkkLyO9J2go4HNI02Auw3XSb3C1w2cCgpbHNNUVqSSqJEfi/H4akbPk1aVocDovLhyaVhsN5fZ6h+MQcn1iW3rLPWGgzZ3cJy9FmRpROaMVS9hUzLiUU/jVUVqgJWCy4ciIDKwohuRFuDlzlYEuDPCcJnjlxz0lF+3f1uwIAuJkiuHmJUHLDC3RoQFjQfh8u/fqisg5GCFoh6HEa1rXg6EEbmR+l8BMqNFzCTOkHifkEgY905aBEXUpMoJQ8Q5sA3qNyNvE63VSoiQU35Q6mvCxRLdXiY4lGoMrwKAXvv0AbVa7eJZBpdY/GendIa+b/AMdnqOIm3M4slGjG2hSYL3fQpVBCq6PUez/ianZkIcjACKXAsU1omS2RAobR5nuBD6UWytk6eNfoQKhMVjkOUTnhBNq/OVMhOA0TdOAfzkGPLJoQeAtcajWxIkcwIYkGbSWdbbOE6RKNF7vMWcrC+2ERY8AStkwSFccTU7xAljLyYChyljBBtVFyN2UJM/hnJQzmLCWLEmazKRacpU+M8s1SZp0RasIS5oST9OAjVzO4zNlicReWo3UfdT6nNZvaMq0cKkeveFlKkXmzO39YKs+nxmalIacoMvS/Pys080M2/OoFFokX8Eu4ml+NvbvCYWG3F0dhljJuDKfFSwlVScnIm1r9jde62U0/C+tAj2HMM+e7wVICY3re5DjmlCB6Rg/EGJR2QNUhxgLzt2TBqMon6MMRxVnKCp+TTU9RVQW1ttQPLIkyUzGZsoaZH4O2TTvDY5B4j9JXbLSxY3AsMXOwrB/bJqMK/jh0eoaqGTWhHE7QNGL+mT/CTRBLVuYfdz+cUmgNz7CxfKS1RK4ay2+8RGPlmEuLiyQke+hEgdbxolxP5mYO9+fMlwTcLNVsRuXy+sp3L3eQ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nEK7iXN3eYrUGojdj9pyBq3RuJWoj+lteXDvucK/959RMygGFnMs40+nxbhdeULxLZt7cKNaaJWsaBy46Gy7THebqZYftOmm8rPp/5CAUsVjl+HjwOBNpw8t5eIgnk2e+C9RSm/H6bYpuisbjlDcByGB44HZ16IE8fEbzQzJIUQhntz8yvJjF1n3dZMRPBNxb5eMt82d9SikHGxjOK/rG0jkP6d65RagY+vZkE5jhPHxEWNLkcz7WRbWLp3f3Rf1i/ynH7uJsX30vouwVy4fK6kbCfSHffwO9teF6ikcWRoj+uUHvzgDmyI1tt8NZskk2YRYgCzc4YTklNOjlJSNCbxOlqJVfNjN8C48v7uKxLJyTbn/cIPXjJqX/nSnnrjHDqKoYLuPWe+VBm47YQ4uZVrllabfd6w8W8ah83O9vn47/xaXIA29eGKPN64/GOTou5IHJQ+ps7e0LJooa4Rd3+zn8Zx0M9EOLnRyik89oLZ9g82i9dyyjYEA4RD8DbORX2DrKNRBuFd4Q3f1ufArhO/RJ6R83N1+2FIbcFuimmmq51P5rkb9bSVnnvteJTNSh2xfbeYqXMItOfV3TCZjKEkYZ/rq6Trn4S38+Ii/G2pdAHV6hcismUwcUaDj7crnFSPULD95L+dgzPPM9E1E63IjC9dw6LCjv5Cax3ErkrOTZFKHfJtMrI1nKps6VNu10Hh4e2ty/bmsz6cS1tvPz5fnFL9cXrX672566QpJiul0M5vXa3XaXHlEVFFw19lq7iN3062nV8/+/sf1r3thGTCGu6pSSCw+XvuaeIljcsvteY3BN/HUtjYLp6t62ccUbUeMuYVOCnPSWPT2NuMV/GrlY0OPY6Ld3CbvnRtA3cw/29ffzOBofKMU3XyPKvoV9HtRgqqim77ms6H8sYTOcNy6cPX1MkedovAnh7XnYqOVBfrV6i/OIj8KKsyzD0h2UvWtg8Zer6xuKY7yapimWbss53afSv95SXS5P7P7ZE5NcTSqiqZQFnfTzH/FPUrU=
|
|
sidebar_class_name: "post api-method"
|
|
info_path: docs/api-reference/endpoints/hindsight-http-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={"Recall memory"}
|
|
>
|
|
</Heading>
|
|
|
|
<MethodEndpoint
|
|
method={"post"}
|
|
path={"/v1/default/banks/{bank_id}/memories/recall"}
|
|
context={"endpoint"}
|
|
>
|
|
|
|
</MethodEndpoint>
|
|
|
|
|
|
|
|
Recall memory using semantic similarity and spreading activation.
|
|
|
|
The type parameter is optional and must be one of:
|
|
- 'world': General knowledge about people, places, events, and things that happen
|
|
- 'experience': Memories about experience, conversations, actions taken, and tasks performed
|
|
- 'opinion': The bank's formed beliefs, perspectives, and viewpoints
|
|
|
|
Set include_entities=true to get entity observations alongside recall results.
|
|
|
|
<Heading
|
|
id={"request"}
|
|
as={"h2"}
|
|
className={"openapi-tabs__heading"}
|
|
children={"Request"}
|
|
>
|
|
</Heading>
|
|
|
|
<ParamsDetails
|
|
parameters={[{"name":"bank_id","in":"path","required":true,"schema":{"type":"string","title":"Bank Id"}}]}
|
|
>
|
|
|
|
</ParamsDetails>
|
|
|
|
<RequestSchema
|
|
title={"Body"}
|
|
body={{"required":true,"content":{"application/json":{"schema":{"properties":{"query":{"type":"string","title":"Query"},"types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Types","description":"List of fact types to recall (defaults to all if not specified)"},"budget":{"default":"mid","type":"string","enum":["low","mid","high"],"title":"Budget","description":"Budget levels for recall/reflect operations."},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096},"trace":{"type":"boolean","title":"Trace","default":false},"query_timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Timestamp","description":"ISO format date string (e.g., '2023-05-30T23:40:00')"},"include":{"description":"Options for including additional data (entities are included by default)","properties":{"entities":{"anyOf":[{"properties":{"max_tokens":{"type":"integer","title":"Max Tokens","description":"Maximum tokens for entity observations","default":500}},"type":"object","title":"EntityIncludeOptions","description":"Options for including entity observations in recall results."},{"type":"null"}],"description":"Include entity observations. Set to null to disable entity inclusion.","default":{"max_tokens":500}},"chunks":{"anyOf":[{"properties":{"max_tokens":{"type":"integer","title":"Max Tokens","description":"Maximum tokens for chunks (chunks may be truncated)","default":8192}},"type":"object","title":"ChunkIncludeOptions","description":"Options for including chunks in recall results."},{"type":"null"}],"description":"Include raw chunks. Set to {} to enable, null to disable (default: disabled)."}},"type":"object","title":"IncludeOptions"}},"type":"object","required":["query"],"title":"RecallRequest","description":"Request model for recall endpoint.","example":{"budget":"mid","include":{"entities":{"max_tokens":500}},"max_tokens":4096,"query":"What did Alice say about machine learning?","query_timestamp":"2023-05-30T23:40:00","trace":true,"types":["world","experience"]}}}}}}
|
|
>
|
|
|
|
</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"},"entities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entities"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"occurred_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurred Start"},"occurred_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occurred End"},"mentioned_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mentioned At"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"},"chunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chunk Id"}},"type":"object","required":["id","text"],"title":"RecallResult","description":"Single recall result item.","example":{"chunk_id":"456e7890-e12b-34d5-a678-901234567890","context":"work info","document_id":"session_abc123","entities":["Alice","Google"],"id":"123e4567-e89b-12d3-a456-426614174000","mentioned_at":"2024-01-15T10:30:00Z","metadata":{"source":"slack"},"occurred_end":"2024-01-15T10:30:00Z","occurred_start":"2024-01-15T10:30:00Z","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"},"entities":{"anyOf":[{"additionalProperties":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"canonical_name":{"type":"string","title":"Canonical Name"},"observations":{"items":{"properties":{"text":{"type":"string","title":"Text"},"mentioned_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mentioned At"}},"type":"object","required":["text"],"title":"EntityObservationResponse","description":"An observation about an entity."},"type":"array","title":"Observations"}},"type":"object","required":["entity_id","canonical_name","observations"],"title":"EntityStateResponse","description":"Current mental model of an entity."},"type":"object"},{"type":"null"}],"title":"Entities","description":"Entity states for entities mentioned in results"},"chunks":{"anyOf":[{"additionalProperties":{"properties":{"id":{"type":"string","title":"Id"},"text":{"type":"string","title":"Text"},"chunk_index":{"type":"integer","title":"Chunk Index"},"truncated":{"type":"boolean","title":"Truncated","description":"Whether the chunk text was truncated due to token limits","default":false}},"type":"object","required":["id","text","chunk_index"],"title":"ChunkData","description":"Chunk data for a single chunk."},"type":"object"},{"type":"null"}],"title":"Chunks","description":"Chunks for facts, keyed by chunk_id"}},"type":"object","required":["results"],"title":"RecallResponse","description":"Response model for recall endpoints.","example":{"chunks":{"456e7890-e12b-34d5-a678-901234567890":{"chunk_index":0,"id":"456e7890-e12b-34d5-a678-901234567890","text":"Alice works at Google on the AI team. She's been there for 3 years..."}},"entities":{"Alice":{"canonical_name":"Alice","entity_id":"123e4567-e89b-12d3-a456-426614174001","observations":[{"mentioned_at":"2024-01-15T10:30:00Z","text":"Alice works at Google on the AI team"}]}},"results":[{"chunk_id":"456e7890-e12b-34d5-a678-901234567890","context":"work info","entities":["Alice","Google"],"id":"123e4567-e89b-12d3-a456-426614174000","occurred_end":"2024-01-15T10:30:00Z","occurred_start":"2024-01-15T10:30:00Z","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>
|
|
|
|
|
|
|