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
-
Create an
INSTRUCT.mdfile with your instructions:@header.md @data/ /completion @footer.md -
Run passive-agent:
passive-agent
-
Check the generated files:
CONTEXT.md- Complete context with all contentCOMPLETION.json- Raw API responseCOMPLETION.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file passive_agent_kahiroka-0.3.1.tar.gz.
File metadata
- Download URL: passive_agent_kahiroka-0.3.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5304df01dc8745db82d1c15954e68d0f68fce64f2a97c3c0d16263893bf67cb
|
|
| MD5 |
683acdf4d79f9e13694a7fbb76e3f8cb
|
|
| BLAKE2b-256 |
fa9508bdb4ff394e3c2d15c64fe26f402d6bfff1218fe617b1d033e76a1d04ca
|
File details
Details for the file passive_agent_kahiroka-0.3.1-py3-none-any.whl.
File metadata
- Download URL: passive_agent_kahiroka-0.3.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d937cc3f0589269d86ab878a03258f6d64dc111594c5f98d25d56158c61c12cc
|
|
| MD5 |
f06c8dd849f34d7e29274e07171d4525
|
|
| BLAKE2b-256 |
ada6dc4ee7f8a1561a8aa70654cc377a3004ddce0b7f0776f5577b84291bf8f2
|