Skip to main content

Overview

The docbotConfigSchema is the Zod schema that validates user configuration files. Users typically provide a partial configuration (DocbotUserConfig) which is merged with defaults to create a ResolvedConfig.

Import

import { docbotConfigSchema, defineConfig } from "docbot/config"
import type { DocbotConfig, DocbotUserConfig } from "docbot/config"

DocbotConfig

The inferred TypeScript type from the Zod schema. All fields are optional.
type DocbotConfig = z.infer<typeof docbotConfigSchema>

Configuration fields

agents
object
Agent behavior settings
models
object
Model overrides for different AI operations. All model IDs must follow the format provider/model-name.
paths
object
Default paths for CLI inputs
projectSlug
string
Project identifier used for collection naming. Must be lowercase alphanumeric with hyphens.Defaults to sanitized package.json name.
qdrant
object
Qdrant vector database configuration
server
object
Server configuration settings

DocbotUserConfig

Type alias for the input type accepted by the Zod schema. This is what users provide in their docbot.config.ts files.
type DocbotUserConfig = z.input<typeof docbotConfigSchema>

Usage examples

Basic configuration

import { defineConfig } from "docbot/config"

export default defineConfig({
  projectSlug: "my-project",
  models: {
    planning: "openai/gpt-4o",
    prose: "anthropic/claude-sonnet-4.5",
  },
})

With custom Qdrant settings

import { defineConfig } from "docbot/config"

export default defineConfig({
  projectSlug: "my-api",
  qdrant: {
    url: "http://localhost:6333",
    collections: {
      code: "custom_code_collection",
      docs: "custom_docs_collection",
    },
  },
})

With path defaults

import { defineConfig } from "docbot/config"

export default defineConfig({
  paths: {
    codebase: ["./src", "./lib"],
    docs: "./documentation",
  },
  agents: {
    discoveryBudget: 10,
  },
})

Programmatic validation

import { docbotConfigSchema } from "docbot/config"

const userConfig = {
  projectSlug: "test",
  models: {
    planning: "openai/gpt-4o",
  },
}

// Validate config
const result = docbotConfigSchema.safeParse(userConfig)

if (result.success) {
  console.log("Valid config:", result.data)
} else {
  console.error("Invalid config:", result.error)
}

Model ID format

All model identifiers must follow the format provider/model-name:
  • Provider: alphanumeric with hyphens (e.g., openai, anthropic, google)
  • Model name: alphanumeric with hyphens and dots (e.g., gpt-5.2, claude-sonnet-4.5)
// Valid model IDs
"openai/gpt-5.2"
"anthropic/claude-sonnet-4.5"
"google/gemini-3-flash"

// Invalid model IDs
"gpt-5.2"  // Missing provider
"openai:gpt-5.2"  // Wrong separator

Helper functions

defineConfig

Provides TypeScript type hints for configuration objects:
function defineConfig(config: DocbotUserConfig): DocbotUserConfig

gateway

Re-exported from the ai package for model configuration:
import { defineConfig, gateway } from "docbot/config"

export default defineConfig({
  models: {
    planning: gateway("openai/gpt-4o"),
  },
})

Build docs developers (and LLMs) love