CoolFace
Apppublic

Chris4K/agent-prompts

sourceHugging Facemitupdated 6mo agoView on Hugging Face
1likes
App README

๐Ÿ’ฌ agent-prompts

FORGE Prompt & Persona Registry

No more hardcoded system prompts. Every agent fetches its persona at startup from here. Owns: prompt templates, personas, A/B test variants, approval workflow.

Seeded prompts (migrated from existing spaces)

IDTypeAgentDescription
nexus_routersystemnexusNEXUS routing & slot management persona
pulse_schedulersystempulsePULSE ReAct scheduler persona
self_reflect_promptuser*Post-task self-reflection (migrated from PULSE)
task_decomposeuser*Break tasks into ordered subtasks
error_recoveryuser*Graceful error handling in ReAct loops
react_basesystem*Generic ReAct Thought/Action/Observation fragment
relay_notificationuserrelayTelegram notification template
loop_improvement_cyclesystemloopLOOP orchestrator persona

REST API

GET  /api/prompts                  List/search (agent, type, status, tag, q)
GET  /api/prompts/{id}             Get prompt (latest version)
GET  /api/prompts/{id}/render      Render โ€” pass variables as query params
GET  /api/prompts/{id}/versions    Version history
GET  /api/prompts/{id}/ab          A/B stats
POST /api/prompts                  Create/version a prompt
POST /api/prompts/{id}/approve     Approve for production
POST /api/prompts/{id}/deprecate   Deprecate
GET  /api/personas                 List active personas
GET  /api/personas/{agent}         Get persona with rendered system prompt
POST /api/personas                 Upsert persona
POST /api/ab                       Record A/B outcome
GET  /api/stats                    Registry stats

MCP

GET /mcp/sse ยท POST /mcp

Tools: prompts_get, prompts_search, prompts_create, prompts_approve,
       persona_get, persona_set, ab_record, prompts_stats

Integration pattern for existing spaces

Add PROMPTS_URL secret, then at startup:

python
import os, requests

PROMPTS_URL = os.getenv("PROMPTS_URL", "https://chris4k-agent-prompts.hf.space")
_cached_persona = None

def get_system_prompt(fallback: str) -> str:
    global _cached_persona
    if _cached_persona: return _cached_persona
    try:
        r = requests.get(f"{PROMPTS_URL}/api/personas/nexus", timeout=3)
        _cached_persona = r.json().get("system_prompt", fallback)
        return _cached_persona
    except Exception:
        return fallback  # always safe โ€” never blocks startup

Secrets

KeyDescription
PROMPTS_KEYOptional write auth (X-Prompts-Key header)

Built by Chris4K โ€” ki-fusion-labs.de