Yules AgentDocumentation

Yules Agent Documentation

An open-source agent that grows with you. Install it, give it your messaging accounts, and it becomes a persistent personal agent — remembering what it learns and getting more capable the longer it runs.

Installation

Yules installs on Linux, macOS, WSL2, native Windows, and Android (Termux). The installer handles dependencies, creates the virtual environment, and sets up the gateway.

curl -fsSL https://yules.ai/install.sh | bash

What the installer does

  • Downloads the latest Yules Agent release from GitHub
  • Creates a Python virtual environment in ~/.yules/venv
  • Installs core dependencies + platform-specific packages
  • Sets up the default config at ~/.yules/config.yaml
  • Adds the yules CLI to your shell PATH

Post-install

yules setup

Run yules setup to configure your LLM provider, set up messaging platforms, and run the first-time wizard. This creates your ~/.yules directory structure and validates the installation.

Per-user vs. system-wide

By default, Yules installs per-user (into ~/.yules). This avoids permission issues and makes uninstallation trivial: rm -rf ~/.yules. For system-wide installs, pass --system to the install script (requires root).

Quickstart Tutorial

This tutorial gets you from zero to a working agent in five minutes. You will start a conversation, run your first tool, and see how Yules remembers context across messages.

1. Start the agent

yules start

This launches the Yules gateway in the background. Check status with yules status.

2. Open the CLI interface

yules chat

You are now in an interactive session. Try your first message:

> Research the latest approaches to GRPO training and write a summary

Yules will use web_search to find sources, browser.open to read papers, and execute_code to synthesize a summary.

3. Watch memory form

After the research task completes, ask: "What did we just research?" Yules recalls the topic, key findings, and sources — even though you never explicitly saved anything. This is the cross-session memory layer at work.

4. Try natural language scheduling

> Every Monday at 9 AM, send me a research digest to Slack

Yules parses the schedule, creates a cron entry, and confirms the delivery channel.

5. Check the Portal

Open http://localhost:8080 in your browser to see the Yules Portal dashboard. You can view active conversations, memory entries, scheduled tasks, and system health from here.

Run yules --help to see all available commands. The CLI is your primary interface for configuration, debugging, and administration.

Learning Path

Not sure where to start? Pick the path that matches your experience level.

Beginner

New to AI agents? Start with installation, the Quickstart tutorial, and basic messaging setup. Focus on CLI chat and understanding how Yules remembers conversations.

Intermediate

Comfortable with the basics? Dive into configuration, tools, memory tuning, and skills. Set up multiple messaging platforms and explore the tool ecosystem.

Advanced

Building on Yules as a platform? Explore MCP integration, custom skills, swarm orchestration, security hardening, and the internal architecture.

Configuration

Yules is configured through a single YAML file at ~/.yules/config.yaml. Changes take effect on the next gateway restart (yules restart).

Config file structure

# ~/.yules/config.yaml

# LLM Provider configuration
provider:
  name: "openrouter"          # openrouter | openai | anthropic | local
  api_key: "${OPENROUTER_API_KEY}"
  model: "anthropic/claude-sonnet-4"
  max_tokens: 4096
  temperature: 0.7

# Gateway settings
gateway:
  host: "0.0.0.0"
  port: 8080
  auth:
    type: "token"
    secret: "${YULES_AUTH_TOKEN}"

# Memory configuration
memory:
  backend: "sqlite"           # sqlite | postgres | chroma
  path: "~/.yules/memory.db"
  compaction_interval: "24h"
  max_entries: 100000

# Messaging platforms
messaging:
  telegram:
    enabled: true
    bot_token: "${TELEGRAM_BOT_TOKEN}"
  discord:
    enabled: true
    bot_token: "${DISCORD_BOT_TOKEN}"
  slack:
    enabled: false
    app_token: "${SLACK_APP_TOKEN}"

# Tool settings
tools:
  enabled:
    - web_search
    - browser
    - execute_code
    - vision
    - image_generation
  execute_code:
    sandbox: "docker"         # none | docker | ssh | singularity | modal
    timeout: 30

# Skills hub
skills:
  auto_create: true
  hub_url: ""
  local_path: "~/.yules/skills"

