Skip to main content

A Python agent harness with configurable tools and guardrails - one who yokes agents together

Reason this release was yanked:

broken wheel, no source files included

Project description

Yoker

PyPI Python uv CI Coverage License Agentic

A Python agent harness with configurable tools, guardrails, and Ollama backend integration.

Installation

pip install yoker

Quick Start

python -m yoker

Or with an agent definition:

python -m yoker --agent examples/agents/researcher.md

Example session:

Yoker Session

Why Yoker?

Yoker fills a unique gap in the coding agent ecosystem: a library-first, transparent agent harness designed for developers who want full control, visibility, and simplicity.

Key Differentiators:

  • Library-first - Embed in your applications, not locked into a CLI
  • LLM-neutral - Choose your provider, your model, your cost model
  • No hidden manipulation - All prompts visible, editable, configurable
  • Static permissions - Deterministic boundaries, not runtime prompts
  • Full transparency - Event-driven, everything inspectable

See docs/rationale.md for the full rationale and comparison with other solutions.

Features

Current Features:

  • Chat loop - Interactive conversation with Ollama
  • Tool calling - Structured tool execution with parameters
  • read tool - Read file contents with guardrails
  • list tool - Directory listing with pattern filtering
  • write tool - Write files with overwrite protection
  • update tool - Edit existing files with replace, insert, and delete operations
  • search tool - Search file contents with regex or filenames with glob
  • existence tool - Check if files or folders exist with security hardening
  • mkdir tool - Create directories with recursive parent creation and depth limits
  • git tool - Git operations (status, log, diff, branch, show) with permission-controlled commit/push
  • web_search tool - Web search with SSRF protection, domain filtering, and rate limiting
  • web_fetch tool - Fetch web content with SSRF protection, URL validation, and size limits
  • agent tool - Spawn subagents with isolated context and recursion limits
  • Slash commands - Built-in commands: /help, /think on|off
  • Thinking mode - LLM reasoning trace with gray output
  • Streaming - Real-time token streaming from Ollama
  • Configuration - TOML-based configuration system
  • Agent definitions - Load agents from Markdown files with YAML frontmatter
  • Multiline input - Esc+Enter for newlines, Enter to submit
  • Rich output - Styled terminal output with Rich
  • Event-driven architecture - Library-first design with event emission
  • Context persistence - Session resumption with JSONL storage
  • Event logging - Full session replay capability
  • Demo scripts - Generate documentation screenshots from Markdown scripts
  • Update tool - Edit existing files with replace, insert, and delete operations

Planned Features:

  • Guardrails - Tool parameter validation
  • Permissions - Static TOML-based access control
  • Multi-agent orchestration - Run coordinated agent teams
  • Backend providers - OpenAI, Anthropic, custom backends
  • Tool timing metrics - Performance tracking
  • Token usage tracking - Cost monitoring
  • Tool result caching - Reduce redundant calls
  • Parallel tool execution - Concurrent read operations

Interactive Input

The interactive session supports:

  • Multiline input: Press Esc+Enter to add newlines, Enter to submit
  • Command history: Up/Down arrows navigate previous messages
  • History search: Ctrl+R to search through history
  • Keyboard navigation: Arrow keys, Ctrl+A/E for cursor positioning
  • Text selection: Click and drag to select output, copy with Ctrl+Shift+C or Cmd+C

Slash Commands

Command Description
/help Show available commands
/think on|off Enable/disable LLM thinking trace

Thinking Mode

When thinking is enabled, the LLM shows its reasoning process:

[Thinking]
Let me analyze this step by step...
First, I need to understand the file structure...

[Response]
Based on my analysis, here's what I found...

Demo Session Script

Generate terminal screenshots for documentation from Markdown script files:

# Run default demo script (demos/session.md)
python scripts/demo_session.py

# Run a specific demo script
python scripts/demo_session.py --script demos/list-tool.md

# Run all demo scripts in a directory
python scripts/demo_session.py --scripts-dir demos/

# Real LLM + log conversation for replay
python scripts/demo_session.py --script demos/session.md --log

# Replay from log (no LLM calls)
python scripts/demo_session.py --script demos/session.md --replay

# With an agent definition
python scripts/demo_session.py --script demos/session.md --agent examples/agents/markdown.md

Configuration

Create a yoker.toml file to configure Yoker:

[harness]
name = "my-yoke"
log_level = "INFO"

[backend]
provider = "ollama"

[backend.ollama]
base_url = "http://localhost:11434"
model = "llama3.2:latest"

[tools.read]
enabled = true
allowed_extensions = [".txt", ".md", ".py"]

See examples/yoker.toml for the full configuration reference.

Architecture

Yoker uses an event-driven architecture for library-first design. The Agent emits events; application code handles UI.

Architecture Diagram

Event Types: Session (start/end), Turn (start/end), Thinking (start/chunk/end), Content (start/chunk/end), Tool (call/result), Error, Command

Documentation

Development

git clone https://github.com/christophevg/yoker.git
cd yoker
make setup    # Create virtual environment and install dependencies

make test     # Run tests with coverage
make check    # Type checking + linting
make docs     # Build documentation

Requires Python 3.10+. Uses uv for dependency management. See CLAUDE.md for project conventions.

Contributing

Contributions welcome! Please read CLAUDE.md for project conventions and development guidelines.

Changelog

See GitHub Releases for version history.

License

MIT License - see LICENSE for details.


Name: "yoker" - One who yokes. The agent noun from "yoke" (PIE yeug- meaning "to join"). Pairs with "clitic" (both are joining tools). See docs/NAME.md for full etymology.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yoker-0.3.0.tar.gz (812.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yoker-0.3.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file yoker-0.3.0.tar.gz.

File metadata

  • Download URL: yoker-0.3.0.tar.gz
  • Upload date:
  • Size: 812.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for yoker-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fc7168ca3285e5fa8f8f64dd8db017ac77a2889c81c2912c63962300ed2670b0
MD5 bf32066a42619856f38b91dc23b2a67a
BLAKE2b-256 ab75e56254f521d47cefb085a44f015fe4da71e3be22afca128924b8280e7940

See more details on using hashes here.

File details

Details for the file yoker-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: yoker-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for yoker-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c28899c23fbf2607df784965e4ee7e44ceebfb10c2145f4b550dbb118484faa9
MD5 5d904e7f487b391f20561b1ef79062ab
BLAKE2b-256 fbd9823cfa9587f393b822ae45a1b986e3105875c521a558b988c0a9c929c66c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page