Skip to content

Configuration

Krill configuration is layered: krill.toml for durable project defaults, .env for secrets, and environment variables for ad hoc overrides.

FilePurpose
krill.tomlProvider, profiles, tool toggles, MCP servers
.envSecrets and machine-local values
context/Agent file sandbox — bootstrap docs and skills (committed to git)
~/.krill/Runtime state — sessions, memory, cron, dead letters (machine-local)

krill.toml

Which channels start is controlled entirely by krill.toml — no code change needed. Set enabled = true on any channel and it is picked up automatically when you run bin/krill.jl.

toml
# LLM provider
[provider]
name    = "openai"              # "openai" or "gemini"
model   = "gpt-5.4"
api_key = "$OPENAI_API_KEY"     # or set in .env

# Channels — enable as many as you need
[telegram]
enabled    = true
bot_token  = "$TELEGRAM_BOT_TOKEN"
allow_from = ["*"]              # Telegram user IDs, or "*" for everyone

[discord]
enabled    = false
bot_token  = "$DISCORD_BOT_TOKEN"
allow_from = ["*"]

# Runtime paths
[llm]
workspace                     = "context"
data_dir                      = "$KRILL_DATA_DIR"   # defaults to ~/.krill
builtin_restrict_to_workspace = false

# Agent identity and tool toggles
[profile]
system_prompt = """You are Krill — a personal AI assistant. \
Your personality is in SOUL.md, tool rules in AGENTS.md, \
per-tool docs in TOOLS.md. Follow those documents."""

[profile.tools]
provider_builtins    = true     # provider web search + code interpreter
local_builtins       = true
builtin_skills       = true
memory               = true
memory_consolidation = true
cron                 = true
subagents            = true
exec                 = false
claude_code          = false
claude_code_model    = "sonnet"
codex                = false
codex_model          = ""
google_workspace     = false
clawhub              = false    # ClawHub skill registry
history_summarization = false

# MCP servers (add as many blocks as needed)
[[profile.mcp]]
name      = "filesystem"
transport = "stdio"
command   = "npx"
args      = ["-y", "@modelcontextprotocol/server-filesystem", "context"]

[[profile.mcp]]
name      = "huggingface"
transport = "streamable_http"
url       = "https://huggingface.co/mcp"
[profile.mcp.headers]
Authorization = "Bearer $HF_TOKEN"

Token values beginning with $ are expanded from the environment at startup, so secrets stay in .env and krill.toml can be safely version-controlled (without the tokens).

Environment Variables

The recommended approach is to keep tokens in .env and reference them from krill.toml as "$VAR_NAME". Environment variables are expanded at startup.

VariableMeaning
TELEGRAM_BOT_TOKENTelegram bot token
DISCORD_BOT_TOKENDiscord bot token
OPENAI_API_KEYOpenAI provider key
GEMINI_API_KEYGemini provider key
HF_TOKENHugging Face API token (for HF MCP server)

Tools

Krill exposes two tool classes simultaneously.

Provider-native tools

Run on the provider's infrastructure. Pass them through via provider_builtins = true.

ProviderTools
OpenAIweb_search, code_interpreter
GeminigoogleSearch, urlContext, codeExecution

OpenAI web_search and Gemini googleSearch return clean, cited results. Set provider_builtins = true for most bots. If native search returns poor results, the agent can delegate deeper research to claude_code or codex.

Krill local tools

Implemented by Krill and registered in a local ToolRegistry.

ToolDescription
read_file, write_file, edit_file, list_dirFile operations within the context directory
web_fetchFetch a specific URL as markdown
githubWraps the gh CLI
google_workspace (optional)Wraps the gws CLI for Gmail, Calendar, Drive
exec (optional)Shell commands — disabled by default
claude_code (optional)Delegate to Claude Code CLI
codex (optional)Delegate to OpenAI Codex CLI
cron_add/list/removeSchedule management when cron is enabled
spawn/spawn_list/spawn_cancelSubagent management when subagents are enabled
clawhub_search/install/remove/list (optional)ClawHub skill registry — search, install with validation, manage

claude_code and codex run their own internal search and file pipelines. Enable them when the task involves multi-step research or code changes across multiple files.

Recommended tool combinations

