Skip to main content

Example marketing content agent demonstrating the full prompt-manager stack

Project description

Marketing Content Agent Example

A marketing content agent whose prompts get better over time. Built on the full Autoresearch Prompt Manager stack, powered by agno.

Install

pip install autoresearch-prompt-manager[example]

Configure

export PM_LLM_PROVIDER=groq              # or: anthropic, openai, gemini, openrouter
export PM_LLM_MODEL=openai/gpt-oss-120b  # or: claude-sonnet-4-20250514, gpt-4o, etc.
export PM_LLM_API_KEY=your-api-key       # required
export PM_DATABASE_URL=postgresql://prompt_manager:prompt_manager@localhost:15432/prompt_manager
Env Var Default Description
PM_LLM_PROVIDER groq LLM provider
PM_LLM_MODEL openai/gpt-oss-120b Model ID
PM_LLM_API_KEY / GROQ_API_KEY -- API key (required)
PM_API_URL http://localhost:8910 Prompt Manager API URL
PM_DATABASE_URL postgresql://... PostgreSQL connection

Quick start

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

# Seed prompt templates
arpm-example seed

# Generate content
arpm-example run "Write a welcome email for Alice joining TechCorp"

# Run the full autoresearch optimization loop
arpm-example loop

# Check status
arpm-example status

Commands

Command What it does
arpm-example seed Seed 4 marketing prompt templates into the API
arpm-example run "task" Generate content using an LLM with the best prompt version
arpm-example loop Run the full autoresearch optimization loop (multi-version experiment + autoresearcher)
arpm-example status Check API connection, prompt count, LLM config

What it demonstrates

  1. Prompt resolution -- the agent calls arpm-example run and gets the best template via experiment-aware routing
  2. A/B experiment routing -- MurmurHash3 deterministic routing, same user always gets the same variant
  3. Quality metrics -- the agent self-evaluates and reports scores back to the API
  4. Autonomous optimization -- autoresearcher-shonku analyses metrics, proposes improved versions, deploys experiments with adjusted weights

The full loop (arpm-example loop)

This runs 6 steps:

Step 1. Create a prompt with 2 versions (formal vs casual)

Step 2. Create an A/B experiment with 50/50 routing

Step 3. Run the marketing agent 4 times. Each session gets routed to a different version. The agent generates content, rates it, reports the metric.

Step 4. Check metrics per version:

v1 (formal): mean=6.00
v2 (casual): mean=6.50

Step 5. Autoresearcher runs. It reads the metrics, reads the prompts, proposes v3 (combining the best of both), validates safety, and deploys a new experiment:

Version Style Weight
v1 Formal 30%
v2 Casual 30%
v3 Optimized 40%

Step 6. Verify all 3 versions are now receiving traffic.

How tools flow

arpm-example (this package)
  │
  │ defines tools that wrap the prompt-manager API:
  │   resolve_prompt  → GET /resolve/{slug}
  │   report_metric   → POST /metrics
  │
  └─→ MarketingContentAgent (shonku agent)
        │
        │ agent's built-in tool:
        │   rate_content  → heuristic quality scorer
        │
        └─→ agno → LLM (Groq gpt-oss-120b)

For the optimization loop, the autoresearcher gets 6 additional tools (get_prompt, get_metrics, create_version, create_experiment, conclude_experiment, get_sample_interactions) that also wrap the API.

The autoresearcher has no built-in knowledge of your prompts. It learns everything through tool calls.

Seed prompts

Slug Type Tags
welcome-email Email email, onboarding
social-post Social social, engagement
ad-copy Ad ad, conversion
product-description Product product, ecommerce

Contributing

# Clone the repo
git clone git@github.com:kaustav1996/autoresearch-prompt-manager.git
cd autoresearch-prompt-manager/packages/example
pip install -e ".[dev]"
pytest

License

MIT

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

marketing_agent_example-0.1.4.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

marketing_agent_example-0.1.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file marketing_agent_example-0.1.4.tar.gz.

File metadata

  • Download URL: marketing_agent_example-0.1.4.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marketing_agent_example-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a48990918e269f362f52ba0d0b8a1ec55e325d191f5d300abf9d793b61c2a169
MD5 d98adfe1f62ed8d6e2f202318fee9b70
BLAKE2b-256 d3eef925899242831c04407439057863e2d6bcb1ffdc0e7785134846857bd304

See more details on using hashes here.

File details

Details for the file marketing_agent_example-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for marketing_agent_example-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2dad9221739e0dde9baf66216bc4d6fca5e2529c1e934b6cf7f7c464233d9f10
MD5 ebcc85dd80d69fe56d73246b8de85ce7
BLAKE2b-256 740549f929ef58361c38f617d7baa44c4f3c9c6a81410bc8ce0961830b596264

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