Skip to main content
POST
/
v1
/
knowledge
/
context
Context
curl --request POST \
  --url https://api.adapter.com/v1/knowledge/context \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "max_tokens": 4000,
  "sources": [
    "<string>"
  ]
}
'
{
  "context": "<string>",
  "entities": [
    {
      "entity_type": "<string>",
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "sources": [
    {
      "id": "<string>",
      "source_type": "<string>",
      "timestamp": "<string>",
      "title": "<string>"
    }
  ],
  "token_count": 1
}

Body

application/json
query
string
required

Topic or question to build context around (1–2000 chars).

Required string length: 1 - 2000
Example:

"what do we know about Acme Corp?"

max_tokens
integer | null
default:4000

Approximate max token budget for the context string. Default: 4000, max: 16000.

Required range: 100 <= x <= 16000
sources
string[] | null

Filter by source types (e.g. ["email", "calendar_event"]). Omit for all sources.

Response

Successful Response

context
string
required

Pre-formatted, LLM-ready context string ready to inject into a prompt.

entities
EntityRef · object[]
required
sources
SourceRef · object[]
required
token_count
integer
required
Required range: x >= 0