Dify-Learning / content /projects.py
AtZa
Upload 16 files
7cb4836 verified
"""
Project content for the Dify AI Learning Platform
Real-world projects based on official Dify use cases and documentation
"""
def get_all_projects():
"""Return all available hands-on projects"""
return [
{
'id': 1,
'title': 'AI Customer Service Bot',
'slug': 'ai-customer-service-bot',
'category': 'Customer Support',
'difficulty': 'beginner',
'difficulty_color': 'success',
'estimated_time': 45,
'description': 'Build an intelligent customer service bot that can answer questions from your product documentation and handle common support queries.',
'icon': 'headphones',
'outcomes': [
'A fully functional customer service chatbot',
'Knowledge base integration for product documentation',
'Automated response system for common queries',
'Escalation handling for complex issues'
],
'prerequisites': [
'Completed "Building Your First Chatbot" tutorial',
'Completed "Creating Knowledge Bases with RAG" tutorial',
'Basic understanding of customer service workflows'
]
},
{
'id': 2,
'title': 'AI Travel Consultant',
'slug': 'ai-travel-consultant',
'category': 'Travel & Tourism',
'difficulty': 'intermediate',
'difficulty_color': 'warning',
'estimated_time': 60,
'description': 'Create an AI agent that can plan travel itineraries, suggest accommodations, and find restaurants using external tools and APIs.',
'icon': 'map-pin',
'outcomes': [
'Intelligent travel planning agent',
'Integration with Wikipedia and Google Search',
'Dynamic itinerary generation',
'Hotel and restaurant recommendations with ratings'
],
'prerequisites': [
'Completed "Building AI Agents" tutorial',
'Completed "Tool Integration and APIs" tutorial',
'Understanding of AI agent workflows'
]
},
{
'id': 3,
'title': 'Document Analysis Assistant',
'slug': 'document-analysis-assistant',
'category': 'Document Processing',
'difficulty': 'intermediate',
'difficulty_color': 'warning',
'estimated_time': 55,
'description': 'Build an AI agent that can analyze documents, extract key information, and answer questions about document content.',
'icon': 'file-text',
'outcomes': [
'Document upload and processing system',
'AI-powered content analysis',
'Information extraction capabilities',
'Document Q&A functionality'
],
'prerequisites': [
'Completed "Creating Knowledge Bases with RAG" tutorial',
'Completed "Working with Files and Documents" tutorial',
'Understanding of document processing workflows'
]
},
{
'id': 4,
'title': 'Smart Recipe Generator',
'slug': 'smart-recipe-generator',
'category': 'Food & Lifestyle',
'difficulty': 'beginner',
'difficulty_color': 'success',
'estimated_time': 35,
'description': 'Create an AI agent that generates personalized recipes based on ingredients, dietary preferences, and cooking skills.',
'icon': 'chef-hat',
'outcomes': [
'Personalized recipe generation',
'Ingredient-based recipe suggestions',
'Dietary restriction handling',
'Cooking instruction optimization'
],
'prerequisites': [
'Completed "Building Your First Chatbot" tutorial',
'Basic understanding of conversational AI'
]
},
{
'id': 5,
'title': 'Investment Analysis Copilot',
'slug': 'investment-analysis-copilot',
'category': 'Finance',
'difficulty': 'advanced',
'difficulty_color': 'danger',
'estimated_time': 75,
'description': 'Build a sophisticated AI agent that analyzes stocks, provides market insights, and generates investment recommendations using financial APIs.',
'icon': 'trending-up',
'outcomes': [
'Real-time stock analysis system',
'Market trend analysis and insights',
'Investment recommendation engine',
'Risk assessment and portfolio suggestions'
],
'prerequisites': [
'Completed "Building AI Agents" tutorial',
'Completed "Tool Integration and APIs" tutorial',
'Understanding of financial markets and analysis'
]
},
{
'id': 6,
'title': 'Educational Quiz Bot',
'slug': 'educational-quiz-bot',
'category': 'Education',
'difficulty': 'intermediate',
'difficulty_color': 'warning',
'estimated_time': 40,
'description': 'Develop an interactive AI tutor that creates quizzes, provides explanations, and adapts to student learning patterns.',
'icon': 'graduation-cap',
'outcomes': [
'Adaptive quiz generation system',
'Personalized learning paths',
'Progress tracking and analytics',
'Interactive educational content'
],
'prerequisites': [
'Completed "Building Your First Chatbot" tutorial',
'Completed "Creating Knowledge Bases with RAG" tutorial',
'Understanding of educational workflows'
]
}
]
def get_project_content(slug):
"""Return detailed content for a specific project"""
projects = {
'ai-customer-service-bot': {
'id': 1,
'title': 'AI Customer Service Bot',
'category': 'Customer Support',
'difficulty': 'beginner',
'difficulty_color': 'success',
'estimated_time': 45,
'description': 'Build an intelligent customer service bot that can answer questions from your product documentation and handle common support queries.',
'icon': 'headphones',
'outcomes': [
'A fully functional customer service chatbot',
'Knowledge base integration for product documentation',
'Automated response system for common queries',
'Escalation handling for complex issues'
],
'prerequisites': [
'Completed "Building Your First Chatbot" tutorial',
'Completed "Creating Knowledge Bases with RAG" tutorial',
'Basic understanding of customer service workflows'
],
'overview': '''
<p>Customer service is evolving with AI-powered solutions that can handle routine inquiries 24/7. In this project, you'll build a comprehensive customer service bot that can:</p>
<ul>
<li>Answer questions from your product documentation using RAG</li>
<li>Handle common support queries with pre-trained responses</li>
<li>Escalate complex issues to human agents when needed</li>
<li>Track customer satisfaction and conversation quality</li>
</ul>
<p>This project demonstrates real-world application of AI in customer support, combining knowledge retrieval with intelligent conversation management.</p>
''',
'sections': [
{
'title': 'Setting Up Your Knowledge Base',
'content': '''
<p>Create a comprehensive knowledge base from your product documentation that will power your customer service bot's responses.</p>
''',
'steps': [
{
'title': 'Upload Product Documentation',
'content': '''
Upload your existing product documentation, FAQs, and support materials to Dify. The system will automatically process and chunk this content for optimal retrieval.
**What to Upload:**
- Product manuals and guides
- Frequently asked questions (FAQs)
- Troubleshooting documentation
- Policy documents (returns, warranties, etc.)
- Contact information and escalation procedures
**Best Practices:**
- Use clear, consistent formatting
- Include specific examples and scenarios
- Keep information current and accurate
- Organize content by topic or product line
''',
'tips': [
'Upload documents in PDF, TXT, or DOCX format for best results',
'Break large documents into smaller, focused sections',
'Include keywords customers commonly use'
]
}
]
}
]
},
'ai-travel-consultant': {
'id': 2,
'title': 'AI Travel Consultant',
'category': 'Travel & Tourism',
'difficulty': 'intermediate',
'difficulty_color': 'warning',
'estimated_time': 60,
'description': 'Create an AI agent that can plan travel itineraries, suggest accommodations, and find restaurants using external tools and APIs.',
'icon': 'map-pin',
'outcomes': [
'Intelligent travel planning agent',
'Integration with Wikipedia and Google Search',
'Dynamic itinerary generation',
'Hotel and restaurant recommendations with ratings'
],
'prerequisites': [
'Completed "Building AI Agents" tutorial',
'Completed "Tool Integration and APIs" tutorial',
'Understanding of AI agent workflows'
],
'overview': '''
<p>Travel planning involves researching destinations, finding accommodations, and creating itineraries. In this project, you'll build an AI travel consultant that can:</p>
<ul>
<li>Research destinations and provide detailed information</li>
<li>Plan day-by-day itineraries based on preferences</li>
<li>Find and recommend hotels with ratings and reviews</li>
<li>Suggest restaurants and local attractions</li>
</ul>
<p>This project showcases advanced AI agent capabilities with external tool integration and complex workflow orchestration.</p>
''',
'sections': [
{
'title': 'Configuring External Tools',
'content': '''
<p>Set up Wikipedia and Google Search integrations to provide your travel agent with access to real-time information about destinations, attractions, and travel recommendations.</p>
''',
'steps': [
{
'title': 'Configure Wikipedia Integration',
'content': '''
Add Wikipedia as a tool to your Dify agent to provide detailed information about destinations, landmarks, and cultural sites.
**Configuration Steps:**
1. Go to Tools section in your Dify workspace
2. Add "Wikipedia" from the available tools
3. Configure search parameters for travel-related queries
4. Test with sample destination searches
**Search Optimization:**
- Use specific place names and landmarks
- Include cultural and historical context
- Focus on tourist-relevant information
- Verify information accuracy and recency
''',
'tips': [
'Test Wikipedia searches with various destination formats',
'Combine multiple search terms for comprehensive results',
'Verify information from multiple sources when possible'
]
}
]
}
]
},
'document-analysis-assistant': {
'id': 3,
'title': 'Document Analysis Assistant',
'category': 'Document Processing',
'difficulty': 'intermediate',
'difficulty_color': 'warning',
'estimated_time': 55,
'description': 'Build an AI agent that can analyze documents, extract key information, and answer questions about document content.',
'icon': 'file-text',
'outcomes': [
'Document upload and processing system',
'AI-powered content analysis',
'Information extraction capabilities',
'Document Q&A functionality'
],
'prerequisites': [
'Completed "Creating Knowledge Bases with RAG" tutorial',
'Completed "Working with Files and Documents" tutorial',
'Understanding of document processing workflows'
],
'overview': '''
<p>Document analysis is crucial for businesses dealing with large volumes of text documents. In this project, you'll build an AI assistant that can:</p>
<ul>
<li>Process and analyze various document types</li>
<li>Extract key information and summarize content</li>
<li>Answer specific questions about document content</li>
<li>Identify patterns and insights across multiple documents</li>
</ul>
<p>This project demonstrates advanced document processing capabilities using AI, essential for legal, financial, and research applications.</p>
''',
'sections': [
{
'title': 'Document Processing Setup',
'content': '''
<p>Configure your document processing pipeline to handle various file formats and extract meaningful information from uploaded documents.</p>
''',
'steps': [
{
'title': 'Configure Document Upload',
'content': '''
Set up document upload capabilities in your Dify application to accept and process various file formats including PDFs, Word documents, and text files.
**Supported Formats:**
- PDF documents (.pdf)
- Microsoft Word documents (.docx, .doc)
- Plain text files (.txt)
- Rich text format (.rtf)
- Markdown files (.md)
**Processing Configuration:**
1. Enable file upload in your application settings
2. Set maximum file size limits (recommended: 10MB per file)
3. Configure document chunking for optimal processing
4. Enable OCR for scanned documents if needed
**Quality Optimization:**
- Ensure documents are well-formatted and readable
- Test with sample documents of each supported type
- Monitor processing time and adjust chunk sizes accordingly
''',
'tips': [
'Start with smaller documents to test processing capabilities',
'Use clear, well-structured documents for best results',
'Consider document security and privacy requirements'
]
}
]
}
]
},
'smart-recipe-generator': {
'id': 4,
'title': 'Smart Recipe Generator',
'category': 'Food & Lifestyle',
'difficulty': 'beginner',
'difficulty_color': 'success',
'estimated_time': 35,
'description': 'Create an AI agent that generates personalized recipes based on ingredients, dietary preferences, and cooking skills.',
'icon': 'chef-hat',
'outcomes': [
'Personalized recipe generation',
'Ingredient-based recipe suggestions',
'Dietary restriction handling',
'Cooking instruction optimization'
],
'prerequisites': [
'Completed "Building Your First Chatbot" tutorial',
'Basic understanding of conversational AI'
],
'overview': '''
<p>Cooking inspiration and meal planning can be enhanced with AI assistance. In this project, you'll build a smart recipe generator that can:</p>
<ul>
<li>Generate recipes based on available ingredients</li>
<li>Accommodate dietary restrictions and preferences</li>
<li>Adjust recipes based on cooking skill level</li>
<li>Provide step-by-step cooking instructions</li>
</ul>
<p>This project showcases creative AI applications in daily life, demonstrating how AI can assist with personal tasks and lifestyle decisions.</p>
''',
'sections': [
{
'title': 'Recipe Generation Logic',
'content': '''
<p>Design the core logic for generating personalized recipes based on user preferences, available ingredients, and dietary constraints.</p>
''',
'steps': [
{
'title': 'Create Recipe Prompt Template',
'content': '''
Design a comprehensive prompt template that will guide the AI in generating recipes that meet specific user requirements and preferences.
**Prompt Structure:**
```
You are a professional chef and recipe creator. Generate a recipe based on these requirements:
Ingredients Available: {ingredients}
Dietary Restrictions: {dietary_restrictions}
Cooking Skill Level: {skill_level}
Cuisine Preference: {cuisine_type}
Cooking Time Available: {time_limit}
Please provide:
1. Recipe name and brief description
2. Complete ingredient list with quantities
3. Step-by-step cooking instructions
4. Cooking tips and variations
5. Nutritional highlights
```
**Customization Variables:**
- Available ingredients (user input)
- Dietary restrictions (vegetarian, vegan, gluten-free, etc.)
- Skill level (beginner, intermediate, advanced)
- Cuisine preferences (Italian, Asian, Mexican, etc.)
- Time constraints (15 min, 30 min, 1 hour+)
''',
'tips': [
'Include specific quantity measurements in recipes',
'Provide alternative ingredients for flexibility',
'Add cooking tips for better results'
]
}
]
}
]
},
'investment-analysis-copilot': {
'id': 5,
'title': 'Investment Analysis Copilot',
'category': 'Finance',
'difficulty': 'advanced',
'difficulty_color': 'danger',
'estimated_time': 75,
'description': 'Build a sophisticated AI agent that analyzes stocks, provides market insights, and generates investment recommendations using financial APIs.',
'icon': 'trending-up',
'outcomes': [
'Real-time stock analysis system',
'Market trend analysis and insights',
'Investment recommendation engine',
'Risk assessment and portfolio suggestions'
],
'prerequisites': [
'Completed "Building AI Agents" tutorial',
'Completed "Tool Integration and APIs" tutorial',
'Understanding of financial markets and analysis'
],
'overview': '''
<p>Financial analysis requires processing vast amounts of data and making informed decisions. In this project, you'll build an AI investment copilot that can:</p>
<ul>
<li>Analyze individual stocks with real-time data</li>
<li>Provide comprehensive market trend analysis</li>
<li>Generate investment recommendations based on risk tolerance</li>
<li>Create portfolio suggestions and diversification advice</li>
</ul>
<p>This advanced project demonstrates professional-grade AI applications in finance, including API integration, data analysis, and risk assessment.</p>
''',
'sections': [
{
'title': 'Setting Up Financial Data Integration',
'content': '''
<p>Build connections to financial data sources and configure real-time market analysis capabilities.</p>
''',
'steps': [
{
'title': 'Configure Financial Data APIs',
'content': '''
Set up integration with financial data providers to access real-time stock prices, market data, and financial metrics for comprehensive analysis.
**Recommended Data Sources:**
- Alpha Vantage (free tier available)
- Yahoo Finance API
- Financial Modeling Prep
- IEX Cloud
**Key Data Points to Collect:**
- Current stock price and daily change
- Historical price data (1 year, 5 years)
- Financial ratios (P/E, P/B, ROE, etc.)
- Volume and market capitalization
- Dividend information and yield
- Analyst ratings and price targets
**API Configuration Steps:**
1. Choose your preferred financial data provider
2. Register for API access and obtain API keys
3. Configure API endpoints in Dify tools
4. Test data retrieval with sample stock symbols
5. Set up error handling for API rate limits
**Data Processing Tips:**
- Cache frequently requested data to reduce API calls
- Implement data validation and error handling
- Format financial data for clear presentation
- Consider real-time vs. delayed data requirements
''',
'tips': [
'Start with free API tiers to test functionality',
'Monitor API usage to avoid rate limits',
'Validate all financial data before analysis'
]
}
]
}
]
},
'educational-quiz-bot': {
'id': 6,
'title': 'Educational Quiz Bot',
'slug': 'educational-quiz-bot',
'category': 'Education',
'difficulty': 'intermediate',
'difficulty_color': 'warning',
'estimated_time': 40,
'description': 'Develop an interactive AI tutor that creates quizzes, provides explanations, and adapts to student learning patterns.',
'icon': 'graduation-cap',
'outcomes': [
'Adaptive quiz generation system',
'Personalized learning paths',
'Progress tracking and analytics',
'Interactive educational content'
],
'prerequisites': [
'Completed "Building Your First Chatbot" tutorial',
'Completed "Creating Knowledge Bases with RAG" tutorial',
'Understanding of educational workflows'
],
'overview': '''
<p>Educational technology benefits greatly from AI-powered personalization. In this project, you'll build an educational quiz bot that can:</p>
<ul>
<li>Generate quizzes on various topics and difficulty levels</li>
<li>Provide detailed explanations for answers</li>
<li>Adapt question difficulty based on student performance</li>
<li>Track learning progress and identify knowledge gaps</li>
</ul>
<p>This project demonstrates AI applications in education, showcasing adaptive learning and personalized instruction capabilities.</p>
''',
'sections': [
{
'title': 'Quiz Generation System',
'content': '''
<p>Design an intelligent quiz generation system that creates questions tailored to student learning objectives and performance levels.</p>
''',
'steps': [
{
'title': 'Create Dynamic Quiz Templates',
'content': '''
Develop flexible quiz templates that can generate questions across different subjects, difficulty levels, and question types.
**Question Types to Support:**
- Multiple choice questions
- True/False questions
- Fill-in-the-blank questions
- Short answer questions
- Essay questions (for advanced topics)
**Template Structure:**
```
Generate a {difficulty_level} {question_type} question about {topic}.
Requirements:
- Question should test {learning_objective}
- Include {num_options} answer choices (for multiple choice)
- Provide detailed explanation for correct answer
- Suggest common misconceptions to address
Format:
Question: [Your question here]
A) [Option 1]
B) [Option 2]
C) [Option 3]
D) [Option 4]
Correct Answer: [Letter and explanation]
Common Mistakes: [Address typical errors]
```
**Difficulty Adaptation:**
- Beginner: Basic recall and understanding
- Intermediate: Application and analysis
- Advanced: Synthesis and evaluation
**Learning Objectives:**
- Knowledge retention
- Concept application
- Problem-solving skills
- Critical thinking development
''',
'tips': [
'Include distractors that address common misconceptions',
'Provide detailed explanations for all answer choices',
'Vary question formats to maintain engagement'
]
}
]
}
]
}
}
return projects.get(slug)