curl --request POST \
--url https://{host}/api/contexts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": true,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": true
},
"keyword": {
"enabled": true
}
},
"artifacts": {
"enabled": false,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": [
"<string>"
],
"sections": [
"<string>"
],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": [
"<string>"
]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": [
"<string>"
]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
}
},
"kind": "search"
}
'import requests
url = "https://{host}/api/contexts"
payload = {
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": True,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": True
},
"keyword": { "enabled": True }
},
"artifacts": {
"enabled": False,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": ["<string>"],
"sections": ["<string>"],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": ["<string>"]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": ["<string>"]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
}
},
"kind": "search"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
name: '<string>',
description: '<string>',
guide: '<string>',
manifest: {
curate: {
chunks: {
enabled: true,
embedding_model: 'multilingual-e5-large',
chunking: {
strategy: 'markdown_heading',
target_size: 512,
overlap: 64,
respect_sections: true
},
keyword: {enabled: true}
},
artifacts: {
enabled: false,
artifact_model: 'lite',
artifact_types: [
{
name: '<string>',
kind: 'topic',
scope: 'corpus',
icon: '<string>',
description: '<string>',
coverage: ['<string>'],
sections: ['<string>'],
min_doc_count: 1,
format: 'markdown',
columns: [{name: '<string>', type: 'TEXT', description: '<string>'}],
natural_key: ['<string>']
}
],
edge_types: [
{
name: '<string>',
from: '<string>',
to: '<string>',
description: '<string>',
attributes: ['<string>']
}
],
min_doc_count: 1,
max_tokens: 1500,
max_doc_chars: 60000,
extraction_window_chars: 0,
mention_max_chars: 400,
max_mentions_per_artifact: 40,
mention_context_chars: 8000,
max_artifacts_per_type: 10000
}
},
optimize: {
schedule: '0 * * * *',
latency_threshold_ms: 60000,
min_group_size: 2,
eval_pass_rate_threshold: 1,
max_iterations: 20
}
},
kind: 'search'
})
};
fetch('https://{host}/api/contexts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/contexts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'name' => '<string>',
'description' => '<string>',
'guide' => '<string>',
'manifest' => [
'curate' => [
'chunks' => [
'enabled' => true,
'embedding_model' => 'multilingual-e5-large',
'chunking' => [
'strategy' => 'markdown_heading',
'target_size' => 512,
'overlap' => 64,
'respect_sections' => true
],
'keyword' => [
'enabled' => true
]
],
'artifacts' => [
'enabled' => false,
'artifact_model' => 'lite',
'artifact_types' => [
[
'name' => '<string>',
'kind' => 'topic',
'scope' => 'corpus',
'icon' => '<string>',
'description' => '<string>',
'coverage' => [
'<string>'
],
'sections' => [
'<string>'
],
'min_doc_count' => 1,
'format' => 'markdown',
'columns' => [
[
'name' => '<string>',
'type' => 'TEXT',
'description' => '<string>'
]
],
'natural_key' => [
'<string>'
]
]
],
'edge_types' => [
[
'name' => '<string>',
'from' => '<string>',
'to' => '<string>',
'description' => '<string>',
'attributes' => [
'<string>'
]
]
],
'min_doc_count' => 1,
'max_tokens' => 1500,
'max_doc_chars' => 60000,
'extraction_window_chars' => 0,
'mention_max_chars' => 400,
'max_mentions_per_artifact' => 40,
'mention_context_chars' => 8000,
'max_artifacts_per_type' => 10000
]
],
'optimize' => [
'schedule' => '0 * * * *',
'latency_threshold_ms' => 60000,
'min_group_size' => 2,
'eval_pass_rate_threshold' => 1,
'max_iterations' => 20
]
],
'kind' => 'search'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/contexts"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"guide\": \"<string>\",\n \"manifest\": {\n \"curate\": {\n \"chunks\": {\n \"enabled\": true,\n \"embedding_model\": \"multilingual-e5-large\",\n \"chunking\": {\n \"strategy\": \"markdown_heading\",\n \"target_size\": 512,\n \"overlap\": 64,\n \"respect_sections\": true\n },\n \"keyword\": {\n \"enabled\": true\n }\n },\n \"artifacts\": {\n \"enabled\": false,\n \"artifact_model\": \"lite\",\n \"artifact_types\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"topic\",\n \"scope\": \"corpus\",\n \"icon\": \"<string>\",\n \"description\": \"<string>\",\n \"coverage\": [\n \"<string>\"\n ],\n \"sections\": [\n \"<string>\"\n ],\n \"min_doc_count\": 1,\n \"format\": \"markdown\",\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"type\": \"TEXT\",\n \"description\": \"<string>\"\n }\n ],\n \"natural_key\": [\n \"<string>\"\n ]\n }\n ],\n \"edge_types\": [\n {\n \"name\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"description\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ]\n }\n ],\n \"min_doc_count\": 1,\n \"max_tokens\": 1500,\n \"max_doc_chars\": 60000,\n \"extraction_window_chars\": 0,\n \"mention_max_chars\": 400,\n \"max_mentions_per_artifact\": 40,\n \"mention_context_chars\": 8000,\n \"max_artifacts_per_type\": 10000\n }\n },\n \"optimize\": {\n \"schedule\": \"0 * * * *\",\n \"latency_threshold_ms\": 60000,\n \"min_group_size\": 2,\n \"eval_pass_rate_threshold\": 1,\n \"max_iterations\": 20\n }\n },\n \"kind\": \"search\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/contexts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"guide\": \"<string>\",\n \"manifest\": {\n \"curate\": {\n \"chunks\": {\n \"enabled\": true,\n \"embedding_model\": \"multilingual-e5-large\",\n \"chunking\": {\n \"strategy\": \"markdown_heading\",\n \"target_size\": 512,\n \"overlap\": 64,\n \"respect_sections\": true\n },\n \"keyword\": {\n \"enabled\": true\n }\n },\n \"artifacts\": {\n \"enabled\": false,\n \"artifact_model\": \"lite\",\n \"artifact_types\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"topic\",\n \"scope\": \"corpus\",\n \"icon\": \"<string>\",\n \"description\": \"<string>\",\n \"coverage\": [\n \"<string>\"\n ],\n \"sections\": [\n \"<string>\"\n ],\n \"min_doc_count\": 1,\n \"format\": \"markdown\",\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"type\": \"TEXT\",\n \"description\": \"<string>\"\n }\n ],\n \"natural_key\": [\n \"<string>\"\n ]\n }\n ],\n \"edge_types\": [\n {\n \"name\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"description\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ]\n }\n ],\n \"min_doc_count\": 1,\n \"max_tokens\": 1500,\n \"max_doc_chars\": 60000,\n \"extraction_window_chars\": 0,\n \"mention_max_chars\": 400,\n \"max_mentions_per_artifact\": 40,\n \"mention_context_chars\": 8000,\n \"max_artifacts_per_type\": 10000\n }\n },\n \"optimize\": {\n \"schedule\": \"0 * * * *\",\n \"latency_threshold_ms\": 60000,\n \"min_group_size\": 2,\n \"eval_pass_rate_threshold\": 1,\n \"max_iterations\": 20\n }\n },\n \"kind\": \"search\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/contexts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"guide\": \"<string>\",\n \"manifest\": {\n \"curate\": {\n \"chunks\": {\n \"enabled\": true,\n \"embedding_model\": \"multilingual-e5-large\",\n \"chunking\": {\n \"strategy\": \"markdown_heading\",\n \"target_size\": 512,\n \"overlap\": 64,\n \"respect_sections\": true\n },\n \"keyword\": {\n \"enabled\": true\n }\n },\n \"artifacts\": {\n \"enabled\": false,\n \"artifact_model\": \"lite\",\n \"artifact_types\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"topic\",\n \"scope\": \"corpus\",\n \"icon\": \"<string>\",\n \"description\": \"<string>\",\n \"coverage\": [\n \"<string>\"\n ],\n \"sections\": [\n \"<string>\"\n ],\n \"min_doc_count\": 1,\n \"format\": \"markdown\",\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"type\": \"TEXT\",\n \"description\": \"<string>\"\n }\n ],\n \"natural_key\": [\n \"<string>\"\n ]\n }\n ],\n \"edge_types\": [\n {\n \"name\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"description\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ]\n }\n ],\n \"min_doc_count\": 1,\n \"max_tokens\": 1500,\n \"max_doc_chars\": 60000,\n \"extraction_window_chars\": 0,\n \"mention_max_chars\": 400,\n \"max_mentions_per_artifact\": 40,\n \"mention_context_chars\": 8000,\n \"max_artifacts_per_type\": 10000\n }\n },\n \"optimize\": {\n \"schedule\": \"0 * * * *\",\n \"latency_threshold_ms\": 60000,\n \"min_group_size\": 2,\n \"eval_pass_rate_threshold\": 1,\n \"max_iterations\": 20\n }\n },\n \"kind\": \"search\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"kind": "search",
"created_by": "<string>",
"description": "<string>",
"is_optimizing": true,
"has_sources": true,
"is_curating": true,
"is_importing": true,
"is_exploring": true,
"is_restoring": true,
"is_grooming": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"workspace": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": true,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": true
},
"keyword": {
"enabled": true
}
},
"artifacts": {
"enabled": false,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": [
"<string>"
],
"sections": [
"<string>"
],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": [
"<string>"
]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": [
"<string>"
]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
}
},
"optimize_task_id": "<string>",
"optimize_score": 123,
"optimize_iterations": 123,
"last_optimized_at": "2023-11-07T05:31:56Z",
"last_curated_at": "2023-11-07T05:31:56Z",
"last_source_import_at": "2023-11-07T05:31:56Z",
"curate_task_id": "<string>",
"import_task_id": "<string>",
"explore_task_id": "<string>",
"restore_task_id": "<string>",
"manifest_suggestion": {
"matches": [
{
"template_id": "<string>",
"rationale": "<string>",
"confidence": 123
}
],
"none": true,
"explored_at": "2023-11-07T05:31:56Z",
"task_id": "<string>"
},
"sample_queries": [
"<string>"
],
"groom_task_id": "<string>",
"groom_artifact_count": 123,
"last_groomed_at": "2023-11-07T05:31:56Z",
"stats": {
"tasks_total": 123,
"tasks_active": 123,
"tasks_completed": 123,
"tasks_failed": 123,
"tasks_cancelled": 123,
"tokens_total": 123,
"runtime_seconds": 123
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Create a context
The context is created empty and is not queryable until you import sources and curate them (curate is explicit — there is no auto-curate). Optionally seed a manifest. A work context is the exception: it is queryable from day zero and is built from traces of work rather than source documents.
curl --request POST \
--url https://{host}/api/contexts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": true,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": true
},
"keyword": {
"enabled": true
}
},
"artifacts": {
"enabled": false,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": [
"<string>"
],
"sections": [
"<string>"
],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": [
"<string>"
]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": [
"<string>"
]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
}
},
"kind": "search"
}
'import requests
url = "https://{host}/api/contexts"
payload = {
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": True,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": True
},
"keyword": { "enabled": True }
},
"artifacts": {
"enabled": False,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": ["<string>"],
"sections": ["<string>"],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": ["<string>"]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": ["<string>"]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
}
},
"kind": "search"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
name: '<string>',
description: '<string>',
guide: '<string>',
manifest: {
curate: {
chunks: {
enabled: true,
embedding_model: 'multilingual-e5-large',
chunking: {
strategy: 'markdown_heading',
target_size: 512,
overlap: 64,
respect_sections: true
},
keyword: {enabled: true}
},
artifacts: {
enabled: false,
artifact_model: 'lite',
artifact_types: [
{
name: '<string>',
kind: 'topic',
scope: 'corpus',
icon: '<string>',
description: '<string>',
coverage: ['<string>'],
sections: ['<string>'],
min_doc_count: 1,
format: 'markdown',
columns: [{name: '<string>', type: 'TEXT', description: '<string>'}],
natural_key: ['<string>']
}
],
edge_types: [
{
name: '<string>',
from: '<string>',
to: '<string>',
description: '<string>',
attributes: ['<string>']
}
],
min_doc_count: 1,
max_tokens: 1500,
max_doc_chars: 60000,
extraction_window_chars: 0,
mention_max_chars: 400,
max_mentions_per_artifact: 40,
mention_context_chars: 8000,
max_artifacts_per_type: 10000
}
},
optimize: {
schedule: '0 * * * *',
latency_threshold_ms: 60000,
min_group_size: 2,
eval_pass_rate_threshold: 1,
max_iterations: 20
}
},
kind: 'search'
})
};
fetch('https://{host}/api/contexts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/contexts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'name' => '<string>',
'description' => '<string>',
'guide' => '<string>',
'manifest' => [
'curate' => [
'chunks' => [
'enabled' => true,
'embedding_model' => 'multilingual-e5-large',
'chunking' => [
'strategy' => 'markdown_heading',
'target_size' => 512,
'overlap' => 64,
'respect_sections' => true
],
'keyword' => [
'enabled' => true
]
],
'artifacts' => [
'enabled' => false,
'artifact_model' => 'lite',
'artifact_types' => [
[
'name' => '<string>',
'kind' => 'topic',
'scope' => 'corpus',
'icon' => '<string>',
'description' => '<string>',
'coverage' => [
'<string>'
],
'sections' => [
'<string>'
],
'min_doc_count' => 1,
'format' => 'markdown',
'columns' => [
[
'name' => '<string>',
'type' => 'TEXT',
'description' => '<string>'
]
],
'natural_key' => [
'<string>'
]
]
],
'edge_types' => [
[
'name' => '<string>',
'from' => '<string>',
'to' => '<string>',
'description' => '<string>',
'attributes' => [
'<string>'
]
]
],
'min_doc_count' => 1,
'max_tokens' => 1500,
'max_doc_chars' => 60000,
'extraction_window_chars' => 0,
'mention_max_chars' => 400,
'max_mentions_per_artifact' => 40,
'mention_context_chars' => 8000,
'max_artifacts_per_type' => 10000
]
],
'optimize' => [
'schedule' => '0 * * * *',
'latency_threshold_ms' => 60000,
'min_group_size' => 2,
'eval_pass_rate_threshold' => 1,
'max_iterations' => 20
]
],
'kind' => 'search'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/contexts"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"guide\": \"<string>\",\n \"manifest\": {\n \"curate\": {\n \"chunks\": {\n \"enabled\": true,\n \"embedding_model\": \"multilingual-e5-large\",\n \"chunking\": {\n \"strategy\": \"markdown_heading\",\n \"target_size\": 512,\n \"overlap\": 64,\n \"respect_sections\": true\n },\n \"keyword\": {\n \"enabled\": true\n }\n },\n \"artifacts\": {\n \"enabled\": false,\n \"artifact_model\": \"lite\",\n \"artifact_types\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"topic\",\n \"scope\": \"corpus\",\n \"icon\": \"<string>\",\n \"description\": \"<string>\",\n \"coverage\": [\n \"<string>\"\n ],\n \"sections\": [\n \"<string>\"\n ],\n \"min_doc_count\": 1,\n \"format\": \"markdown\",\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"type\": \"TEXT\",\n \"description\": \"<string>\"\n }\n ],\n \"natural_key\": [\n \"<string>\"\n ]\n }\n ],\n \"edge_types\": [\n {\n \"name\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"description\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ]\n }\n ],\n \"min_doc_count\": 1,\n \"max_tokens\": 1500,\n \"max_doc_chars\": 60000,\n \"extraction_window_chars\": 0,\n \"mention_max_chars\": 400,\n \"max_mentions_per_artifact\": 40,\n \"mention_context_chars\": 8000,\n \"max_artifacts_per_type\": 10000\n }\n },\n \"optimize\": {\n \"schedule\": \"0 * * * *\",\n \"latency_threshold_ms\": 60000,\n \"min_group_size\": 2,\n \"eval_pass_rate_threshold\": 1,\n \"max_iterations\": 20\n }\n },\n \"kind\": \"search\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/contexts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"guide\": \"<string>\",\n \"manifest\": {\n \"curate\": {\n \"chunks\": {\n \"enabled\": true,\n \"embedding_model\": \"multilingual-e5-large\",\n \"chunking\": {\n \"strategy\": \"markdown_heading\",\n \"target_size\": 512,\n \"overlap\": 64,\n \"respect_sections\": true\n },\n \"keyword\": {\n \"enabled\": true\n }\n },\n \"artifacts\": {\n \"enabled\": false,\n \"artifact_model\": \"lite\",\n \"artifact_types\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"topic\",\n \"scope\": \"corpus\",\n \"icon\": \"<string>\",\n \"description\": \"<string>\",\n \"coverage\": [\n \"<string>\"\n ],\n \"sections\": [\n \"<string>\"\n ],\n \"min_doc_count\": 1,\n \"format\": \"markdown\",\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"type\": \"TEXT\",\n \"description\": \"<string>\"\n }\n ],\n \"natural_key\": [\n \"<string>\"\n ]\n }\n ],\n \"edge_types\": [\n {\n \"name\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"description\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ]\n }\n ],\n \"min_doc_count\": 1,\n \"max_tokens\": 1500,\n \"max_doc_chars\": 60000,\n \"extraction_window_chars\": 0,\n \"mention_max_chars\": 400,\n \"max_mentions_per_artifact\": 40,\n \"mention_context_chars\": 8000,\n \"max_artifacts_per_type\": 10000\n }\n },\n \"optimize\": {\n \"schedule\": \"0 * * * *\",\n \"latency_threshold_ms\": 60000,\n \"min_group_size\": 2,\n \"eval_pass_rate_threshold\": 1,\n \"max_iterations\": 20\n }\n },\n \"kind\": \"search\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/contexts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"guide\": \"<string>\",\n \"manifest\": {\n \"curate\": {\n \"chunks\": {\n \"enabled\": true,\n \"embedding_model\": \"multilingual-e5-large\",\n \"chunking\": {\n \"strategy\": \"markdown_heading\",\n \"target_size\": 512,\n \"overlap\": 64,\n \"respect_sections\": true\n },\n \"keyword\": {\n \"enabled\": true\n }\n },\n \"artifacts\": {\n \"enabled\": false,\n \"artifact_model\": \"lite\",\n \"artifact_types\": [\n {\n \"name\": \"<string>\",\n \"kind\": \"topic\",\n \"scope\": \"corpus\",\n \"icon\": \"<string>\",\n \"description\": \"<string>\",\n \"coverage\": [\n \"<string>\"\n ],\n \"sections\": [\n \"<string>\"\n ],\n \"min_doc_count\": 1,\n \"format\": \"markdown\",\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"type\": \"TEXT\",\n \"description\": \"<string>\"\n }\n ],\n \"natural_key\": [\n \"<string>\"\n ]\n }\n ],\n \"edge_types\": [\n {\n \"name\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"description\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ]\n }\n ],\n \"min_doc_count\": 1,\n \"max_tokens\": 1500,\n \"max_doc_chars\": 60000,\n \"extraction_window_chars\": 0,\n \"mention_max_chars\": 400,\n \"max_mentions_per_artifact\": 40,\n \"mention_context_chars\": 8000,\n \"max_artifacts_per_type\": 10000\n }\n },\n \"optimize\": {\n \"schedule\": \"0 * * * *\",\n \"latency_threshold_ms\": 60000,\n \"min_group_size\": 2,\n \"eval_pass_rate_threshold\": 1,\n \"max_iterations\": 20\n }\n },\n \"kind\": \"search\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"kind": "search",
"created_by": "<string>",
"description": "<string>",
"is_optimizing": true,
"has_sources": true,
"is_curating": true,
"is_importing": true,
"is_exploring": true,
"is_restoring": true,
"is_grooming": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"workspace": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": true,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": true
},
"keyword": {
"enabled": true
}
},
"artifacts": {
"enabled": false,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": [
"<string>"
],
"sections": [
"<string>"
],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": [
"<string>"
]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": [
"<string>"
]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
}
},
"optimize_task_id": "<string>",
"optimize_score": 123,
"optimize_iterations": 123,
"last_optimized_at": "2023-11-07T05:31:56Z",
"last_curated_at": "2023-11-07T05:31:56Z",
"last_source_import_at": "2023-11-07T05:31:56Z",
"curate_task_id": "<string>",
"import_task_id": "<string>",
"explore_task_id": "<string>",
"restore_task_id": "<string>",
"manifest_suggestion": {
"matches": [
{
"template_id": "<string>",
"rationale": "<string>",
"confidence": 123
}
],
"none": true,
"explored_at": "2023-11-07T05:31:56Z",
"task_id": "<string>"
},
"sample_queries": [
"<string>"
],
"groom_task_id": "<string>",
"groom_artifact_count": 123,
"last_groomed_at": "2023-11-07T05:31:56Z",
"stats": {
"tasks_total": 123,
"tasks_active": 123,
"tasks_completed": 123,
"tasks_failed": 123,
"tasks_cancelled": 123,
"tokens_total": 123,
"runtime_seconds": 123
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Session token from POST /auth/login. Pass as Authorization: Bearer <token>. The alternative X-Pinecone-Api-Key header is also accepted for direct-key auth (used by the Nexus CLI on first contact).
Headers
Date-based contract version. Omit to resolve to the Nexus default version (2026-07, the oldest served version); send unstable for the in-development surface. The resolved version is echoed back on the same header. A present-but-unrecognized value is rejected with 400 unsupported_api_version.
Body
3–64 chars, lowercase alnum + hyphens, starts with a letter
1–128 chars
Seed manifest (validated against the manifest schema)
Show child attributes
Show child attributes
search — built from source documents; must be curated before it can be queried. work — built from traces of work done; queryable immediately and consolidated by groom rather than curate.
Response
The created context
What context endpoints return (derived flags).
search — built from source documents; must be curated before it can be queried. work — built from traces of work done; queryable immediately and consolidated by groom rather than curate.
Present only on a workspace-enabled cluster
High-level guidance for the query runtime
Pinned manifest document; absent when the context is on defaults
Show child attributes
Show child attributes
Outcome of a Design-flow explore run, pinned to the context row.
Show child attributes
Show child attributes
Example questions the curated corpus can answer
Populated only on the list endpoint
Show child attributes
Show child attributes
Was this page helpful?