Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MoFA Tutorial: From Zero to Agent Builder

Notice: This tutorial was primarily generated by Claude Code and is pending review by MoFA architect @lijingrs. Content may be updated as the review progresses.

Welcome to the MoFA (Modular Framework for Agents) tutorial! This guide is designed for Google Summer of Code students and anyone who wants to learn how to build AI agents with Rust using MoFA’s microkernel architecture.

What You’ll Learn

By the end of this tutorial, you’ll understand MoFA’s architecture and be able to build, extend, and orchestrate AI agents confidently.

ChapterTitleTimeWhat You’ll Build
01Introduction~20 minMental model of MoFA’s architecture
02Setup~15 minWorking dev environment
03Your First Agent~45 minA GreetingAgent from scratch
04LLM-Powered Agent~45 minA streaming chatbot with memory
05Tools & Function Calling~60 minAgent with calculator & weather tools
06Multi-Agent Coordination~45 minChain & parallel agent pipelines
07Workflows with StateGraph~60 minCustomer support workflow
08Plugins & Scripting~45 minHot-reloadable Rhai content filter
09What’s Next~15 minYour contribution roadmap

Total estimated time: 4-6 hours

Prerequisites

  • Rust (1.85+): Install via rustup
  • An LLM provider (one of):
    • OpenAI API key (OPENAI_API_KEY), or
    • Ollama running locally (free, no API key needed)
  • Git: For cloning the repository
  • Basic familiarity with a terminal

New to Rust? Don’t worry. Each chapter includes “Rust tip” sidebars that explain key language concepts (traits, async/await, Arc) as they come up. You don’t need to be a Rust expert to follow along.

How to Use This Tutorial

  1. Follow the chapters in order - each builds on the previous one
  2. Type the code yourself - don’t just copy-paste (you’ll learn more)
  3. Run every example - seeing output builds intuition
  4. Read the “Architecture note” callouts - they connect code to design decisions
  5. Check the linked source files - real code is the best documentation

Ready? Let’s start with Chapter 1: Introduction.


English | 简体中文