Welcome to the SpoonAI Cookbook! This collection of Jupyter notebooks provides comprehensive tutorials and examples for building AI agents using the SpoonAI framework.
The SpoonAI Cookbook contains step-by-step tutorials that guide you through different aspects of building intelligent agents, from basic chatbots to advanced tool-calling agents and blockchain integrations.
Before running these tutorials, ensure you have:
- Python Environment: Python 3.8 or higher
- Dependencies: Install required packages:
pip install spoon-ai jupyter pandas aiohttp pycryptodome ecdsa base58
- API Keys: Set up your LLM provider API keys:
export ANTHROPIC_API_KEY=your_anthropic_api_key # or export OPENAI_API_KEY=your_openai_api_key
File: 0_how_to_build_a_chat_bot.ipynb
Learn the fundamentals of creating conversational AI agents with SpoonAI:
- Setting up the ChatBot class
- Managing conversation memory
- Handling different LLM providers (Anthropic, OpenAI)
- Building context-aware conversations
What you'll learn:
- Basic SpoonAI ChatBot initialization
- Message handling and memory management
- System prompts and conversation flow
- Working with different AI models
File: 1_how_to_build_a_tool_call_agent.ipynb
Dive deep into creating agents that can use external tools and APIs:
- Understanding the BaseTool architecture
- Creating custom tools (file system, API requests, databases)
- Building specialized agents with tool capabilities
- Data analysis and processing workflows
What you'll learn:
- Tool creation patterns and best practices
- File system operations and data analysis
- API integration and database interactions
- Building a complete data analyst agent
File: 2_how_to_execute_token_transfer_agent.ipynb
Build blockchain-aware agents for cryptocurrency operations:
- Creating agents for token transfers
- Blockchain integration patterns
- Security considerations for financial operations
- Transaction signing and verification
What you'll learn:
- Blockchain agent architecture
- Token transfer workflows
- Private key management and security
- ReAct pattern implementation
File: 3_how_to_use_neofs_storage.ipynb
Integrate decentralized storage solutions with your AI agents:
- Understanding NeoFS decentralized storage
- Container management and file operations
- Cryptographic operations and signatures
- Building storage-aware applications
What you'll learn:
- Decentralized storage concepts
- NeoFS API integration
- File upload/download workflows
- Authentication and access control
- Clone or download this cookbook to your local machine
- Install dependencies as listed in the prerequisites
- Set up your API keys for the LLM providers you plan to use
- Start with Tutorial 0 and work through the notebooks sequentially
- Experiment with the code examples and modify them for your use cases
Each notebook is self-contained and can be run independently, but we recommend following the sequence for the best learning experience:
# Start Jupyter
jupyter notebook
# Or use JupyterLab
jupyter lab
Navigate to the desired notebook and run the cells step by step.
- Agents: AI entities that can reason and take actions
- Tools: External capabilities that agents can use
- Memory: Conversation and context management
- Providers: Different LLM backends (Anthropic, OpenAI)
- Workflows: Multi-step agent processes
- Start Simple: Begin with basic chatbots before moving to complex tool-calling agents
- Security First: Never expose private keys or sensitive credentials
- Error Handling: Implement proper error handling in your tools and agents
- Testing: Test your agents with various inputs and edge cases
- Documentation: Document your custom tools and agents clearly
- API Key Issues: Ensure your API keys are correctly set as environment variables
- Import Errors: Verify all dependencies are installed in your Python environment
- Network Issues: Check your internet connection for API calls and blockchain operations
- Permission Errors: Ensure proper file permissions for file system operations
Found an issue or want to improve a tutorial? Contributions are welcome! Please ensure your changes maintain the educational focus and clarity of the examples.
For questions about SpoonAI or these tutorials:
- Check the main SpoonAI documentation
- Review the example implementations in the tutorials
- Experiment with the provided code examples
Happy building with SpoonAI! 🚀