---
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: eJztWE1vGzcQ/SsDXmoD69WHZafdS+GkLmogqVPbaYEqRkAvR1rGFLklubIFQf+9GJIrraTYCYweWqA+CBbJGc68efNIaskEutLK2kujWcGucKKw9MC1gImxs0Zxj8A1cO0e0ELjpJ7CHdf3IAVqL/0igwdjlYAJL73LgqWppZZGu/yj/qgBAG4q6QC1qI3Uvohjgxyu0FuJc3SAjzVaibpEOCiNnqN1nEJywR/OUXt3GO2GXbvO1mBR4ZxrD96ArxD+atAuos3x9l7SeUqjDRMOKKHvHNRoXY2ll3Nsdxvl8MGhg7dv35HfDiZQGu3x0TdcJXSixUkO54/ehpAoeOeNRfp3ARofNpuSKxTR5jTE11jtoFZcaiDHyWsWkokpNg5FhLjrimXM1GgDYBeCFczGKrKM1dzyGXq0jhXjJdN8hqxglO4nKVjGJBW95r5iGbP4VyMtClZ422DGXFnhjLNiyfyiJjPnrdRTljEvvaKB18SDC8FWq9tojs6/NmJBNrveAlra0xSvayXLEG7vsyPeLTub1ZaS8RIdfQtFfC6G38KCVcbuGjHF4F/ghDfKs4Ip80BLd0xRNzNWjNPsLABRyWnFbjupRW/ZTn/EYVA4RxVKCBZLrlQvQQ7rQricgkocCVnrxeUkVGE7nlW2HtGNUmzVieJNMl9RpUrVCIz5dUO6rH3LJ4iLiNtcCEnjXIHgnsOBkI7fKRRwt4AE0CERZAvtwLLtYLcWrNZgmrvPkWFtqD+T6UUMMoW0h96XQ43UPrjjDsUnow9BamjhtOga5QOW+yhtO097J3e+4j40ThIu6SBsAEbncI1BJJYr+kRNuGRAbul7AgoOEkpFOyIOc7Z6BoGknTsYfMli0xvjRPDbPTdXsZ32MEzjMDMCVWJgxKrV15wo/shntQpsafsi0X3NSBZEWcZqcEIauS0rqHmNFoyGswtAX8nSsS32tRyhxFJ3sj8IbWFgYRrwldT3wO9M44F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-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"},"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","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>


      