+
Skip to content

XSpoonAi/spoon-cookbook

Repository files navigation

SpoonAI Cookbook

Welcome to the SpoonAI Cookbook! This collection of Jupyter notebooks provides comprehensive tutorials and examples for building AI agents using the SpoonAI framework.

Overview

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.

Prerequisites

Before running these tutorials, ensure you have:

  1. Python Environment: Python 3.8 or higher
  2. Dependencies: Install required packages:
    pip install spoon-ai jupyter pandas aiohttp pycryptodome ecdsa base58
  3. 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

Tutorials

📚 Tutorial 0: How to Build a Chat Bot

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

🛠️ Tutorial 1: How to Build a Tool Call Agent

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

💰 Tutorial 2: How to Execute Token Transfer 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

🗄️ Tutorial 3: How to Use NeoFS Storage

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

Getting Started

  1. Clone or download this cookbook to your local machine
  2. Install dependencies as listed in the prerequisites
  3. Set up your API keys for the LLM providers you plan to use
  4. Start with Tutorial 0 and work through the notebooks sequentially
  5. Experiment with the code examples and modify them for your use cases

Running the Notebooks

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.

Key Concepts

  • 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

Best Practices

  1. Start Simple: Begin with basic chatbots before moving to complex tool-calling agents
  2. Security First: Never expose private keys or sensitive credentials
  3. Error Handling: Implement proper error handling in your tools and agents
  4. Testing: Test your agents with various inputs and edge cases
  5. Documentation: Document your custom tools and agents clearly

Troubleshooting

  • 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

Contributing

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.

Support

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! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载