Use caseSetup
General assistant with web searchprovider_builtins = true, local_builtins = true
File-focused agent, no web searchprovider_builtins = false, local_builtins = true
Research or coding tasksclaude_code or codex + provider tools
Minimal / echo botBoth off; pass tools explicitly via llm_tools

MCP Servers

Connect external tool servers via stdio or HTTP. MCP tools are namespaced as mcp_<name>_<tool>.

MCP is the right choice for tools not in Krill's built-ins: database queries, calendar APIs, custom business systems. For plain file access, the built-in file tools are simpler.

Transports

TransportWhen to use
stdioLocal process (npx, uvx, etc.) — most common
streamable_httpRemote HTTP MCP server — prefer over sse for new servers
sseLegacy HTTP+SSE — use only if the server doesn't support streamable HTTP
autoInfer from config: stdio if command set, HTTP if url set

Fields

FieldMeaning
nameServer name — used in tool IDs (mcp_<name>_<tool>)
command / argsStdio server command
urlHTTP server URL
headersExtra HTTP headers (e.g. Authorization)
enabled_toolsTool allowlist — ["*"] for all, [] for none
request_timeout_sTimeout for initialization
tool_timeout_sPer-call execution timeout
cache_toolsCache tool schemas on startup

Note: Krill has no official Julia MCP SDK — the client is built from scratch. It handles common cases well but may have edge-case issues with non-standard servers. See Known Limitations.

ClawHub Skill Registry

Enable with clawhub = true under [profile.tools]. This registers four tools (clawhub_search, clawhub_install, clawhub_remove, clawhub_list) that let the agent discover and install community skills from ClawHub through a security validation pipeline.

toml
[profile.tools]
clawhub = true

[clawhub]
api_url         = "https://clawhub.ai/api/v1"
auth_token      = "$CLAWHUB_TOKEN"       # optional, only needed for private skills
min_downloads   = 10                      # minimum download count to pass validation
min_stars       = 0
blocked_slugs   = []
blocked_authors = []
FieldDefaultMeaning
api_urlhttps://clawhub.ai/api/v1ClawHub API base URL
auth_token(none)Bearer token for authenticated requests
min_downloads0Reject skills with fewer downloads than this
min_stars0Reject skills with fewer stars than this
blocked_slugs[]Skill slugs to always reject
blocked_authors[]Authors to always reject

Installed skills are stored in ~/.krill/skill_store/ with separate quarantine/ and verified/ directories. A manifest.json tracks all entries with status, version, SHA-256 hash, and timestamps.

See Security for details on the validation gate and what it catches.

Filesystem Layout

context/ — agent sandbox (committed to git)

Bootstrap docs and skills live here. The agent can read and write inside this directory; it cannot escape it.

FileCommit?Purpose
SOUL.mdYesPersona and tone
AGENTS.mdNo — gitignore, copy from .exampleEnvironment, paths, tool preferences
USER.mdNo — gitignore, copy from .exampleYour name, timezone, technical level
TOOLS.mdYesNon-obvious tool constraints
skills/YesLocal skill definitions

Tips for writing bootstrap docs

  • Keep them short. Every character costs context budget on every turn. 20 tight lines beats 200 sprawling ones.

  • SOUL.md — personality and communication style only. Don't list capabilities here.

  • AGENTS.md — tool selection rules and agent constraints. Machine-specific paths go here.

  • USER.md — who you are: name, timezone, technical level, preferences.

  • TOOLS.md — timeouts, auth requirements, non-obvious quirks. Generic enough to commit.

  • Don't duplicate system_prompt. The base prompt in krill.toml and bootstrap docs are both injected — avoid repeating the same content.

~/.krill/ — runtime state (machine-local, never committed)

PathPurpose
sessions/<session>/history.jsonlTurn-by-turn session history
memory/<session>/MEMORY.mdConsolidated durable memory
memory/<session>/HISTORY.mdArchived consolidation dumps
memory/<session>/state.jsonMemory bookkeeping
cron/jobs.jsonPersisted cron jobs
skill_store/manifest.jsonClawHub skill registry manifest
skill_store/quarantine/<slug>/Skills awaiting validation
skill_store/verified/<slug>/Validated and promoted skills
dead_letters.jsonlFailed outbound delivery records