Back to .md Directory

Agent Documentation Index

Catalogues 7 agents and 18 supporting modules for an AI ad agency pipeline, with input/output specs and guardrails for each.

May 2, 2026
0 downloads
2 views
ai agent llm rag openai guardrails
View source

What this file does

Catalogues 7 agents and 18 supporting modules for an AI ad agency pipeline, with input/output specs and guardrails for each.

When to use it

  • Onboarding new team members to agent architecture
  • Auditing agent responsibilities and fail conditions
  • Planning which agents to implement or extend
  • Documenting a multi-phase AI pipeline for stakeholders

Assumes this stack

PythonOpenAILLMAES-256

Agent Documentation Index

Agent Registry

Agent IDModuleTypePhase
managerapp/agents/manager.pyHybrid (LLM + deterministic)P6
product_intakeapp/agents/product_intake.pyHybridP1
product_enrichmentapp/agents/product_enrichment.pyLLMP1
reference_intelligenceapp/agents/reference_intelligence.pyLLMP1
scriptwriterapp/agents/scriptwriter.pyLLMP1
caption_seoapp/agents/caption_seo.pyLLMP1
orchestratorapp/agents/orchestrator.pyDeterministicP1

Supporting Modules (Phase 2–5)

ModulePathPurposePhase
Copy Writerapp/content_generation/copy_writer.pyGenerate ad copy with disclosureP5
Image Genapp/content_generation/image_gen.pyGenerate product images via AIP5
Video Genapp/content_generation/video_gen.pyGenerate video storyboards/clipsP5
Calendar Plannerapp/content_generation/calendar_planner.pyGrowth calendar + schedulingP4
Trend Hooksapp/content_generation/trend_hooks.pyTrending hooks + viral patternsP4
SEO Auditorapp/analyzers/seo_auditor.pySEO scoring + keyword analysisP4
Performance Learnerapp/analytics/performance_learner.pyLearn from past metricsP5
Chat Engineapp/analytics/chat_engine.pyAI chat for analytics queriesP5
Approval Gateapp/approval/__init__.pyHuman-in-the-loop with auditP5
Publisherapp/publishers/__init__.pyMulti-platform publish + dedupP5
Token Vaultapp/publishers/token_vault.pyAES-256 OAuth token storageP6
Schedulerapp/scheduling/__init__.pyPost scheduling engineP5
LLM Clientapp/services/llm_client.pyOpenAI wrapper + dry-run modeP6
Script Templatesapp/agents/script_templates.pyExtracted script angle templatesP6
Rights Checksapp/services/rights_checks.pyPer-type rights verification funcsP6
Rights Dataapp/services/rights_data.pyTrademark pattern registryP6
Pipeline Stateapp/flows/pipeline_state.pyPipelineStatus enum + PipelineState modelP6
Pipeline Stepsapp/flows/pipeline_steps.pyHeavy step method mixinP6

Agent: product_intake

AttributeValue
IDproduct_intake
Moduleapp/agents/product_intake.py
RoleIngest Amazon product data from API, CSV, or manual input
Inputssource, asin, title, price, category, csv_data
Outputsproducts (list of ProductRecord)
ToolsAmazonLookupTool (future)
GuardrailsASIN format validation, no web scraping, audit logged
Fail ConditionInvalid ASIN → ValueError

Agent: product_enrichment

AttributeValue
IDproduct_enrichment
Moduleapp/agents/product_enrichment.py
RoleEnrich products with category taxonomy, persona, use cases
Inputsproduct (ProductRecord dict)
Outputsenriched_product (EnrichedProduct dict)
GuardrailsInput validation, output secret check
KPIPersona relevance accuracy

Agent: reference_intelligence

AttributeValue
IDreference_intelligence
Moduleapp/agents/reference_intelligence.py
RoleMap products to culturally resonant references
Inputsproduct_id, category, primary_persona, use_cases
Outputsreference_bundle (ReferenceBundle dict)
GuardrailsDefault to style_only, never suggest character likenesses without license
Fail ConditionNo matches → returns safe fallback references

Agent: scriptwriter

AttributeValue
IDscriptwriter
Moduleapp/agents/scriptwriter.py
RoleGenerate short-form video scripts
Inputsbrief, product_title, product_category, use_cases, reference_style
Outputsscript (Script dict with hook, scenes, CTA)
Anglescomparison, top_3, story, problem_solution, aesthetic, meme_style
GuardrailsNo unverifiable claims, no fake testimonials, CTA includes {{AFFILIATE_DISCLOSURE}}

Agent: caption_seo

AttributeValue
IDcaption_seo
Moduleapp/agents/caption_seo.py
RoleGenerate platform-optimized captions with affiliate disclosure
Inputshook, value_prop, category, affiliate_link, target_platforms
Outputscaption_bundle (CaptionBundle dict)
CRITICALEvery caption MUST pass validate_disclosure()
Auto-fixMissing disclosure → add_disclosure() applied automatically

Agent: orchestrator

AttributeValue
IDorchestrator
Moduleapp/agents/orchestrator.py
RoleManage pipeline flow, route decisions, enforce retry limits
Inputsaction, compliance_status, qa_status
Outputsnext_step, should_continue, reason
Max Retries3 rewrite loops before forced REJECT
GuardrailsDeterministic — no LLM involved in routing decisions

Agent: manager (Phase 6)

AttributeValue
IDmanager
Moduleapp/agents/manager.py
RoleSupervises all worker agents; routes decisions; LLM quality review
TypeHybrid — deterministic routing + LLM content review
Inputsaction (route_rights / route_qa / review_content / track_agent / get_status)
Outputsnext_step, should_continue, reason, quality_score
Max Retries3 rewrite loops per scope before forced REJECT
LLM Usagereview_content action uses LLM to score quality (0–100) and check brand safety
GuardrailsAll routing is deterministic; LLM only used for quality scoring

Actions

ActionPurposeLLM?
route_rightsRoute APPROVE/REWRITE/REJECT from rights checkNo
route_qaRoute APPROVE/REWRITE/REJECT from QA checkNo
review_contentScore content quality, check disclosure/brand safetyYes
track_agentRecord agent run metrics (duration, failures)No
get_statusReturn supervision status + health metricsNo

Base Agent Contract

All agents extend BaseAgent which enforces:

  1. Pre-execution: AgentConstitution.validate_input() on all string inputs
  2. Post-execution: AgentConstitution.validate_no_secret_exposure() on all outputs
  3. Audit logging: Start, complete, violation, and error events logged
  4. Error handling: Exceptions caught, logged, and re-raised

What's inside

Agent registry table, 18 supporting modules table, 7 detailed agent specs, base agent contract.

Change this for your project

  • Replace app/agents/ paths with your project's agent directory
  • Replace Venkatchavan/SocialMedia_AD_Agency with your repository name
  • Replace {{AFFILIATE_DISCLOSURE}} with your disclosure template variable

Where it goes

Save as AGENTS.md in your repository root. Read by Codex, Cursor and other agents that follow the AGENTS.md convention.

Worth borrowing

  • Hybrid agent pattern: deterministic routing with LLM only for quality scoring
  • Guardrail-first design: validate inputs and outputs via a constitution contract
  • Phase-based module maturity labels (P1, P6) to track development progress

Related Documents