Skip to content

Latest commit

 

History

History

README.md

TFrameX Examples

Welcome to the TFrameX examples collection! This directory contains comprehensive examples demonstrating various aspects of the TFrameX framework, from basic agent creation to complex multi-agent workflows.

📚 Example Categories

🚀 01. Basic Examples

Perfect for getting started with TFrameX fundamentals.

Example Description Difficulty Key Concepts
Hello World Your first TFrameX agent Beginner Agent creation, basic execution
Simple Agent Agent with tools and memory Beginner Tools, memory, system prompts
Tool Integration Working with external APIs Intermediate Tool creation, async operations

🔄 02. Pattern Examples

Learn TFrameX's powerful orchestration patterns.

Example Description Difficulty Key Concepts
Sequential Pattern Step-by-step agent execution Beginner Sequential flows, data passing
Parallel Pattern Concurrent agent execution Intermediate Parallel processing, result aggregation
Router Pattern Dynamic agent routing Intermediate Conditional logic, intelligent routing
Discussion Pattern Multi-agent collaboration Advanced Agent debates, consensus building

🔌 03. Integration Examples

Explore TFrameX's integration capabilities.

Example Description Difficulty Key Concepts
MCP Integration Model Context Protocol servers Intermediate MCP servers, external tools
Blender Integration 3D modeling with AI Advanced Creative workflows, complex tools
Web Chatbot Flask-based web interface Intermediate Web frameworks, real-time chat

🏗️ 04. Advanced Examples

Production-ready applications demonstrating complex workflows.

Example Description Difficulty Key Concepts
Code Review System AI-powered code analysis Advanced Multi-agent analysis, security scanning
Content Creation Pipeline Multi-modal content generation Advanced Creative workflows, asset coordination
Smart Home Orchestration IoT device coordination Advanced Real-time monitoring, automation
Financial Trading Platform Market analysis and research Expert Data analysis, risk assessment

🌟 05. Real-World Examples

Enterprise-grade applications for specific industries.

Example Description Difficulty Key Concepts
Medical Diagnosis Support Healthcare AI assistant Expert Multi-modal analysis, safety protocols
DevOps Incident Response Automated incident management Expert Monitoring, alerting, coordination
Legal Document Analysis Contract and compliance review Expert Document processing, risk analysis
Game AI Director Dynamic game content generation Expert Real-time adaptation, player analytics

🏃 Quick Start

Prerequisites

  • Python 3.8+
  • TFrameX installed (pip install tframex)
  • LLM API access (OpenAI, local model, etc.)

Running an Example

  1. Navigate to any example directory
  2. Install dependencies: pip install -r requirements.txt
  3. Copy environment template: cp .env.example .env
  4. Configure your LLM settings in .env
  5. Run the example: python main.py

📖 Learning Path

For Beginners:

  1. Start with Hello World
  2. Progress through Basic Examples
  3. Try Sequential Pattern

For Intermediate Users:

  1. Explore all Pattern Examples
  2. Try MCP Integration
  3. Build your own variation

For Advanced Users:

  1. Study Advanced Examples
  2. Implement Real-World Examples
  3. Contribute your own examples!

🛠️ Example Structure

Each example follows a standardized structure:

example-name/
├── README.md                   # Comprehensive guide
├── requirements.txt            # Python dependencies
├── .env.example               # Environment template
├── main.py                    # Primary application
├── config/
│   ├── agents.py             # Agent definitions
│   ├── tools.py              # Tool definitions
│   └── flows.py              # Flow definitions
├── data/                     # Sample data files
├── docs/
│   ├── setup.md              # Setup instructions
│   ├── usage.md              # Usage examples
│   └── troubleshooting.md    # Common issues
└── assets/                   # Screenshots, diagrams

🔧 Configuration

Environment Variables

All examples use these standard environment variables:

# LLM Configuration
OPENAI_API_KEY=your_api_key_here
OPENAI_API_BASE=https://api.openai.com/v1
OPENAI_MODEL_NAME=gpt-3.5-turbo

# Example-specific variables
# (See individual .env.example files)

Local Development

For local development with Ollama:

OPENAI_API_BASE=http://localhost:11434/v1
OPENAI_API_KEY=ollama
OPENAI_MODEL_NAME=llama3

📊 Difficulty Levels

  • 🟢 Beginner: Basic TFrameX concepts, single agents
  • 🟡 Intermediate: Multiple agents, basic patterns, external tools
  • 🟠 Advanced: Complex workflows, real-time processing, integrations
  • 🔴 Expert: Production systems, safety-critical applications, optimization

🤝 Contributing

Found a bug? Want to add an example? Contributions are welcome!

  1. Fork the repository
  2. Create your example following the standard structure
  3. Add comprehensive documentation
  4. Test thoroughly
  5. Submit a pull request

Example Contribution Guidelines

  • Follow the standardized folder structure
  • Include comprehensive README with setup instructions
  • Add requirements.txt with exact versions
  • Include .env.example with all required variables
  • Test on multiple platforms when possible
  • Add appropriate difficulty level

📞 Support

📄 License

All examples are provided under the MIT License. See the main repository LICENSE file for details.


Happy building with TFrameX! 🚀