v1

latestOpenAPI 3.0.3Apache 2.02026-07-1372170520.1 KB
Manage Assistants

Retrieve context from an assistant

Retrieve context snippets from an assistant to use as part of RAG or any agentic flow.

For guidance and examples, see Retrieve context snippets.

post/chat/{assistant_name}/context

Path parameters

assistant_namestring required

The name of the assistant to be described.

Headers

X-Pinecone-Api-Versionstring required

Required date-based version header

Request body

querystring

The query that is used to generate the context. Exactly one of query or messages should be provided.

filterobject

Optionally filter which documents can be retrieved using the following metadata fields.

top_kinteger

The maximum number of context snippets to return. Default is 16. Maximum is 64.

snippet_sizeinteger

The maximum context snippet size. Default is 2048 tokens. Minimum is 512 tokens. Maximum is 8192 tokens.

multimodalboolean

Whether or not to retrieve image-related context snippets. If false, only text snippets are returned.

include_binary_contentboolean

If image-related context snippets are returned, this field determines whether or not they should include base64 image data. If false, only the image captions are returned. Only available when multimodal=true.

Example request

{
  "filter": {
    "genre": {
      "$ne": "documentary"
    }
  },
  "top_k": 20,
  "snippet_size": 4096
}

Response

Context retrieval process successful.

idstring

A unique identifier for this context response.

Example response

{
  "snippets": [
    {
      "reference": {
        "file": {
          "size": 1048576,
          "metadata": {
            "created_by": "Jane Doe",
            "published": "2025-10-01",
            "tags": [
              "report",
              "Q4",
              "analytics"
            ]
          },
          "created_on": "2025-10-01T12:30:00Z",
          "updated_on": "2025-10-01T12:45:00Z",
          "signed_url": "https://storage.googleapis.com/bucket/file.pdf?..."
        }
      }
    }
  ]
}