Skip to content

cURL Examples

Fresh

Source: docs.hindsight.vectorize.io/curl-examples

Authentication

All requests require:

-H "Authorization: Bearer your-api-key"

Base URL: https://api.hindsight.vectorize.io

Memory Banks

List Banks

bash
curl -X GET https://api.hindsight.vectorize.io/v1/default/banks \
  -H "Authorization: Bearer your-api-key"

Get a Bank

bash
curl -X GET https://api.hindsight.vectorize.io/v1/default/banks/my-assistant \
  -H "Authorization: Bearer your-api-key"

Retain (Store Memories)

Basic

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"content": "The user prefers dark mode and concise responses."}]}'

Multiple Items

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {"content": "User works in the tech industry"},
      {"content": "User prefers morning meetings"},
      {"content": "User is based in San Francisco"}
    ]
  }'

With Context and Timestamp

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "content": "Customer reported a checkout issue with error code E-1234.",
        "context": "support_ticket",
        "timestamp": "2024-03-15T10:00:00Z"
      }
    ]
  }'

Async Processing

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"content": "First memory"}, {"content": "Second memory"}], "async": true}'

Recall (Search Memories)

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories/recall \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"query": "What are the user preferences?"}'

Filter by Type

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories/recall \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"query": "user preferences", "types": ["observation"]}'

With Debug Trace

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories/recall \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"query": "project deadlines", "trace": true}'

Temporal Query

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/memories/recall \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"query": "What happened last week?", "query_timestamp": "2024-03-15T10:00:00"}'

Reflect (Reasoning)

Basic

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/reflect \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"query": "What should I know about this customer before our call?"}'

With Context

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/reflect \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"query": "What are the main concerns?", "context": "Preparing for quarterly review"}'

With Structured Output

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/reflect \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Summarize the key points about this user",
    "response_schema": {
      "type": "object",
      "properties": {
        "summary": {"type": "string"},
        "key_points": {"type": "array", "items": {"type": "string"}}
      },
      "required": ["summary", "key_points"]
    }
  }'

Mental Models

Create

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"name": "User Profile", "source_query": "What do we know about this user?"}'

Create with Options

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Team Directory",
    "source_query": "Who works here and what do they do?",
    "tags": ["team", "directory"],
    "max_tokens": 4096,
    "trigger": {"refresh_after_consolidation": true}
  }'

List

bash
curl -X GET https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models \
  -H "Authorization: Bearer your-api-key"

Get

bash
curl -X GET https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models/mm_abc123 \
  -H "Authorization: Bearer your-api-key"

Refresh

bash
curl -X POST https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models/mm_abc123/refresh \
  -H "Authorization: Bearer your-api-key"

Update

bash
curl -X PATCH https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models/mm_abc123 \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated Profile", "source_query": "What are the key preferences?"}'

Delete

bash
curl -X DELETE https://api.hindsight.vectorize.io/v1/default/banks/my-assistant/mental-models/mm_abc123 \
  -H "Authorization: Bearer your-api-key"

Scoped API Keys

Create

bash
curl -X POST https://api.hindsight.vectorize.io/v1/api-keys/scoped \
  -H "Authorization: Bearer <parent-key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Agent - Task 42", "allowed_bank_ids": ["bank-a"], "expires_in_days": 7}'

List

bash
curl https://api.hindsight.vectorize.io/v1/api-keys/scoped \
  -H "Authorization: Bearer <parent-key>"

Revoke

bash
curl -X DELETE https://api.hindsight.vectorize.io/v1/api-keys/scoped/<key-id> \
  -H "Authorization: Bearer <parent-key>"

Tips

Pretty Print

bash
curl -s ... | jq '.'

Save Response

bash
curl -s ... > response.json

Read from File

bash
curl -X POST ... -d @request.json

Debug Mode

bash
curl -v ...