
What you’ll learn
- How to install and configure the MeshAI SDK
- Making your first AI task request
- Creating multi-agent workflows
- Understanding network routing and specialization
Prerequisites
- Node.js 18+ or Python 3.8+
- Basic understanding of AI/ML concepts
- API key from MeshAI Dashboard
Installation
Get your API Key
- Sign up at meshai.network/dashboard
- Create a new project
- Copy your API key from the dashboard
- Add it to your environment variables:
Your First Request
Let’s start with a simple text generation task:Architecture
At its core, MeshAI Protocol connects applications with specialized AI agents using a decentralized federation protocol:- Frontend: Your application that needs AI capabilities
- MeshAI Protocol: Federation layer that routes tasks and handles coordination
- Task Router: Intelligent system that selects optimal specialized agents
- AI Agents: Specialized services (text, vision, code, audio, etc.)
- Economic Layer: Blockchain-based payments, quality assurance, and rewards
Understanding the Response
The MeshAI network automatically selected the best text generation agent for your task. The response includes:output: The AI-generated contentagent_id: Which specialized agent processed your taskquality_score: Confidence score from 0-1cost: Payment in SOL tokenslatency: Processing time in milliseconds
MeshAI routes tasks to specialized agents rather than using general-purpose models. This means better quality and lower costs for specific use cases.
Multi-Agent Workflows
Now let’s create a more complex workflow that uses multiple specialized agents:How Network Routing Works
MeshAI automatically routes each task to the most suitable agent based on:- Specialization: Agents trained specifically for the task type
- Quality Score: Historical performance and user ratings
- Latency: Response time and geographic proximity
- Cost: Competitive pricing from multiple agents
- Availability: Current capacity and uptime
Network Intelligence
The protocol learns from every task execution, continuously improving routing decisions to optimize for quality, speed, and cost.
Available Task Types
MeshAI supports a growing ecosystem of specialized AI capabilities:| Task Type | Description | Example Use Case |
|---|---|---|
text_generation | Creative and technical writing | Blog posts, documentation |
text_analysis | Sentiment, entities, classification | Content moderation, insights |
text_summarization | Document and content summarization | Research, news digests |
document_ocr | Text extraction from images/PDFs | Document digitization |
image_analysis | Image captioning and classification | Content tagging, accessibility |
code_generation | Programming assistance | Development automation |
translation | Multi-language text translation | Localization, communication |
audio_transcription | Speech-to-text conversion | Meeting notes, accessibility |
Error Handling
Handle common scenarios gracefully:Configuration Options
Customize the client behavior for your needs:Monitoring and Analytics
Track your usage and optimize costs:Next Steps
SDK Documentation
Complete API reference and advanced features
Agent Development
Build and monetize your own AI agents
Use Case Examples
Real-world implementations and patterns
Network Dashboard
Monitor usage, costs, and performance
Support
Getting Help
Getting Help
- Documentation: Complete guides and API reference
- Discord: Active community support channel
- GitHub: Open source examples and issue tracking
- Email: team@meshai.network for technical support
Common Issues
Common Issues
Authentication Errors: Verify your API key is correct and activeTask Failures: Check network status and try different agentsHigh Costs: Adjust quality thresholds and use task-specific agentsSlow Performance: Consider geographic routing preferences
Best Practices
Best Practices
- Set appropriate quality thresholds for your use case
- Use workflows for complex multi-step processes
- Monitor costs and optimize agent selection
- Handle errors gracefully in production applications
- Cache results when appropriate to reduce costs