Skip to main content

YAAAF (Yet Another Amazing Agentic Framework) - A modular framework for building intelligent agentic applications with Python backend and Next.js frontend

Project description

YAAAF - Yet Another Amazing Agentic Framework

YAAAF is a modular framework for building intelligent agentic applications with both Python backend and Next.js frontend components. The system features an orchestrator pattern with specialized agents for different tasks like SQL queries, web search, visualization, machine learning, and reflection.

๐Ÿš€ Key Features

  • ๐Ÿค– Modular Agent System: Specialized agents for SQL, visualization, web search, ML, RAG, and more
  • ๐ŸŽฏ Orchestrator Pattern: Central coordinator that intelligently routes queries to appropriate agents
  • โšก Real-time Streaming: Live updates through WebSocket-like streaming with structured Note objects
  • ๐Ÿ“Š Artifact Management: Centralized storage for generated content (tables, images, models, etc.)
  • ๐ŸŒ Modern Frontend: React-based UI with real-time chat interface and agent attribution
  • ๐Ÿ”ง Extensible: Easy to add new agents and capabilities with standardized interfaces
  • ๐Ÿท๏ธ Tag-Based Routing: HTML-like tags for intuitive agent selection (<sqlagent>, <visualizationagent>, etc.)

๐Ÿ—๏ธ Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    HTTP/REST     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Frontend       โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  Backend         โ”‚
โ”‚  (Next.js)      โ”‚                  โ”‚  (FastAPI)       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                              โ”‚
                                              โ–ผ
                                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                    โ”‚  Orchestrator    โ”‚
                                    โ”‚  Agent           โ”‚
                                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                              โ”‚
                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ–ผ                     โ–ผ                     โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚  SQL Agent      โ”‚   โ”‚ Visualization   โ”‚   โ”‚ Web Search      โ”‚
              โ”‚                 โ”‚   โ”‚ Agent           โ”‚   โ”‚ Agent           โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ–ผ                     โ–ผ                     โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ Centralized     โ”‚   โ”‚ Artifact        โ”‚   โ”‚ Storage         โ”‚
              โ”‚ Artifact Storageโ”‚   โ”‚ Management      โ”‚   โ”‚ System          โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Installation & Setup

# Clone the repository
git clone <repository-url>
cd agents_framework

# Install Python dependencies
pip install -r requirements.txt

# Install frontend dependencies
cd frontend
pnpm install
cd ..

Running YAAAF

Start the backend server (default port 4000):

python -m yaaaf backend

Start the frontend server (default port 3000):

python -m yaaaf frontend

Or specify custom ports:

python -m yaaaf backend 8080
python -m yaaaf frontend 3001

First Steps

  1. Open your browser to http://localhost:3000
  2. Start chatting with the AI system
  3. Try these example queries:
    • "How many records are in the database?"
    • "Create a visualization of the sales data"
    • "Search for recent AI developments"
    • "Analyze customer demographics and show trends"

๐Ÿค– Available Agents

Agent Purpose Usage Tag Capabilities
OrchestratorAgent Central coordinator <orchestratoragent> Routes queries, manages flow
SqlAgent Database queries <sqlagent> Natural language to SQL, data retrieval
VisualizationAgent Charts & graphs <visualizationagent> Matplotlib visualizations from data
WebSearchAgent Web search <websearchagent> DuckDuckGo search integration
ReflectionAgent Planning & reasoning <reflectionagent> Step-by-step problem breakdown
RAGAgent Document retrieval <ragagent> Retrieval-augmented generation
MleAgent Machine learning <mleagent> sklearn model training & analysis
ReviewerAgent Data analysis <revieweragent> Extract insights from artifacts
ToolAgent External tools <toolagent> MCP (Model Context Protocol) integration

๐Ÿ’ก Example Usage

Simple Query

from yaaaf.components.orchestrator_builder import OrchestratorBuilder
from yaaaf.components.data_types import Messages

orchestrator = OrchestratorBuilder().build()
messages = Messages().add_user_utterance("How many users are in the database?")
response = await orchestrator.query(messages)

Multi-Agent Workflow

# Step 1: Get data
data_query = "Get sales data for the last 12 months"
data_response = await orchestrator.query(Messages().add_user_utterance(data_query))

# Step 2: Visualize
viz_query = f"Create a chart showing trends: {data_response}"
chart_response = await orchestrator.query(Messages().add_user_utterance(viz_query))

Frontend Integration

