Skip to main content

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

Project description

Yoker

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

Current Status

Minimal prototype available! The basic chat loop with tool calling is working:

# Install (requires Python 3.10+)
pip install -e .

# Run interactive chat
python -m yoker

The prototype includes:

  • Interactive chat loop with Ollama
  • Basic read tool for file reading
  • Streaming responses
  • Structured logging

See Quick Start below for details.

Name

"yoker" - One who yokes. A person or device that joins or attaches things together, specifically one who yokes oxen or links things together.

From the agent noun of "yoke", which derives from PIE \yeug- meaning "to join" (same root as yoga, conjugate, junction).

Pairs beautifully with "clitic" (both are joining tools - clitic joins words, yoker joins agents).

See docs/NAME.md for full naming documentation.

Vision

Create a lightweight, configurable agent harness that provides a structured environment for AI agents to operate within defined boundaries. The harness manages tool access, enforces guardrails, handles context persistence, and integrates with Ollama as the LLM backend.

Goals

  1. Safety First: Guardrails prevent agents from performing unintended operations
  2. Configurability: All tools, parameters, and limits configurable via TOML
  3. Simplicity: Specific tools instead of generic shell access
  4. Transparency: Clear logging and reporting of all agent actions
  5. Extensibility: Easy to add new tools while maintaining guardrails
  6. Compatibility: Agent definitions compatible with Claude Code format

Core Components

1. Configuration System

  • TOML configuration file: Harness settings, tool guardrails, Ollama parameters
  • Markdown agent definitions: With YAML frontmatter (compatible with Claude Code)

2. Tool System

MVP tools (no generic Bash):

Tool Purpose Guardrails
List Directory listing Path restrictions, pattern filters
Read File reading Path restrictions, size limits
Write File writing Path restrictions, overwrite protection
Update File editing Path restrictions, diff validation
Search Grep/glob-like Path restrictions, pattern limits
Agent Spawn subagents Recursion depth, tool subset

3. Context Manager

Persists context for consecutive LLM calls:

  • Conversation history (JSONL format - append-friendly)
  • Agent state
  • Working memory
  • Per-session files in configurable location

4. Ollama Integration

  • Assumes Ollama is running externally
  • All configurable parameters exposed
  • Model selection per agent possible

5. Agent Definitions

Markdown files with YAML frontmatter:

---
name: researcher
description: Research assistant
tools: List, Read, Search
---

# Researcher Agent

You are a research assistant...

Architecture

┌─────────────────────────────────────────────────────────┐
│                        Yoker                             │
├─────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐  │
│  │  Config     │  │  Context    │  │  Logging/       │  │
│  │  Loader     │  │  Manager    │  │  Reporting      │  │
│  │  (TOML)     │  │  (JSONL)    │  │                 │  │
│  └──────┬──────┘  └──────┬──────┘  └────────┬────────┘  │
│         │                │                  │           │
│         ▼                ▼                  ▼           │
│  ┌─────────────────────────────────────────────────────┐│
│  │              Tool Execution Layer                   ││
│  │  ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌───────┐  ││
│  │  │List │ │Read │ │Write│ │Update│ │Search│ │Agent  │  ││
│  │  └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └───────┘  ││
│  └─────────────────────────────────────────────────────┘│
│                          │                              │
│                          ▼                              │
│  ┌─────────────────────────────────────────────────────┐│
│  │              Ollama Backend Client                  ││
│  │      (HTTP API, configurable parameters)            ││
│  └─────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────┘

Project Structure

yoker/
├── src/yoker/           # Main package
├── tests/               # Test suite
├── docs/               # Sphinx documentation
├── examples/           # Example configurations
├── analysis/           # Functional analysis
├── pyproject.toml      # Package configuration
└── README.md

Quick Start

Minimal Prototype

The current prototype provides a basic interactive chat with tool calling:

# Install
pip install -e .

# Run
python -m yoker

Example session:

Yoker v0.1.0 - Using model: glm-5:cloud
Type your message and press Enter. Press Ctrl+D to quit.

> What's in the README.md file?

I'll read the README.md file for you.

[13:49:49] INFO yoker.agent - Tool call: read({'path': 'README.md'})
[13:49:49] INFO yoker.agent - Tool result: # Yoker...

The README.md file describes **Yoker**, a Python-based agent harness...

> ^D
Goodbye!

Planned Full Usage

# Create config
cat > yoker.toml << EOF
[ollama]
model = "llama3.2"
base_url = "http://localhost:11434"

[tools.list]
allowed_paths = ["/workspace"]

[tools.read]
allowed_paths = ["/workspace"]
max_size_kb = 100

[tools.agent]
max_recursion_depth = 3

[agents]
directory = "./agents"
EOF

# Create agent definition
mkdir agents
cat > agents/main.md << EOF
---
name: main
description: Default assistant
tools: List, Read, Write, Update, Search, Agent
---

You are a helpful assistant.
EOF

# Run harness (planned)
yoker --config yoker.toml

Documentation

  • Name documentation: docs/NAME.md
  • Functional analysis: analysis/functional.md
  • Interview notes: analysis/interview.md

Integration with Clitic

Yoker provides the agent runtime, Clitic provides the TUI:

  • Build agents using Yoker APIs
  • Optionally add Clitic-based CLI interface
  • Deploy agents with or without UI (daemon mode)

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.1.0.tar.gz (9.2 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.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for yoker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dde749833dac13f2de6aef20fdea9b32595af5286855ffaeb56d025aba31a1b6
MD5 d61f3b58c2508e1e8fc050f651748359
BLAKE2b-256 63c2669c517966653d505e6b3d32f464f75de79d84ee6fad2094ae89aadb2563

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yoker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7a5f5e177938b470917f3cf65d8e1625b3840055ec295664c52e6d96625bc36
MD5 fd2704ccff847c58e072b4fd566cee8b
BLAKE2b-256 62e604ec83b5164de401f5f2e901066d7399b4b395e3f173a3613eb4b35ba9f2

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