Create collections from your data
Create a collection from URLs (web pages) or document uploads. It is stored and indexed for RAG so chatbots can query it.
Classic chatbot with RAG over your data — no supervisor or sub-agents
The Chatbot service is the classic chatbot: no supervisor or sub-agents. You create a collection (knowledge base from URLs, documents, or text); that collection is registered and stored for you. Then you create chatbots linked to that collection and give each one instructions (system prompt). You open conversation sessions with those chatbots. In each session, user questions are matched against the collection using RAG; we retrieve the relevant chunks. When the question fits your rules, an LLM generates the answer and we return it via REST or SSE streaming. One collection, one or more chatbots, many sessions — simple and predictable.
Create a collection from URLs (web pages) or document uploads. It is stored and indexed for RAG so chatbots can query it.
Create chatbots tied to one or more collections. Set system_message (instructions) per chatbot to define behavior, tone, and boundaries.
Each chat call opens or continues a conversation. Pass conversation_id to continue an existing thread; omit it for a new conversation. List, inspect, or delete sessions.
Questions are grounded in the collection via RAG; retrieved sources are returned in enhanced_analysis. The LLM answers and you get the response in one shot (REST) or as a stream (SSE, set stream:true).
Build a collection from help center / FAQ; create a chatbot with support instructions; open conversation sessions per user. Answers are grounded in your docs via RAG, returned as REST or SSE.
Index company docs and SOPs in a collection; chatbots with clear system_message serve employees. Sessions keep context; RAG + LLM answers within your rules.
Collection from product catalogs and reviews; chatbots linked to it. Sessions per user; RAG retrieves relevant items; LLM answers.
Course or onboarding content in a collection; chatbots with instructions and sessions. Questions answered from the collection within your rules.
Input
Collection sources (URLs or documents), chatbot configuration (system_message, temperature, model), conversation_id, and chat messages
Output
LLM-generated response grounded in collection via RAG, with enhanced_analysis (relevance scores, sources); REST or SSE
Prerequisites
Create a collection from your sources. Indexing runs so chatbots can query it for RAG.
{
"name": "support-docs",
"source_type": "web_pages",
"sources": [
{ "page_url": "https://docs.example.com/faq", "title": "FAQ" }
]
}Response
{
"status": "success",
"data": {
"collection_id": "cl_abc123",
"collection_name": "support-docs",
"status": "ready",
"source_types": ["web_pages"],
"data_sources": [
{ "id": "ds-uuid", "name": "FAQ", "source_type": "web_pages" }
]
}
}Use the returned collection_id (cl_ prefix) in subsequent calls. Status begins as 'indexing' and becomes 'ready'.
Create a chatbot linked to one or more collections. Set system_message (instructions) and temperature to control behavior.
{
"name": "Support Bot",
"collection_ids": ["cl_abc123"],
"system_message": "You are a helpful customer support agent. Answer questions using the provided knowledge base. If you don't know the answer, say so honestly.",
"temperature": 0.3
}Response
{
"status": "success",
"data": {
"chatbot_key": "cb_xyz789",
"name": "Support Bot",
"system_message": "You are a helpful customer support agent...",
"temperature": 0.3,
"collection_ids": ["cl_abc123"],
"created_at": "2026-04-27T10:30:00Z"
}
}Use chatbot_key (cb_ prefix) in subsequent calls. Lower temperature (0.1-0.3) gives more factual answers; higher (0.7-1.0) is more creative.
Send a message; the chatbot retrieves context from its collections via RAG and generates a response. NOTE: request uses 'chatbot_id' as field name, not 'chatbot_key' — the value is still the cb_ key returned by create.
{
"chatbot_id": "cb_xyz789",
"message": "What is your refund policy?"
}Response
{
"status": "success",
"data": {
"conversation_key": "cv_def456",
"response": "Our refund policy allows customers to request a full refund within 30 days...",
"enhanced_analysis": {
"source_count": 3,
"content_types": ["web_pages"],
"dominant_content_type": "web_pages",
"scoring_method": "enhanced",
"is_enhanced": true,
"relevance_scores": [
{ "content_id": "https://docs.example.com/refunds", "content_type": "web_pages", "relevance_score": 0.78, "match_count": 4, "title": "Refund Policy", "url": "https://docs.example.com/refunds", "source": "https://docs.example.com/refunds", "summary": "", "sections_count": 4 }
]
}
},
"gateway": { "request_id": "req_abc", "service": "core-chat" },
"cost": { "units": 1.0, "unit_price": 0.001, "tokens": 0.001, "balance": 99.99 }
}Pass the returned conversation_key as conversation_id (or conversation_key) in the next request to continue the same conversation. Field naming inconsistency: chatbot_id (request) vs chatbot_key (response) — use the cb_-prefixed value either way.
Add stream:true to the same core-chat endpoint. Tokens arrive as Server-Sent Events in OpenAI-compatible format.
{
"chatbot_id": "cb_xyz789",
"message": "What is your refund policy?",
"conversation_id": "cv_def456",
"stream": true
}Response
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}],"conversation_key":"cv_def456"}
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Our refund"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" policy allows..."},"finish_reason":null}]}
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":280,"completion_tokens":62,"total_tokens":342}}
data: [DONE]Listen for 'data: [DONE]' to detect end of stream. Aggregate delta.content for the full response.
Create a knowledge collection with automatic embedding. Provide URLs or document references as sources.
/v1/proxy/core-collection-create
List all collections for the current account. Response data is a direct array; pagination is on the top level.
/v1/proxy/core-collections
Get a collection's source list. Lighter than the list endpoint — only returns collection_id, source_types, and data_sources.
/v1/proxy/core-collection-details/{collection_id}
Update collection sources and trigger re-embedding.
/v1/proxy/core-collection-update/{collection_id}
Permanently delete a collection and all its embeddings.
/v1/proxy/core-collection-delete/{collection_id}
Create a chatbot connected to one or more collections. Configure system_message (instructions) and temperature.
/v1/proxy/core-chatbot-create
List all chatbots for the current account. Response data is a direct array; pagination is on the top level.
/v1/proxy/core-chatbots
Get a chatbot's configuration plus statistics and public_domains.
/v1/proxy/core-chatbot-details/{chatbot_key}
Update chatbot configuration: name, system_message, temperature, collection_ids.
/v1/proxy/core-chatbot-update/{chatbot_key}
Delete a chatbot. Conversations are preserved but no longer accessible for new messages.
/v1/proxy/core-chatbot-delete/{chatbot_key}
Send a message to a chatbot. RAG retrieves relevant context from its collections; the LLM generates a response. Set stream:true for SSE.
/v1/proxy/core-chat
List conversations for a single chatbot. The chatbot_id is REQUIRED — pass it as a path parameter or as the ?chatbot_id= query parameter. Calls without it return 400.
/v1/proxy/core-conversations/{chatbot_id}
Get a conversation's metadata plus its full message history.
/v1/proxy/core-conversation-details/{conversation_key}
Delete a conversation and all its messages permanently.
/v1/proxy/core-conversation-delete/{conversation_key}
Pay only for what you use. Listing and management read operations are free.
| Service | Unit | Price |
|---|---|---|
| Create / Update Collection | item | $1.0/operation |
| Create Chatbot | item | $1.0/chatbot |
| Update Chatbot | item | $0.5/update |
| Chat (REST or SSE) | token | $0.001/call (currently flat — see note below) |
| List, Get, Delete operations | item | Free |
A: Multiple. Pass them in the collection_ids array. The AI searches all connected collections when answering.
A: The chatbot continues to use the previous version until re-indexing completes. There is no downtime.
A: No, all LLM calls go through the CN8 Gateway. This simplifies billing and ensures consistent behavior.
A: Upstream naming inconsistency. The value is the same (cb_ prefix); only the field name differs. Documented under Field Naming Quirks.
A: The chat upstream does not currently report token counts back to the gateway. Until that's added, billing falls back to a flat 1 unit × $0.001. The LLM completions endpoint does report per-call cost via usage.cost; chat will follow once the upstream adds it.
A: URLs (web pages are scraped automatically) and document references (uploaded via the data-sources flow). PDF and document upload is supported via source_type='documents'.
1.1 (2026-04-27)
1.0 (2026-01-01)