Skip to main content

Prompt Manager

Versioned prompt CRUD, A/B experiments, metric collection, and LLM-driven optimization API.

Install

# Just the client SDK (for services that fetch prompts)
pip install prompt-manager[client]

# Full API server
pip install prompt-manager[api]

# Client + metric reporting
pip install prompt-manager[client,metric]

# Everything
pip install prompt-manager[all]

Quick start

Start the API

# Configure
export PM_DATABASE_URL=postgresql://prompt_manager:prompt_manager@localhost:15432/prompt_manager
export PM_LLM_PROVIDER=groq
export PM_LLM_MODEL=openai/gpt-oss-120b
export PM_LLM_API_KEY=your-api-key

# Start
arpm-api up       # Start PostgreSQL via Docker
arpm-api start    # Run migrations + start API on :8910

Use the client SDK

from prompt_manager.client import PromptManagerClient

client = PromptManagerClient(base_url="http://localhost:8910")

# Resolve a prompt (returns latest version, experiment-aware)
prompt = await client.resolve("welcome-email", session_id="user-123")
print(prompt.body)       # "Hi {name}, welcome to {company}!"
print(prompt.version)    # 2

# Report a quality metric
await client.report_metric("welcome-email", str(prompt.version_id), "quality", 8.5)

API endpoints

Method Path Description
POST /prompts Create prompt (auto-creates v1)
GET /prompts List all prompts
GET /prompts/{slug} Get prompt by slug
POST /prompts/{slug}/versions Create new version
GET /prompts/{slug}/versions List versions
GET /resolve/{slug} Resolve prompt (experiment-aware)
POST /experiments Create A/B experiment
PATCH /experiments/{id}/status Start/pause/conclude
POST /metrics Report metric signal
GET /metrics/aggregate Aggregated metrics per version
POST /optimize Trigger LLM optimization
GET /health Health check

Key features

  • Slug-based addressing -- resolve("welcome-email") not UUIDs
  • Immutable versions -- append-only, SHA-256 dedup, full audit trail
  • Experiment routing -- MurmurHash3 deterministic + Thompson Sampling (auto_optimize)
  • Sticky sessions -- same user always sees same variant
  • Metric collection -- quality signals per version, batch ingestion
  • MCP server -- expose all tools via Model Context Protocol
  • CLI -- arpm-api up, arpm-api start, arpm-api migrate, arpm-api health

Database

Requires PostgreSQL 14+. Migrations run automatically on arpm-api start.

arpm-api up       # Start PostgreSQL via Docker

# Or point to existing Postgres and run migrations only
PM_DATABASE_URL=postgresql://user:pass@host:5432/dbname arpm-api migrate

Configuration

All settings via PM_-prefixed environment variables:

Variable Default Description
PM_DATABASE_URL postgresql://localhost:5432/prompt_manager PostgreSQL DSN
PM_HOST 0.0.0.0 Bind host
PM_PORT 8910 Bind port
PM_LLM_PROVIDER anthropic LLM for optimization
PM_LLM_MODEL claude-sonnet-4-20250514 Model ID
PM_LLM_API_KEY -- API key

Part of autoresearch-prompt-manager

autoresearch-prompt-manager  (this package -- API, client, metrics)
  -> autoresearcher-shonku   (optimization agents)
  -> shonku                  (agent framework)
  -> agno                    (runtime -- https://agno.com)

LLM-driven optimization is powered by agno and AgentOS.

Contributing

  1. Fork autoresearch-prompt-manager
  2. cd packages/prompt_manager && pip install -e '.[dev,api,client,metric]'
  3. Make changes, pytest, ruff check src/
  4. Integration tests: PM_DATABASE_URL=... python3 -m pytest tests/integration/
  5. Submit a PR

License

MIT

Metadata

Release files for autoresearch-prompt-manager 0.1.3

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

Source distribution (sdist)

Source distribution for autoresearch-prompt-manager 0.1.3
File Size Uploaded
autoresearch_prompt_manager-0.1.3.tar.gz 28.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autoresearch-prompt-manager 0.1.3
File Interpreter ABI Platform
autoresearch_prompt_manager-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 68.5 kB

Release files / autoresearch_prompt_manager-0.1.3.tar.gz

Download URL autoresearch_prompt_manager-0.1.3.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c3d3c91faf423ad3a7f2e61a64043c5f2dbf26010aaa4a013fac4b7f3042ecf
BLAKE2b-256 checksum
How to use checksums
6807cd5a0601c517240e4461f132469a888c35fec8f133ab1cad2d11f29a7d84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / autoresearch_prompt_manager-0.1.3-py3-none-any.whl

Download URL autoresearch_prompt_manager-0.1.3-py3-none-any.whl
Size 39.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b949666d150add0f4f395a78e3fcf9a4a5458d7848cc59f65ecae0e8983325d2
BLAKE2b-256 checksum
How to use checksums
ba9797739fccd9d62d4d54e2e95ba66e24e4bc32324c918baf2833d3869a5696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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