# Scheduled tasks
scheduler:
  timezone: "UTC"
  max_concurrent: 5

Environment variables

Sensitive values should use the ${VAR_NAME} syntax. Yules loads .env from ~/.yules/.env automatically. Alternatively, export variables in your shell before starting the gateway.

Multiple provider fallback

You can configure multiple providers with priority ordering. If the primary fails (rate limit, outage), Yules automatically falls back to the secondary:

provider: primary: name: "openrouter" model: "anthropic/claude-sonnet-4" fallback: name: "openai" model: "gpt-4.1"

Config validation

yules config validate

Validates your config without starting the gateway. Catches syntax errors, missing required fields, and invalid provider credentials.

Messaging Gateway

Yules connects to multiple messaging platforms through a unified gateway. Each platform is a transport — the agent itself is platform-agnostic. Start a conversation on Telegram, continue it on Discord, and finish in the CLI.

Supported platforms

PlatformSetup complexityVoice supportNotes
TelegramLowYesBotFather token required
DiscordLowYes (VC)Bot token + intents
SlackMediumNoSocket Mode app
WhatsAppMediumNoWeb.js or Business API
SignalMediumNoSignal CLI bridge
MatrixLowNoAny homeserver
Email (IMAP/SMTP)LowNoApp password recommended
SMSHighNoTwilio or gateway device
Microsoft TeamsMediumNoAzure app registration
Google ChatMediumNoService account key
MattermostLowNoPersonal access token
CLI (local terminal)NoneYesWorks out of the box

Setting up Telegram

  1. Message @BotFather on Telegram and create a new bot.
  2. Copy the bot token (looks like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11).
  3. Add it to your config.yaml under messaging.telegram.bot_token.
  4. Run yules messaging test telegram to verify connectivity.
  5. Send /start to your bot. Yules responds immediately.

Context preservation across platforms

Every conversation is tagged with a thread_id derived from the user's identity, not the platform. This means you can start debugging in the CLI, ask a follow-up in Telegram, and receive the final report via Email — all as one continuous thread.

Use /threads in any platform to list your active conversation threads. Use /switch <thread_id> to resume a specific thread.

Tools & Toolsets

Yules ships with built-in tools covering web search, browser automation, code execution, vision, image generation, text-to-speech, file operations, and more. Tools are organized into toolsets that can be enabled or disabled per-conversation or globally.

Core tool categories

Web & Search

web_search, browser.open, browser.extract, browser.screenshot

Code Execution

execute_code, execute_python, execute_shell

Vision & Media

vision.analyze, image.generate, image.edit, tts.speak

File Operations

file.read, file.write, file.list, file.search

System

system.info, system.restart, system.update

Communication

send_message, schedule_task, create_reminder

Enabling and disabling tools

In config.yaml, list the tools you want available globally:

tools: enabled: - web_search - browser - execute_code - vision disabled: - execute_shell # Require explicit approval

Per-conversation tool override

You can restrict tools for a single conversation. This is useful when delegating to a subagent or working with sensitive data:

# In conversation @yules /tools disable execute_shell @yules /tools enable browser, web_search

Creating custom tools

Custom tools are Python functions placed in ~/.yules/tools/. Yules auto-discovers them on startup. A minimal custom tool looks like this:

# ~/.yules/tools/weather.py from yules.tool import tool, ToolContext @tool(description="Get current weather for a city") def get_weather(city: str, ctx: ToolContext) -> str: """Fetch weather data for the given city.""" import requests api_key = ctx.config.get("weather_api_key") url = f"https://api.weatherapi.com/v1/current.json?key={api_key}&q={city}" resp = requests.get(url, timeout=10) data = resp.json() return f"{data['current']['temp_c']}°C, {data['current']['condition']['text']}"

The @tool decorator registers the function with Yules. The docstring becomes the tool description sent to the LLM. The ToolContext gives you access to config, memory, and the current conversation.

Programmatic Tool Calling

For complex multi-step pipelines, use execute_code with theyules.tools API to call tools directly from Python. This collapses multi-turn tool loops into a single inference call, saving tokens and latency.

