Skip to main content

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

Project description

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.

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

passive_agent_kahiroka-0.3.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

passive_agent_kahiroka-0.3.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file passive_agent_kahiroka-0.3.1.tar.gz.

File metadata

File hashes

Hashes for passive_agent_kahiroka-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e5304df01dc8745db82d1c15954e68d0f68fce64f2a97c3c0d16263893bf67cb
MD5 683acdf4d79f9e13694a7fbb76e3f8cb
BLAKE2b-256 fa9508bdb4ff394e3c2d15c64fe26f402d6bfff1218fe617b1d033e76a1d04ca

See more details on using hashes here.

File details

Details for the file passive_agent_kahiroka-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for passive_agent_kahiroka-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d937cc3f0589269d86ab878a03258f6d64dc111594c5f98d25d56158c61c12cc
MD5 f06c8dd849f34d7e29274e07171d4525
BLAKE2b-256 ada6dc4ee7f8a1561a8aa70654cc377a3004ddce0b7f0776f5577b84291bf8f2

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