// Real-time chat with agent attribution
const note = {
  message: "Query results show 1,247 users",
  artefact_id: "table_abc123",
  agent_name: "sqlagent"
}

// Displays as: <sqlagent>Query results show 1,247 users</sqlagent>
//              <Artefact>table_abc123</Artefact>

๐Ÿ› ๏ธ Development

Backend Development

# Run tests
python -m unittest discover tests/

# Code formatting
ruff format .
ruff check .

# Start with debugging
YAAAF_DEBUG=true python -m yaaaf backend

Frontend Development

cd frontend

# Development server
pnpm dev

# Type checking
pnpm typecheck

# Linting & formatting
pnpm lint
pnpm format:write

# Build for production
pnpm build

๐Ÿ“Š Data Flow

  1. User Input: Query submitted through frontend chat interface
  2. Stream Creation: Backend creates conversation stream
  3. Orchestration: OrchestratorAgent analyzes query and routes to appropriate agents
  4. Agent Processing: Specialized agents process their portions of the request
  5. Artifact Generation: Agents create structured artifacts (tables, images, etc.)
  6. Note Creation: Results packaged as Note objects with agent attribution
  7. Real-time Streaming: Notes streamed back to frontend with live updates
  8. UI Rendering: Frontend displays formatted responses with agent identification

๐Ÿ”ง Configuration

Environment Variables

  • YAAAF_CONFIG: Path to configuration JSON file

Configuration File

{
  "client": {
    "model": "qwen2.5:32b",
    "temperature": 0.7,
    "max_tokens": 1024
  },
  "agents": [
    "reflection",
    "visualization",
    "sql",
    "reviewer",
    "websearch",
    "url_reviewer"
  ],
  "sources": [
    {
      "name": "london_archaeological_data",
      "type": "sqlite",
      "path": "../../data/london_archaeological_data.db"
    }
  ]
}

๐Ÿ“š Documentation

Comprehensive documentation is available in the documentation/ folder:

cd documentation
pip install -r requirements.txt
make html
open build/html/index.html

Documentation includes:

  • ๐Ÿ“– Getting Started Guide
  • ๐Ÿ—๏ธ Architecture Overview
  • ๐Ÿค– Agent Development Guide
  • ๐Ÿ”Œ API Reference
  • ๐ŸŒ Frontend Development
  • ๐Ÿ’ป Development Practices
  • ๐Ÿ“‹ Usage Examples

๐Ÿงช Testing

# Backend tests
python -m unittest discover tests/

# Specific agent tests
python -m unittest tests.test_sql_agent
python -m unittest tests.test_orchestrator_agent

# Frontend tests
cd frontend
pnpm test

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Follow code style: Run ruff format . and pnpm format:write
  4. Add tests: Ensure new features have test coverage
  5. Update docs: Add documentation for new features
  6. Submit PR: Create a pull request with clear description

๐Ÿ“‹ Requirements

Backend:

  • Python 3.11+
  • FastAPI
  • Pydantic
  • pandas
  • matplotlib
  • sqlite3

Frontend:

  • Node.js 18+
  • Next.js 14
  • TypeScript
  • Tailwind CSS
  • pnpm

๐Ÿ“„ License

[Add your license information here]

๐Ÿ†˜ Support

  • ๐Ÿ“– Documentation: Check the documentation/ folder
  • ๐Ÿ› Issues: Report bugs via GitHub Issues
  • ๐Ÿ’ฌ Discussions: Join GitHub Discussions for questions

YAAAF - Building the future of agentic applications, one intelligent agent at a time! ๐Ÿš€

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaaaf-0.0.4.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yaaaf-0.0.4-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file yaaaf-0.0.4.tar.gz.

File metadata

  • Download URL: yaaaf-0.0.4.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for yaaaf-0.0.4.tar.gz
Algorithm Hash digest
SHA256 9b312e2a1119dd2f9488df3eeef296f305e59d09392c760cb793acae2bec66f8
MD5 04cecb3f14a5db7cd7d8b0491cddc75e
BLAKE2b-256 dc90bcfde414229bf8da70e16d411900d6c3c784fbbddba5d884c7e8ea1a8a5f

See more details on using hashes here.

File details

Details for the file yaaaf-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: yaaaf-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for yaaaf-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4633d13aef0993221f9cac925e7a2157243e9d59313c9c8d1c0d70eb6e944470
MD5 f7ffd0a7848b7591bf4cf17db9738b47
BLAKE2b-256 7eff4e51fb40418c796de3b7c120a2ca5b4ed565f37df51da83bc788ca1cfb2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page