Memory System

Yules uses persistent memory that stores cross-session facts, skills, and conversation history. Memory is searchable and grows as you use the agent.

How memory is stored

By default, long-term memory uses SQLite with FTS5 for full-text search. For larger deployments, switch to PostgreSQL or ChromaDB:

# SQLite (default, good for <100k entries) memory: backend: "sqlite" path: "~/.yules/memory.db" # PostgreSQL (recommended for production) memory: backend: "postgres" dsn: "postgresql://user:pass@localhost/yules" # ChromaDB (for vector + semantic search) memory: backend: "chroma" path: "~/.yules/chroma"

Manual memory operations

> yules memory search "GRPO training"
> yules memory compact --force
> yules memory export --format json
> yules memory stats
Run memory compact manually before long research sessions to keep the memory index fresh.

Skills System

Skills are reusable workflows that Yules creates automatically. When the agent notices it solving the same type of problem repeatedly, it proposes creating a skill. Once accepted, that skill becomes available as a callable tool in future conversations.

Skill format

Skills are stored as YAML + Python files in ~/.yules/skills/. They are portable and can be shared between compatible agents.

# ~/.yules/skills/research_paper_summary.yaml name: "research_paper_summary" description: "Read an arXiv paper and produce a structured summary" version: "1.2.0" author: "yules-auto" tags: ["research", "reading", "academic"] parameters: paper_url: type: string description: "Direct URL to the PDF or arXiv abstract page" required: true depth: type: string enum: ["brief", "detailed", "exhaustive"] default: "detailed" steps: - tool: browser.open args: { url: "{{paper_url}}" } - tool: browser.extract args: { selector: "article, .abstract, .ltx_page_content" } - tool: execute_code args: code: | from yules.skills import summarize result = summarize(text=extracted, depth="{{depth}}") print(result) output: type: string description: "Structured markdown summary with key findings, methodology, and limitations"

Sharing skills

Skills can be shared with other users or installed from a remote source:

yules skills install ./my-skill.yaml

Managing skills

> yules skills list
> yules skills info research_paper_summary
> yules skills disable outdated_skill
> yules skills export --all ./backup-skills/

MCP Integration

Model Context Protocol (MCP) is an open standard for extending agent capabilities through external servers. Yules supports MCP out of the box — connect to any MCP server (filesystem, database, GitHub, Slack, browser, etc.) and its tools become available to the agent immediately.

What is MCP?

MCP servers expose a standardized JSON-RPC interface. They run as separate processes and communicate with Yules over stdio or HTTP/SSE. This isolation means a crashing MCP server never takes down the agent, and you can audit every tool call independently.

Adding an MCP server

Edit ~/.yules/config.yaml to register MCP servers:

mcp: servers: - name: "filesystem" command: "npx" args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/docs"] - name: "github" command: "npx" args: ["-y", "@modelcontextprotocol/server-github"] env: GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN}" - name: "postgres" command: "uvx" args: ["mcp-server-postgres", "postgresql://localhost/mydb"] - name: "slack" command: "npx" args: ["-y", "@modelcontextprotocol/server-slack"] env: SLACK_BOT_TOKEN: "${SLACK_BOT_TOKEN}" SLACK_TEAM_ID: "${SLACK_TEAM_ID}"

Tool filtering

Not every tool from every MCP server should be available to the LLM. Yules lets you filter by name pattern, argument type, or risk level:

mcp: servers: - name: "filesystem" command: "npx" args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/docs"] filter: allow: ["read_file", "list_directory", "search_files"] deny: ["write_file", "delete_file", "move_file"]

In this example, the filesystem MCP server can only read and list. Write operations are explicitly blocked, even if the server advertises them.

Audit and logging

Every MCP tool call is logged with full arguments, timing, and result summary. Access logs via the Portal or CLI:

yules logs mcp --since 1h --server filesystem
MCP servers run with the same permissions as the Yules process. For untrusted servers, run Yules inside a container or use the --mcp-sandbox flag to isolate MCP processes in their own namespaces.

Use MCP with Yules

Practical patterns for integrating MCP servers into your Yules workflows.

