6fd7213076
- Set up FastAPI backend with modular structure: - main.py for API routing - copywriter.py for AI-powered content generation using Cohere - embeddings.py for generating and reranking content embeddings - vector_store.py for FAISS-based similarity search - brand_style.py for managing brand tone, taboo words, and preferred terms - config.py for managing environment and application settings - Configured RESTful API endpoints: /generate-copy, /brand-style, /training-data, /improve-content, /analyze-content - Created frontend with vanilla HTML, CSS, and JS (index.html, styles.css, app.js) - Integrated brand style management for tone, voice, taboo words, and terminology - Implemented vector search for referencing similar historical content - Enabled training data input to improve future AI output - Added environment variable support for API keys and model configs - Structured data storage with local JSON and DB files - Added developer documentation, API reference, and project setup instructions This commit provides the foundation for a full-stack, AI-driven content creation platform that ensures brand consistency, speeds up marketing workflows, and supports iterative improvement over time.
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