Reflect and generate answer
POST/v1/default/banks/{bank_id}/reflectReflect and formulate an answer using bank identity, world facts, and opinions.
This endpoint:
- Retrieves experience (conversations and events)
- Retrieves world facts relevant to the query
- Retrieves existing opinions (bank's perspectives)
- Uses LLM to formulate a contextual answer
- Returns plain text answer and the facts used
Authentication required — include an
Authorization: Bearer hsk_...header. See Authentication for details.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bank_id | string | Yes |
Request Body
Content-Type: application/json
json
{
"budget": "low",
"include": {
"facts": {}
},
"max_tokens": 4096,
"query": "What do you think about artificial intelligence?",
"response_schema": {
"properties": {
"summary": {
"type": "string"
},
"key_points": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"summary",
"key_points"
],
"type": "object"
},
"tags": [
"user_a"
],
"tags_match": "any"
}Example Request
bash
curl -X POST 'https://api.hindsight.vectorize.io/v1/default/banks/your-bank-id/reflect' \
-H 'Authorization: Bearer hsk_your_api_key' \
-H 'Content-Type: application/json' \
-d '{
"budget": "low",
"include": {
"facts": {}
},
"max_tokens": 4096,
"query": "What do you think about artificial intelligence?",
"response_schema": {
"properties": {
"summary": {
"type": "string"
},
"key_points": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"summary",
"key_points"
],
"type": "object"
},
"tags": [
"user_a"
],
"tags_match": "any"
}'Responses
200 — Successful Response
json
{
"based_on": {
"memories": [
{
"id": "123",
"text": "AI is used in healthcare",
"type": "world"
},
{
"id": "456",
"text": "I discussed AI applications last week",
"type": "experience"
}
]
},
"structured_output": {
"key_points": [
"Used in healthcare",
"Discussed recently"
],
"summary": "AI is transformative"
},
"text": "## AI Overview\n\nBased on my understanding, AI is a **transformative technology**:\n\n- Used extensively in healthcare\n- Discussed in recent conversations\n- Continues to evolve rapidly",
"trace": {
"llm_calls": [
{
"duration_ms": 1200,
"scope": "agent_1"
}
],
"observations": [
{
"id": "obs-1",
"name": "AI Technology",
"subtype": "structural",
"type": "concept"
}
],
"tool_calls": [
{
"duration_ms": 150,
"input": {
"query": "AI"
},
"tool": "recall"
}
]
},
"usage": {
"input_tokens": 1500,
"output_tokens": 500,
"total_tokens": 2000
}
}422 — Validation Error
json
{
"detail": [
{
"loc": [
null
],
"msg": "Message",
"type": "Error Type",
"input": null,
"ctx": {},
"url": "URL"
}
]
}