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

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.2.0.tar.gz (12.8 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.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for passive_agent_kahiroka-0.2.0.tar.gz
Algorithm Hash digest
SHA256 68c3a3125fd20189dd6583c0f6a6fbb7ac384c8cad951caf271df2212636df13
MD5 e13ca9c929beafd5bc90d015605dfe04
BLAKE2b-256 2d13d433e9cb9c1d2ffa1519c6b34fae3aae490612f7aa80e1e8876ece67fd62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for passive_agent_kahiroka-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 800173883a01bc9c7e5fcd885832e0194f32bd73569a5eba901d99c40b663abb
MD5 cb3434ca66f48fd3337735e00cb51315
BLAKE2b-256 84b36bbf25b6468dcebeefea39117bb1af95d63da019372f8c24c66018f9f1fd

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