Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@falai/agent Documentation

Welcome to the @falai/agent documentation! This comprehensive framework enables you to build sophisticated, type-safe conversational AI agents with AI-powered routing, schema-driven data extraction, and declarative conversation flows.

✨ What Makes @falai/agent Unique

  • 🤖 AI-Powered Routing: Intelligent route and step selection based on conversation context and user intent
  • 🎯 Schema-First Data Collection: Type-safe, structured data extraction from natural conversations
  • 🔀 Route DSL: Fluent, composable API for building complex multi-step conversation flows
  • 🏗️ Type-Safe Context: Generic context management with lifecycle hooks and dynamic providers
  • 🔄 Streaming & Tools: Real-time streaming responses with dynamic tool execution using unified Tool interface
  • 💾 Comprehensive Persistence: Database-agnostic session and message storage across multiple adapters
  • 🛠️ Unified Tool System: Simplified tool creation with flexible return types and powerful pattern helpers

📖 Documentation Structure

🚀 Getting Started

🏗️ Core Framework

Agent Architecture

AI Routing System

Conversation Flows

  • Routes - Route definition, lifecycle & completion
  • Steps - Step configuration, data collection & validation
  • Data Collection - Agent-level schema-driven data extraction

AI Integration

Tools & Execution

Persistence

Error Handling

🚀 Advanced Guides

🎯 Quick Links

By Learning Path

🚀 First time here? → Start with Quick Start Guide

🏗️ Understanding the design? → Read Agent Overview then Intelligent Routing

🤖 Building AI-powered conversations? → See Route DSL, Intelligent Routing, and Step Transitions

🎯 Collecting structured data? → Learn Agent-Level Data Collection and Schema-Driven Extraction

🔧 Working with tools? → See Tool Definition and Tool Scoping

💾 Need persistence? → See Session Storage and Database Adapters

🚀 Going to production? → Check Advanced Patterns and Server Session Management

By Topic

💡 Examples by Domain

Check out the examples/ directory for complete, runnable examples organized by architectural domain:

🏗️ Core Concepts

🤖 AI Routing System

💬 Conversation Flows

🤖 AI Providers

🔧 Tools & Execution

💾 Persistence

🚀 Advanced Patterns

🔗 Integrations

🤝 Contributing

We welcome contributions to improve the documentation and examples! Here's how you can help:

Ways to Contribute

  • 📝 Improve Documentation - Fix typos, clarify explanations, add examples
  • 🎯 Create Examples - Add examples for new use cases or domains
  • 🔧 Update Code Samples - Ensure examples work with latest framework versions
  • 📚 Write Guides - Create tutorials for specific patterns or integrations
  • 🐛 Report Issues - Found a bug in docs or examples? Let us know!

Getting Started

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/your-username/agent.git
  3. Install dependencies: bun install
  4. Make changes in the appropriate domain directory
  5. Test examples by running them: bun run examples/your-example.ts
  6. Submit a pull request

Documentation Structure

When adding new content, follow the domain-focused organization:

docs/
├── core/                    # Core framework docs
│   ├── agent/              # Agent architecture & lifecycle
│   ├── routing/            # AI routing system & intelligent selection
│   ├── conversation-flows/ # Route DSL, steps, data collection
│   ├── ai-integration/     # Providers, prompts, response processing
│   ├── tools/              # Tool definition, execution, scoping
│   └── persistence/        # Session storage & database adapters
└── guides/                 # End-to-end guides
    └── [guide-name]/       # getting-started, building-agents, etc.

examples/
├── core-concepts/          # Basic agent setup & fundamental concepts
├── ai-providers/           # AI provider integrations
├── conversation-flows/     # AI routing & conversation patterns
├── persistence/            # Session storage implementations
├── tools/                  # Tool creation & execution patterns
├── advanced-patterns/      # Complex use cases & integrations
└── integrations/           # External service integrations

Example Contribution Workflow

  1. Identify the domain your example belongs to (e.g., tools, persistence)
  2. Create the example in the appropriate domain directory
  3. Add comprehensive comments explaining the concepts
  4. Include error handling and best practices
  5. Update documentation links if needed
  6. Test thoroughly before submitting

Need Help?


Made with ❤️ for the community