Build production-ready AI agents with markdown-defined workflows
Quick Start โข Documentation โข Examples โข Features โข Contributing
PISA (Prismer Intelligence Server Agents) is a next-generation AI agent framework built on top of the OpenAI Agent SDK. It enables developers to create sophisticated, production-ready AI agents using markdown-based configuration and modular architecture.
- ๐ฏ Markdown-First: Define agents, tools, and workflows entirely in markdown files
- ๐ง Modular Design: Compose agents from reusable modules (Planning, Execution, Observation, Reflection)
- ๐ ๏ธ Rich Tooling: Built-in support for Functions, MCP Servers, and Subagents
- ๐ Observable: Real-time execution tracking with beautiful CLI output powered by Rich
- ๐ Event-Driven: Production-ready deployment with Temporal integration
- ๐จ Developer-Friendly: Intuitive CLI, comprehensive logging, and extensive documentation
- Context Engineering: 1st version 'Pyramid Context Engineering' solution
From PyPI (Recommended):
pip install pisa-pythonFrom Source:
# Clone the repository
git clone https://github.com/Prismer-AI/pisa.git
cd pisa
# Install dependencies (using uv for faster installation)
uv pip install -e .
# Or using pip
pip install -e .Create a .env file in the project root:
# OpenAI Configuration
OPENAI_API_KEY=your_api_key_here
OPENAI_BASE_URL=https://api.openai.com/v1
# Default Model
AGENT_DEFAULT_MODEL=gpt-4o-mini
# Optional: Temporal Configuration
TEMPORAL_ADDRESS=localhost:7233- Initialize a new agent project:
pisa init my-agent
cd my-agent- Define your agent in
.prismer/agent.md:
---
name: my-first-agent
version: 1.0.0
description: A simple agent that performs calculations
loop_type: plan_execute
capabilities:
- calculator
- text_to_table
planning:
max_iterations: 10
# ... more configuration
---
## Planning Instructions
You are a helpful mathematical assistant. Break down complex calculations into steps.
## Reflection Guidelines
After each calculation, verify the result makes sense.- Define capabilities in
.prismer/capability/function/:
from pisa.capability import capability
from agents.extensions.function_tool import function_tool
@capability(
name="calculator",
description="Perform basic mathematical operations",
capability_type="function",
tags=["math", "calculation"]
)
def calculator(operation: str, a: float, b: float) -> float:
"""
Perform a mathematical operation.
Args:
operation: The operation (add, subtract, multiply, divide)
a: First number
b: Second number
"""
ops = {
"add": lambda x, y: x + y,
"subtract": lambda x, y: x - y,
"multiply": lambda x, y: x * y,
"divide": lambda x, y: x / y
}
return ops[operation](a, b)- Run your agent:
# Validate configuration
pisa validate .prismer/agent.md
# List available capabilities
pisa list-capabilities
# Run the agent
pisa run .prismer/agent.md -i "Calculate 123 * 456 and show the result"Define your entire agent in a single markdown file:
---
name: data-processor
loop_type: plan_execute
capabilities:
- data_loader
- data_cleaner
- data_analyzer
---
## Planning Instructions
Break down data processing tasks into logical steps...
## Execution Guidelines
Ensure data quality at each step...Choose from battle-tested agent loop patterns:
- Plan-Execute: Plan first, then execute tasks sequentially
- ReAct (coming soon): Reason and Act in interleaved fashion
- Custom: Define your own loop template
- Functions: Simple Python functions with
@function_tooldecorator - MCP Servers: Connect to Model Context Protocol servers
- Subagents: Delegate to specialized sub-agents via handoff
# Function Tool
@capability(capability_type="function")
@function_tool
def my_function(param: str) -> str:
return f"Processed: {param}"
# Subagent
@capability(capability_type="agent")
def my_subagent() -> Agent:
return Agent(
name="specialist",
instructions="You are a specialist in..."
)Real-time execution visualization powered by Rich:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ค User Query โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Calculate the matrix multiplication of [[1,2],[3,4]] ร [[5,6],[7,8]] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ Planning (Iteration 0) โโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Goal: Matrix multiplication and analysis โ
โ Total Tasks: 3 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ง Execution (Iteration 1) โโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Task: task_01 โ
โ Capability: matrix_multiply โ
โ Status: โ
โ
โ Result: [[19, 22], [43, 50]] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
- Structured Logging: Context-aware logs with
structlog - Execution Tracking: Monitor planning, execution, observation, and reflection phases
- Debug Mode: Deep inspection of LLM interactions and tool calls
- Metrics Collection: Performance tracking for production deployments
| Document | Description |
|---|---|
| README | This file - Quick start and overview |
| Contributing Guide | How to contribute to PISA |
| CHANGELOG | Version history and release notes |
| Example Agent | Full example with math & data processing |
| Agent Template | Agent definition reference |
| Capability README | Capability system documentation |
๐ Full documentation coming soon! We're working on comprehensive guides for:
- Quick Start Tutorial
- Architecture Deep Dive
- Capability Development Guide
- Loop Template Creation
- API Reference
A sophisticated agent that performs matrix operations, calculates softmax, and generates structured tables.
Location: example/agent_example/
Run the example:
cd example/agent_example
pisa run .prismer/agent.md -i "Calculate [[1,2],[3,4]] ร [[5,6],[7,8]], compute softmax, and show results as a table"Features demonstrated:
- โ Matrix operations (Function capability)
- โ Softmax calculations (MCP capability)
- โ Text-to-table conversion (Subagent capability)
- โ Plan-Execute loop
- โ Context management and persistence
- โ Rich CLI output
Example capabilities:
matrix_operations- Matrix math (add, multiply, transpose, etc.)compute_softmax- Temperature-scaled softmaxsoftmax_with_attention- Attention weights calculationtext_to_table- Convert text to structured tables
We're working on additional examples:
- ๐ Research Assistant - Web search and paper summarization
- ๐ Code Review Agent - Automated code analysis and suggestions
- ๐ Data Analysis Agent - CSV/JSON processing and visualization
- ๐ Customer Support Bot - Multi-turn conversation with knowledge base
PISA follows a clean, modular architecture designed for both development and production deployment:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Agent Definition Layer โ
โ (agent.md - Markdown Config) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Agent Loop Engine (Core) โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Loop Templates โ โ Capability Systemโ โ
โ โ - Plan-Execute โ โ - Functions โ โ
โ โ - ReAct (soon) โ โ - MCP Servers โ โ
โ โ - Custom โ โ - Subagents โ โ
โ โโโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโ โ
โ โ Core Modules โ โ
โ โ - Planning - Observation โ โ
โ โ - Execution - Reflection โ โ
โ โ - Validation - Context Management โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OpenAI Agent SDK Runtime โ
โ (Messages, Tools, Handoffs, Streaming) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Temporal Cluster โ
โ (Orchestration & Durability) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PISA Temporal Workflow โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Workflow Orchestration Layer โ โ
โ โ - State Management & Persistence โ โ
โ โ - Checkpointing & Recovery โ โ
โ โ - Human-in-the-Loop Support โ โ
โ โ - Long-running Task Execution โ โ
โ โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Temporal Activities โ โ
โ โ - Agent Loop Execution โ โ
โ โ - State Checkpoint Storage โ โ
โ โ - User Notification โ โ
โ โ - External API Calls โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Agent Loop Engine (Same as Dev) โ
โ (Referenced from Development Mode above) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Agent Definition Layer
- Markdown-based configuration (
agent.md) - Declarative instructions and settings
- Version-controlled agent specifications
Agent Loop Engine
- Loop Templates: Reusable behavior patterns (Plan-Execute, ReAct, etc.)
- Core Modules: Planning, Execution, Observation, Reflection, Validation
- Capability System: Unified interface for Functions, MCP Servers, and Subagents
- Context Management: Pyramid Context Engineering with compression
OpenAI Agent SDK
- LLM interaction primitives
- Tool/function calling
- Agent handoffs
- Message streaming
Temporal Workflow Layer (Production Only)
- Durable execution with automatic state persistence
- Failure recovery and retry mechanisms
- Long-running task support (hours/days)
- Human-in-the-loop workflows
- Built on Temporal's OpenAI Agents integration
| Feature | Development Mode | Production Mode (Temporal) |
|---|---|---|
| Use Case | Local testing & iteration | Production deployment |
| Execution | Direct Python process | Temporal Workflow |
| State | In-memory | Durable (persisted) |
| Recovery | Manual restart | Automatic retry & resume |
| Monitoring | CLI logs | Temporal UI + metrics |
| Scalability | Single instance | Distributed workers |
| Cost | Free (local) | Infrastructure cost |
PISA uses a sophisticated state management system:
- LoopState: Centralized state for agent execution
- Context Compression: Pyramid Context Engineering to manage token limits
- Checkpointing: Periodic state snapshots for recovery
- State Serialization: JSON-based state persistence
- โ Core framework with Plan-Execute loop
- โ Function, MCP, and Subagent capabilities
- โ CLI tools and rich observability
- โ Markdown-based agent definition
- โ Context management with Pyramid Context Engineering
- ๐ง Temporal workflow integration (experimental)
- ๐ฒ Complete Temporal production deployment guide
- ๐ฒ Additional loop templates (ReAct, ReWOO)
- ๐ฒ Enhanced context compression with LOD (Level of Detail)
- ๐ฒ Multi-agent collaboration patterns
- ๐ฒ Streaming response support
- ๐ฒ Comprehensive test coverage (target: 80%+)
- ๐ฒ Production-grade Temporal workflow orchestration
- ๐ฒ High-performance server mode for concurrent agents
- ๐ฒ Agent marketplace and community templates
- ๐ฒ Auto-optimization with feedback loops
- ๐ฒ Multi-modal support (images, audio, video)
- ๐ฒ Advanced monitoring and observability
- ๐ฒ Enterprise features (RBAC, audit logs, etc.)
We welcome contributions! Please see our Contributing Guide for details.
# Clone and install in development mode
git clone https://github.com/Prismer-AI/pisa.git
cd pisa
uv pip install -e ".[dev]"
# Run tests
uv run pytest tests/ -v
# Run linter
uv run ruff check src/
# Format code (using ruff format)
uv run ruff format src/- ๐ Documentation improvements
- ๐ Bug reports and fixes
- โจ New capability implementations
- ๐จ Loop template designs
- ๐ Internationalization
PISA is released under the MIT License.
PISA is built on the shoulders of giants:
- OpenAI Agent SDK - Core agent primitives and LLM interactions
- Temporal - Durable workflow orchestration for production deployments
- Temporal OpenAI Agents Integration - Production-ready agent workflow patterns
- Rich - Beautiful terminal output and progress tracking
- Python Ecosystem - The amazing tools and libraries that make this possible
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@prismer.ai
- Twitter: @PrismerAI
โญ Star us on GitHub โ it motivates us a lot!
Made with โค๏ธ by Prismer AI Lab