---
id: reflect
title: "Reflect and generate answer"
description: "Reflect and formulate an answer using bank identity, world facts, and opinions."
sidebar_label: "Reflect and generate answer"
hide_title: true
hide_table_of_contents: true
api: eJztWG1vGzcS/isDfjkbWK9eYrt3CxSFk7o44eI4Zzs94FQjoJYjLWuK3JJcK4Kg/34YkiutpNgphH5pcf5g2FzO2zMzz5BcMYGutLL20mhWsDucKiw9cC1gauy8UdwjcA1cuwVaaJzUM5hw/QRSoPbSLzNYGKsETHnpXRYkTS21NNrlv+hfNADAQyUdoBa1kdoXcW2Qwx16K/EZHeCXGq1EXSKclEY/o3WcXHJBHz6j9u40yg27ch3TYFHhM9cevAFfIfzWoF1GmTe7tqTzFEbrJpxQQH9zUKN1NZZePmNr7TyHTw4dvH9/Q3o7mEBptMcvvuEqoRMlLnK4/uJtcImcd95YpD+XoHGxNUqqUESZy+BfY7WDWnGpgRQnrVkIJobYOBQR4q4qljFTow2AjQQrmI1ZZBmrueVz9GgdK8YrpvkcWcEo3M9SsIxJSnrNfcUyZvG3RloUrPC2wYy5ssI5Z8WK+WVNYs5bqWcsY156RQtvqQ5Ggq3Xj1EcnX9rxJJk9rUFtLSnT7yulSyDu71fHdXdqmOsthSMl+jov5DE13z4d9iwztikETMM+gVOeaM8K5gyC9q6J4q6mbNinL7OAxCVnFXssRNa1Jbt9UdcBoXPqEIKwWLJleolyGGTCJeTU6lGQtR6eTsNWdj1Z51tVnSjFFt3vHiXxNcZm0oV09jVJD3O3SFoT/gqZP/C5UFgN+i54J7DEy5DoQdzYDTZfuaqwWNj+DkI79sLq2Rozn1Z5TCawgejERbSV3Htc6Md+u8fqHriSuoii6WxAhYVWgzuSgfaeHDoA+Yd6Q4KE2MUct2B4Yb2waewb9+90RSiYa5c8jHZdcmwJ0qbd1HbuhHUpRqk6l+vN0VoJr/Gztz2xzjkq4NYm4ufQg4OfIvLofg29qcSlXA53CScdn09ecLl9yGJp3B7F/5tXT2lLfoA8Zza5Auf1wo3BcWcaWxJqdxBOLZ3KhHm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ncc5mVOyRKKq7ZarmpcVwjAnvm6sIub3vnZFr7dYLHIePufGznpJ1vXej95df7i/Phvm/bzycxXus2hddG+Q9/M+LVEBzLnu2Oo+hc1Q07W+PR/vR7naNv//X9D+pC9oiT1IrBc0UFWEElslWhiz50FnBmfhGY1Ei+17WssOjxmriFKKMVutaFR+smq9puXUf+NH6lkr6aoUWry9NrFiypXDVyrs5C6x6Cm85HdLlpqosqUGliUead0N46FCLtB2WOZdNHQWSHwrfTDTaN5EiauyxNq/uvexw7Ufb+8fCL30UEjnDXqz5ESV9Dt4atKFkF4SaW3FFNezhsZQwaJO+vkfSajKzA==
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={"Reflect and generate answer"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/v1/default/banks/{bank_id}/reflect"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Reflect and formulate an answer using bank identity, world facts, and opinions.

    This endpoint:
    1. Retrieves experience (conversations and events)
    2. Retrieves world facts relevant to the query
    3. Retrieves existing opinions (bank's perspectives)
    4. Uses LLM to formulate a contextual answer
    5. Extracts and stores any new opinions formed
    6. Returns plain text answer, the facts used, and new opinions

<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"},"budget":{"default":"low","type":"string","enum":["low","mid","high"],"title":"Budget","description":"Budget levels for recall/reflect operations."},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"filters":{"anyOf":[{"items":{"properties":{"key":{"type":"string","title":"Key","description":"Metadata key to filter on"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value","description":"Value to match. If None with match_unset=True, matches any record where key is not set."},"match_unset":{"type":"boolean","title":"Match Unset","description":"If True, also match records where this metadata key is not set","default":true}},"type":"object","required":["key"],"title":"MetadataFilter","description":"Filter for metadata fields. Matches records where (key=value) OR (key not set) when match_unset=True.","example":{"key":"source","match_unset":true,"value":"slack"}},"type":"array"},{"type":"null"}],"title":"Filters","description":"Filter by metadata. Multiple filters are ANDed together."},"include":{"description":"Options for including additional data (disabled by default)","properties":{"facts":{"anyOf":[{"properties":{},"type":"object","title":"FactsIncludeOptions","description":"Options for including facts (based_on) in reflect results."},{"type":"null"}],"description":"Include facts that the answer is based on. Set to {} to enable, null to disable (default: disabled)."}},"type":"object","title":"ReflectIncludeOptions"}},"type":"object","required":["query"],"title":"ReflectRequest","description":"Request model for reflect endpoint.","example":{"budget":"low","context":"This is for a research paper on AI ethics","filters":[{"key":"source","match_unset":true,"value":"slack"}],"include":{"facts":{}},"query":"What do you think about artificial intelligence?"}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"text":{"type":"string","title":"Text"},"based_on":{"items":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"text":{"type":"string","title":"Text"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"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"}},"type":"object","required":["text"],"title":"ReflectFact","description":"A fact used in think response.","example":{"context":"healthcare discussion","id":"123e4567-e89b-12d3-a456-426614174000","occurred_end":"2024-01-15T10:30:00Z","occurred_start":"2024-01-15T10:30:00Z","text":"AI is used in healthcare","type":"world"}},"type":"array","title":"Based On","default":[]}},"type":"object","required":["text"],"title":"ReflectResponse","description":"Response model for think endpoint.","example":{"based_on":[{"id":"123","text":"AI is used in healthcare","type":"world"},{"id":"456","text":"I discussed AI applications last week","type":"experience"}],"text":"Based on my understanding, AI is a transformative technology..."}}}}},"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>


      