Pattern 1: Read-only knowledge base

Connect a filesystem MCP server to a directory of documentation, RFCs, and meeting notes. Yules can then answer questions like "What did we decide about the auth flow in March?"by searching the knowledge base directly — no manual uploads needed.

Pattern 2: Database querying

Connect the PostgreSQL MCP server and ask natural language questions about your data:

> Show me the top 5 customers by revenue last quarter

Yules generates the SQL via the MCP server, executes it, and presents the results. With filtering configured, destructive queries (DROP, DELETE) are blocked automatically.

Pattern 3: GitHub issue triage

Connect the GitHub MCP server to automate issue management. Yules can:

  • List open issues with specific labels
  • Draft responses based on issue content and project context
  • Create PRs from branch comparisons
  • Search code for references to a failing API

Pattern 4: Multi-MCP orchestration

Yules can use multiple MCP servers in a single workflow. For example, reading a GitHub issue, querying the database for affected users, and posting an update to Slack — all coordinated through natural language:

> Check issue #442 on GitHub, find users affected by that bug in the DB, and notify #incidents on Slack

Debugging MCP connections

> yules mcp list
> yules mcp test github
> yules mcp inspect filesystem --verbose
> yules mcp restart postgres

Voice Mode

Yules supports voice interaction in CLI and messaging platforms. Speech recognition uses Whisper; text-to-speech supports multiple backends.

Setup

CLI Voice Mode

Hold Space to talk, release to send. Yules transcribes, processes, and speaks the response. Requires a microphone and speakers.

yules chat --voice

Telegram Voice Messages

Send a voice message to your Yules Telegram bot. It transcribes, processes, and replies with text.

Configure voice settings in config.yaml under the voice section.

Personality & SOUL.md

SOUL.md is Yules' personality definition file. It sits at ~/.yules/SOUL.md and shapes how the agent communicates, what tone it uses, and what values it prioritizes in ambiguous situations. It is loaded into the system prompt on every inference.

What goes in SOUL.md

A SOUL.md file is markdown with structured sections. The LLM reads it as part of its system instructions, so clarity and specificity matter:

# SOUL.md — Yules Personality Configuration ## Identity You are Yules, an autonomous AI agent built for deep technical work. You are concise, precise, and action-oriented. You avoid fluff. ## Communication Style - Prefer short, information-dense responses - Use technical terminology correctly; don't dumb things down - When uncertain, say "I'm not sure" rather than hallucinating - Format code with proper syntax highlighting ## Values & Priorities 1. User autonomy — never make irreversible changes without confirmation 2. Security — flag risky operations before executing them 3. Efficiency — minimize token usage and latency 4. Transparency — explain your reasoning when asked ## Tone Guidelines - Professional but not stiff - Friendly but not chatty - Confident but not arrogant ## Domain Expertise - Software engineering (Python, TypeScript, Rust, Go) - Machine learning and AI systems - DevOps, cloud infrastructure, and security - Academic research and literature review ## Response Patterns - Greet returning users by referencing the last topic if relevant - Propose next steps rather than waiting for prompts - When generating long outputs, provide a summary first

Per-project personality overrides

You can place a SOUL.md in any project directory. When Yules detects one, it merges the project SOUL.md with the global one — project settings override globals for conflicts. This lets you define domain-specific personas:

  • A data science project might prioritize statistical rigor and visualization
  • A frontend project might prioritize UX accessibility and component reusability
  • A security audit project might prioritize paranoid validation and explicit consent

Dynamic personality adaptation

Over time, Yules observes your reactions (corrections, approvals, follow-up depth) and suggests SOUL.md adjustments. These are presented as diffs — you approve or reject them.

yules soul edit

Opens SOUL.md in your $EDITOR. Changes take effect on the next message — no restart required.

Context Files

Context files inject structured project information into every conversation. They help Yules understand codebase conventions, architectural decisions, and active priorities without you repeating them.

.yules.md files

Place a .yules.md file at the root of any project directory. Yules automatically loads it when the conversation references files in that tree.

