af8f99dea3
Frontend (frontend/app.js): - Add textarea for improvement feedback - Add submit button with loading state - Handle API response and display improved content Backend (backend/copywriter.py): - Add improve_copy() method using Cohere API - Integrate retry mechanism for API calls Backend (backend/main.py): - Add /improve-content POST endpoint - Implement error handling and return improved content with metadata Testing: - Verified feedback submission flow - Confirmed improved content generation - Tested error scenarios and loading states
Marketing Assistant AI - Data Directory
This directory contains the data used by the Marketing Assistant AI system.
Structure
- past_campaigns/: Contains JSON files of past marketing campaigns used for training and reference
- user_queries/: Stores user queries and requests for analytics and model improvement
- style_guidelines/: Contains brand tone and voice guidelines
- vector_store/: Generated vector database for content retrieval (created automatically)
File Formats
Past Campaigns
Past campaign files are stored as JSON with the following structure:
{
"content": "The actual marketing content text",
"content_type": "email_campaign|social_media|blog_post|etc",
"metadata": {
"campaign_name": "Name of the campaign",
"performance_metrics": {
"metric1": value,
"metric2": value
},
"content_type": "Same as above",
"added_at": "ISO timestamp",
"training_data": true
},
"document_id": 0,
"timestamp": "ISO timestamp"
}
User Queries
User query files store information about requests made to the AI:
{
"prompt": "The user's prompt text",
"parameters": {
"content_type": "Type of content requested",
"tone": "Requested tone",
"length": "Requested length",
"include_cta": true|false
},
"timestamp": "ISO timestamp"
}
Brand Style Guidelines
Brand style is stored as a JSON file with the following structure:
{
"brand_name": "Adriana James",
"tone": ["professional", "friendly", "inspirational"],
"voice_characteristics": ["clear", "direct", "empowering"],
"taboo_words": ["cheap", "discount", "bargain"],
"preferred_terms": {
"customers": "clients",
"products": "solutions"
}
}
Adding New Data
Adding Past Campaigns
- Use the API endpoint
POST /training-datawith the appropriate JSON payload - Alternatively, add a JSON file to the
past_campaignsdirectory following the format above
Updating Brand Style
- Use the API endpoint
PUT /brand-stylewith the updated style guidelines - The system will automatically update the style file