π₯ Kodo
Kodo (ιΌε, "heartbeat") is an open-source, security-first AI agent framework written in Ruby. It runs locally on your hardware and communicates through the messaging platforms you already use.
Unlike cloud-hosted AI assistants, Kodo keeps your data on your machine, enforces capability-based permissions on every action, and gives you full control over what your agent can and cannot do.
Status: Early development β foundation is working, security layer is next.
Quick Start
Prerequisites
- Ruby 3.2+
- An API key for any supported LLM provider: Anthropic, OpenAI, Gemini, Ollama (free, local), and many more
- A Telegram Bot Token (message @BotFather on Telegram)
Setup
git clone https://github.com/apiguy/kodo.git
cd kodo
bundle install
# Initialize Kodo's home directory
ruby bin/kodo init
# Set your LLM API key (pick any provider)
export ANTHROPIC_API_KEY="sk-ant-..."
# or: export OPENAI_API_KEY="sk-..."
# or: just run Ollama locally β no key needed
# Set up Telegram
export TELEGRAM_BOT_TOKEN="123456:ABC-DEF..."
# Enable Telegram and set your model in the config
# Edit ~/.kodo/config.yml
# Start Kodo
ruby bin/kodo startNow message your bot on Telegram. Kodo is alive.
CLI Chat (no Telegram needed)
export ANTHROPIC_API_KEY="sk-ant-..." # or any provider key
ruby bin/kodo chatCommands
kodo start Start the Kodo daemon
kodo chat Chat with Kodo directly in the terminal
kodo memories List what Kodo remembers about you
kodo status Show daemon status
kodo init Create default config in ~/.kodo/
kodo version Show version
kodo help Show help
How It Works
Kodo runs a heartbeat loop β a periodic cycle that polls your messaging channels for new messages, processes them through an LLM, and sends responses back. This heartbeat is what makes Kodo an agent rather than a chatbot: it runs continuously, can notice things, and will eventually take proactive action on your behalf.
Your Phone (Telegram) ββ Telegram API ββ Kodo Daemon ββ Anthropic Claude
β
Memory Store
(conversations,
audit trail)
Architecture
See ARCHITECTURE.md for the full system design, component details, and roadmap.
Configuration
Kodo stores its config and data in ~/.kodo/:
~/.kodo/
βββ config.yml # LLM provider and channel settings
βββ persona.md # Agent personality and tone (make Kodo yours)
βββ user.md # Tell Kodo about yourself
βββ pulse.md # What to notice during idle beats
βββ origin.md # First-run onboarding conversation
βββ memory/
βββ conversations/ # Chat history (per-conversation JSON)
βββ knowledge/ # Long-term remembered facts (JSONL)
βββ audit/ # Daily audit logs (JSONL)
Prompt Files
Kodo's personality is defined by plain Markdown files, not code. Edit them to make the agent yours:
-
persona.mdβ How Kodo talks. Tone, style, opinions. "Respond like a senior engineer doing code review" is more useful than "be helpful." -
user.mdβ Who you are. Name, role, timezone, current projects. Helps Kodo give contextual answers. -
pulse.mdβ What Kodo should pay attention to during idle heartbeat cycles. "Remind me about standup at 9:45am" or "summarize unread messages if more than 5 accumulate." -
origin.mdβ Runs on first conversation only. Kodo introduces itself and helps you set up.
These files are advisory β they shape behavior but cannot override Kodo's hardcoded security invariants (no data exfiltration, no prompt injection compliance, no impersonation).
Secrets (API keys, bot tokens) are never stored in config files. Instead, config
references environment variable names using the _env suffix convention:
llm:
api_key_env: ANTHROPIC_API_KEY # reads $ANTHROPIC_API_KEY at runtimeSecurity
Kodo is being built security-first:
- Encrypted memory β conversation history and knowledge encrypted at rest (AES-256-GCM)
- Sensitive data redaction β regex + LLM-assisted detection scrubs secrets before writing to disk
- Audit trail β every action logged with what triggered it
- Layered prompt security β hardcoded invariants cannot be overridden by user-editable files
Planned:
- Capability-based permissions β skills declare what they need, you grant scoped access
- Sandboxed skill execution β skills run in isolated processes
- Signed skills β cryptographic verification before loading any skill
License
MIT
Links
- Website: kodo.bot
- Architecture: ARCHITECTURE.md
- Development Guide: CLAUDE.md