Python Integration

AI Integration for Python

Add NeoAI and Amy AI to your FastAPI, Django, or Flask application. Async-native SDK with Pydantic models, streaming, and Jupyter notebook support.

Terminal
$ pip install eforge-neoai

from eforge_neoai import NeoAI

neoai = NeoAI(api_key=os.environ["NEOAI_KEY"])

reply = await neoai.agent("support")
  .message("Book a table for 4")
  .tools(["crm", "calendar"])
  .send()
Products

How NeoAI & Amy AI Integrate with Python

Pythonic packages with async/await, type hints, and dataclass models everywhere.

N

NeoAI — AI Agents

Integrate AI agents that call your FastAPI endpoints, Django views, ORM queries, and external APIs. NeoAI uses async/await natively and integrates with any ASGI or WSGI Python web framework.

✓ Async-native Python SDK (asyncio) ✓ Pydantic model validation ✓ FastAPI dependency injection integration ✓ Django middleware and management commands ✓ Flask blueprint registration
A

Amy AI — Business Intelligence

Connect Amy AI to your SQLAlchemy, Django ORM, or Tortoise models. Ask questions in natural language and receive analytics, charts, and dashboards generated from your data.

✓ SQLAlchemy / Django ORM / Tortoise integration ✓ Natural language to SQL translation ✓ Pandas DataFrame output support ✓ Jupyter notebook widget for exploration ✓ Multi-database support (Postgres, MySQL, SQLite)
Methods

Integration Methods for Python

Multiple approaches to fit your Python project architecture.

pip Package

Install via pip install eforge-neoai. Pure Python with minimal dependencies, type stubs included, and PEP 561 compliant.

REST API

Call Eforge AI via httpx or requests from any Python service. Async httpx client with streaming and retry support.

MCP Server

Register your Python services as MCP tools so AI agents can discover and invoke them dynamically at runtime.

Code

Examples

Real code examples for integrating Eforge AI into your Python application.

FastAPI Endpoint

routers/chat.py
from fastapi import APIRouter
from eforge_neoai import NeoAI

router = APIRouter()
neoai = NeoAI(api_key="...")

@router.post("/api/chat")
async def chat(msg: ChatRequest):
  reply = await neoai.agent("support") \
    .message(msg.message) \
    .tools(["crm", "db"]) \
    .send()
  return reply

Django Middleware

settings.py
MIDDLEWARE = [
  "eforge_neoai.django.AgentMiddleware",
  # ... middleware esistenti
]

NEOAI_CONFIG = {
  "api_key": env("NEOAI_KEY"),
  "agents": ["support", "sales"],
  "tools": ["crm", "db"],
}

# Comando di gestione:
# python manage.py neoai_chat
Compatibility

Works with your version of Python

Eforge AI packages support Python 3.8+ and all major Python ecosystem web frameworks.

Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13+
FastAPI 0.100+
Django 3.2, 4.x, 5.x
Flask 2.x e 3.x
SQLAlchemy 1.4+ and 2.x
Jupyter Lab / Notebook support
📦
pip install eforge-neoai
Set environment variables
🔑
Configure API key
AI is ready in your app

Add AI to your Python app today

Tell us about your Python project. We'll recommend the best integration path for FastAPI, Django, or Flask.

Start a project See all integrations