---
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+GkLmogqVPbaYE6RkAtR1rGFLklubIFQf+9GJIrraTYCYweWqA+CBbJGc68efNIask8nzpW3LJ3ODN2we4yJtCVVtZeGs0KdoUThaUHrgVMjJ01insEroFr94AWGif1FMZc34MUqL30iwwejFUCJrz0LguWppZaGu3yj/qjBgC4qaQD1KI2Uvsijg1yuEJvJc7RAT7WaCXqEuGgNHqO1nEKyQV/OEft3WG0G3btOluDRYVzrj14A75C+KtBu4g2x9t7SecpjTZMOKCEvnNQo3U1ll7Osd1tlMMHhw7evn1HfjuYQGm0x0ffcJXQiRYnOZw/ehtCouCdNxbp3wVofNhsSq5QRJvTEF9jtYNacamBHCevWUgmptg4FBHiriuWMVOjDYBdCFYwG6vIMlZzy2fo0VLVl0zzGbKCUbqfpGAZk1T0mvuKZcziX420KFjhbYMZc2WFM86KJfOLmsyct1JPWca89IoGXhMPLgRbre6iOTr/2ogF2ex6C2hpT1O8rpUsQ7i9z454t+xsVltKxkt09C0U8bkYfgsLVhkbN2KKwb/ACW+UZwVT5oGW7piibmbUBHF2FoCo5LSidlinFr3t9kccBoVzVKGEYLHkSvUS5LAuhMspqMSRkLVeXE5CFbbjWWXrEd0oxVadKN4k8xVVqlSNwJhfN6TL2rd8griIuM2FkDTOFQjuORwI6fhYoYDxAhJAh0SQLbQDy7aD3VqwWoNpxp8jw9pQfybTixhkCmkPvS+HGql9MOYOxSejD0FqaOG06BrlA5b7KG07T3snd77iPjROEi7pIGwARudwjUEkliv6RE24ZEBu6XsCCg4SSkU7Ig5ztnoGgaSdOxh8yWLTG7eJ4Hd7bq5iO+1hmMZhZgSqxMCIVauvOVH8kc9qFdjS9kWi+5qRLIiyjNXghDRyW1ZQ8xotGA1nF4C+kqVjW+xrOUKJpe5kfxDawsDCNOArqe+B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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"},"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>


      