Knowledge Sources
Give your assistant context about your product, service, or organization. Kody supports four types of knowledge sources.
Knowledge sources are added to the knowledge.sources array in your site configuration. The content is formatted with numbered references ([1], [2], etc.) and injected into the system prompt under a "REFERENCE INFORMATION" section so the AI can cite sources when answering questions.
All knowledge content is processed and stored server-side only — it is never sent to the browser. The AI sees it in its system prompt context.
Text
Inline text content with a title. Best for small, static pieces of information like company descriptions, policies, product summaries, or any content you want to control directly in the config.
| Field | Type | Default | Description |
|---|---|---|---|
| type | literal | — | Must be "text". |
| title | string | required | Title for this knowledge source. Used as the reference label. 1-200 chars. |
| content | string | required | The text content itself. 1-50,000 chars. Markdown is supported. |
{
"type": "text",
"title": "About Our Company",
"content": "Acme Corp is a B2B SaaS company that builds developer tools. Founded in 2020, we serve over 10,000 teams worldwide. Our main products include AcmeCI (continuous integration), AcmeDeploy (deployment automation), and AcmeMonitor (observability platform)."
}FAQ
A list of question/answer pairs. The AI can match user queries against these and provide accurate, pre-approved answers. FAQs are the most token-efficient knowledge format — each Q/A pair is compact and highly specific.
| Field | Type | Default | Description |
|---|---|---|---|
| type | literal | — | Must be "faq". |
| entries | array | required | Array of objects, each with a question (1-500 chars) and answer (1-5,000 chars). At least one entry required. |
{
"type": "faq",
"entries": [
{
"question": "What are your support hours?",
"answer": "Our support team is available Monday to Friday, 9am-5pm EST. For critical issues, we offer 24/7 on-call support for Enterprise customers."
},
{
"question": "Do you offer a free trial?",
"answer": "Yes! All plans come with a 14-day free trial. No credit card required. You can upgrade or cancel at any time."
},
{
"question": "How do I reset my password?",
"answer": "Go to the login page and click 'Forgot password'. Enter your email address and we'll send you a reset link that expires in 1 hour."
}
]
}URL
Content fetched from a URL and cached server-side. The server periodically re-fetches the content based on the configured refresh interval, so your assistant stays up to date without manual intervention. This is ideal for documentation pages, changelogs, or any content that lives at a URL.
| Field | Type | Default | Description |
|---|---|---|---|
| type | literal | — | Must be "url". |
| url | string (URL) | required | URL to fetch content from. Must be a valid, accessible URL. |
| title | string | — | Optional title for this source (up to 200 chars). Defaults to the URL if not set. |
| refreshIntervalHours | integer | 24 | How often to re-fetch the content, in hours. Range: 1-720 (30 days). Lower values keep content fresher but increase network requests. |
{
"type": "url",
"url": "https://example.com/docs/faq.md",
"title": "FAQ Page",
"refreshIntervalHours": 12
}- Use plain text or Markdown URLs when possible — HTML pages include a lot of boilerplate that wastes tokens
- Point to raw content URLs (e.g. GitHub raw URLs) rather than rendered pages
- Set the refresh interval based on how often the content changes — 24 hours is fine for most documentation
File
Local files read from the server's knowledge-files directory. Useful for documents you want to manage alongside your deployment — product guides, internal policies, or pre-compiled knowledge bases.
| Field | Type | Default | Description |
|---|---|---|---|
| type | literal | — | Must be "file". |
| filePath | string | required | Path relative to the knowledge-files directory. Min 1 char. |
| title | string | — | Optional title (up to 200 chars). Defaults to the file path if not set. |
{
"type": "file",
"filePath": "product-guide.md",
"title": "Product Guide"
}knowledge-files directory. Path traversal attempts (e.g. ../../etc/passwd) are rejected by the server. Files are read server-side only and never exposed to the client.Token Budget
The knowledge.maxContextTokens field controls how much knowledge content is included in each request to the AI provider. The default is 4,000 tokens (range: 100-32,000).
When total knowledge content exceeds the token budget, sources are included in the order they appear in the configuration array, and content is truncated once the budget is reached. Sources that do not fit within the budget are excluded entirely from that request.
- Put the most important sources first in the array — they are guaranteed to be included
- Use FAQ entries for common questions — they are the most token-efficient format (compact Q/A pairs)
- Keep text sources concise — remove boilerplate and focus on information the AI needs to answer questions
- Prefer Markdown or plain text URLs over HTML pages — HTML includes lots of boilerplate that wastes tokens
- Increase the budget (up to 32,000) if you have many sources, but be aware this increases AI costs and response latency
Complete Example
A knowledge configuration using all four source types:
{
"knowledge": {
"sources": [
{
"type": "text",
"title": "Company Overview",
"content": "Acme Corp builds developer tools. Founded 2020. 10,000+ teams. Products: AcmeCI, AcmeDeploy, AcmeMonitor."
},
{
"type": "faq",
"entries": [
{
"question": "What plans do you offer?",
"answer": "We offer Starter ($29/mo), Pro ($99/mo), and Enterprise (custom pricing). All plans include a 14-day free trial."
},
{
"question": "How do I contact support?",
"answer": "Email support@acme.com or use the chat widget. Enterprise customers have access to a dedicated Slack channel."
}
]
},
{
"type": "url",
"url": "https://raw.githubusercontent.com/acme/docs/main/changelog.md",
"title": "Changelog",
"refreshIntervalHours": 6
},
{
"type": "file",
"filePath": "api-reference.md",
"title": "API Reference"
}
],
"maxContextTokens": 6000
}
}