# .yules.md — Project Context for yules-agent ## Tech Stack - Next.js 16 (App Router) - TypeScript, Tailwind CSS - PostgreSQL + Prisma ORM - Deployed on Vercel (edge functions) ## Architecture - API routes in app/api/ - Shared components in app/components/ - Database schema in prisma/schema.prisma - NEVER modify files outside the working directory ## Code Style - Use functional components with hooks - Prefer Server Components where possible - Tailwind arbitrary values: use theme tokens, not magic numbers - Error handling: use Result<T,E> pattern from neverthrow ## Active Priorities - Migrate from legacy pages router (Q2) - Add real-time collaboration via WebSockets (Q3) - Performance: target <100ms TTFB globally ## Testing - Vitest for unit tests - Playwright for E2E - Coverage threshold: 80%

Context hierarchy

When multiple context files apply, Yules merges them with a well-defined precedence:

  1. Global SOUL.md — Base personality and values
  2. Project .yules.md — Tech stack, architecture, conventions
  3. Directory .yules.md — Subdirectory-specific rules (e.g., app/api/.yules.md)
  4. Conversation memory — Facts learned during this thread
  5. Ephemeral context — Current file contents, selection, etc.

Lower numbers have higher precedence. A project file overrides the global SOUL.md; a directory file overrides the project file.

Dynamic context injection

Yules can also read context from other sources automatically:

  • package.json, pyproject.toml — dependency info
  • README.md — project overview
  • CONTRIBUTING.md — contribution guidelines
  • Git history — recent commits, active branch, merge conflicts
Keep .yules.md under 500 tokens. Yules truncates oversized context files automatically, but concise context is more effective than exhaustive context.

Security

Yules is designed with security as a first-class concern. By default, it operates in a conservative mode that requires explicit approval for destructive operations. Every layer of the stack — from tool execution to container isolation to API authentication — is hardened against misuse.

Container isolation

The execute_code and execute_shell tools support multiple sandbox backends:

tools: execute_code: sandbox: "docker" # none | docker | ssh | singularity | modal timeout: 30

Choose the backend that matches your environment. Local runs without isolation. Docker provides container sandboxing. SSH, Singularity, and Modal let you run code on remote or serverless infrastructure.

Subagent isolation

When Yules spawns subagents for parallel work, each runs in its own isolated context with separate tool permissions and conversation history.

Never run Yules with sudo or as root in production. The installer supports unprivileged per-user installation to minimize attack surface.

Tips & Best Practices

Quick wins to get the most out of Yules, gathered from the core team and power users.

1. Start with a strong SOUL.md

Spending 10 minutes writing a clear SOUL.md saves hours of correcting tone and behavior later. Be specific about your communication preferences, domain expertise, and boundary conditions.

2. Use natural language for scheduling

Yules' scheduler understands natural time expressions. Instead of memorizing cron syntax, say:

> Every weekday at 9am send a standup reminder to Slack
> On the first Monday of each month, generate a usage report
> In 2 hours, remind me to review the PR

Yules converts these to cron internally and confirms the exact schedule before activating.

3. Compact memory before long sessions

If you're starting a deep research or coding marathon, run yules memory compact first. This ensures the semantic search index is fresh and maximizes recall quality for the session.

4. Delegate with subagents

For multi-step tasks with independent workstreams, spawn subagents instead of doing everything in one conversation:

> Spawn 3 subagents: one to research competitors, one to draft the landing page copy, and one to generate hero images

Each subagent runs in parallel with isolated context. The parent agent consolidates results.

5. Version your config

Track ~/.yules/config.yaml and ~/.yules/SOUL.md in a private dotfiles repo. This makes setting up a new machine trivial and lets you roll back configuration changes.

6. Use the Portal for debugging

When a conversation behaves unexpectedly, open the Portal and inspect the raw tool calls, memory retrievals, and inference logs. Often the issue is a misconfigured tool filter or an oversized context window — both visible in the Portal's trace view.

7. Enable skill auto-creation selectively

Skill auto-creation is powerful but can generate noise. Start with it enabled, review proposed skills for a week, then disable auto-creation and manually create skills for patterns you actually repeat.

8. Set tool timeouts aggressively

