Skip to main content

passive-agent

A passive agent for prompt engineering experiments with instruction-based context building.

Overview

Passive Agent is a flexible tool for building complex contexts by processing instructions that combine file content with AI completions. It's designed for prompt engineering experiments where you need to iteratively build context from multiple sources.

Features

  • 📄 Load content from files and directories
  • 🤖 Integrate AI completions into context (supports OpenAI and OpenRouter)
  • 🔄 Sequential processing with context accumulation
  • 📊 Token usage tracking and reporting
  • 🎯 Simple instruction-based workflow
  • 🎭 Custom system prompts via SYSTEM.md
  • 🔀 Dynamic model switching with /model instruction

Installation

pip install passive-agent

Or install from source:

git clone https://github.com/yourusername/passive-agent
cd passive-agent
pip install -e .

Quick Start

  1. Create an INSTRUCT.md file with your instructions:

    @header.md
    @data/
    /completion
    @footer.md
    
  2. Run passive-agent:

    passive-agent
    
  3. Check the generated files:

    • CONTEXT.md - Complete context with all content
    • COMPLETION.json - Raw API response
    • COMPLETION.md - Completion text

Example

See the example/ directory for a complete working example:

cd example
passive-agent

Configuration

OpenAI

export OPENAI_API_KEY="your-key"
export OPENAI_MODEL="gpt-4"  # Optional, default is gpt-4
export OPENAI_BASE_URL="https://api.openai.com/v1"  # Optional, for custom endpoints
passive-agent

OpenRouter

export OPENROUTER_API_KEY="your-key"
export OPENROUTER_MODEL="anthropic/claude-3-opus"
passive-agent

Documentation

For detailed usage instructions, see USAGE.md.

License

MIT License - see LICENSE file for details.

Metadata

Release files for passive-agent-kahiroka 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for passive-agent-kahiroka 0.3.1
File Size Uploaded
passive_agent_kahiroka-0.3.1.tar.gz 13.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for passive-agent-kahiroka 0.3.1
File Interpreter ABI Platform
passive_agent_kahiroka-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / passive_agent_kahiroka-0.3.1.tar.gz

Download URL passive_agent_kahiroka-0.3.1.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e5304df01dc8745db82d1c15954e68d0f68fce64f2a97c3c0d16263893bf67cb
BLAKE2b-256 checksum
How to use checksums
fa9508bdb4ff394e3c2d15c64fe26f402d6bfff1218fe617b1d033e76a1d04ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Release files / passive_agent_kahiroka-0.3.1-py3-none-any.whl

Download URL passive_agent_kahiroka-0.3.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d937cc3f0589269d86ab878a03258f6d64dc111594c5f98d25d56158c61c12cc
BLAKE2b-256 checksum
How to use checksums
ada6dc4ee7f8a1561a8aa70654cc377a3004ddce0b7f0776f5577b84291bf8f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page