Long-running tools (browser automation, code execution) can stall a conversation. Set short timeouts in config and let Yules retry with adjusted parameters:

tools: browser: timeout: 15 # seconds per page load execute_code: timeout: 30 # seconds per execution

Architecture

Yules is built as a modular, event-driven system. Understanding the architecture helps you debug issues, extend functionality, and optimize performance for your workload.

High-level overview

The system has four major layers:

Transport Layer

Handles incoming and outgoing messages across all platforms. Normalizes platform-specific formats into a unified message schema.

Inference Layer

Builds the prompt from system instructions (SOUL.md), context files, memory, and conversation history. Calls the configured LLM provider.

Tool Layer

Discovers and executes tools. Built-in tools are native Python functions. MCP tools run in isolated subprocesses. Custom tools are auto-imported from ~/.yules/tools/.

Memory Layer

Manages persistent state: conversation history, skills registry, and user preferences. Supports SQLite and PostgreSQL backends.

Terminal backends

The execute_code and execute_shell tools support five execution environments:

BackendIsolationUse case
localNoneTrusted dev machine
dockerContainerGeneral sandboxing
sshRemote hostRemote servers, GPU nodes
singularityContainerHPC clusters
modalContainerServerless, scale-to-zero

Scheduler

The built-in scheduler supports cron expressions and natural language scheduling. It runs inside the gateway process and can deliver to any configured messaging platform.

FAQ & Troubleshooting

Common questions and solutions. If your issue isn't here, check the GitHub Issues or run yules doctor for automated diagnostics.

Installation fails with "Permission denied"

The installer needs write access to ~/.yules and your shell config file. If you see permission errors, ensure your home directory is writable:

chmod 755 ~ && curl -fsSL https://yules.ai/install.sh | bash

If running on a shared server, use the per-user install (default) rather than system-wide.

Yules starts but doesn't respond to Telegram messages

Common causes: invalid bot token, webhook conflicts, or missing /start.

  1. Run yules messaging test telegram
  2. Verify your bot token with @BotFather -> /mybots
  3. Ensure no other process is using the same webhook URL
  4. Send /start to the bot (required for first contact)

Tool calls are slow or timing out

Check the tool timeout settings and backend health:

  1. Run yules tools bench <tool_name> to measure latency
  2. Increase timeouts in config if tools genuinely need more time
  3. Switch Docker backend to local if container overhead is the bottleneck
  4. For web tools, check if you're being rate-limited by the target site

Memory seems to forget things

Memory retrieval is similarity-based. If a fact isn't recalled, it might be:

  • Too recent — not yet compacted into semantic memory
  • Too generic — overlapped by more specific entries
  • Not extracted — the agent didn't recognize it as a fact worth storing

Try yules memory search "your query" to see if the fact exists. If it does but isn't recalled, adjust memory.recall_threshold lower.

MCP server fails to start

MCP servers are external processes. Common issues:

  1. Missing runtime: ensure node, npx, or uvx is installed
  2. Network issues: some MCP servers need to fetch packages on first run
  3. Environment variables: check that ${VAR} references resolve correctly
  4. Run yules mcp inspect <name> --verbose for full stderr

High token usage / expensive API bills

Reduce token consumption with these strategies:

  • Enable memory.compaction_interval: "6h" to keep context smaller
  • Use a smaller model for simple queries via provider fallback
  • Limit tool descriptions with tools.max_description_length
  • Disable unused MCP servers — their tool schemas are sent on every call
  • Use execute_code for multi-step pipelines instead of multi-turn loops

How do I completely uninstall Yules?

For per-user installs:

rm -rf ~/.yules && rm -f ~/.config/systemd/user/yules.service

For system-wide installs, also run: sudo rm -f /usr/local/bin/yules

Can I run multiple Yules instances?

Yes. Set a different YULES_HOME and port for each instance:

YULES_HOME=~/.yules-prod YULES_PORT=8080 yules start
YULES_HOME=~/.yules-dev YULES_PORT=8081 yules start

For LLMs and Coding Agents

This documentation is structured for machine readability. All code examples use standard syntax and configuration formats.

Ready to dive in?

Get Yules running in under a minute.

Get Started