Skip to main content

Production AI Agent Framework - NVIDIA Nemotron, Voice, Canvas, Browser Sandbox, Multi-Channel Support

Project description

SmithAI

Production-ready Python AI Agent Framework with Crew-style Multi-Agent Orchestration

Built with NVIDIA Nemotron, OpenAI, Anthropic Claude, Google Gemini, and more.

Features

  • Multi-LLM Support - Seamlessly switch between NVIDIA, OpenAI, Anthropic, Google, Ollama
  • CrewAI-Style Agents - Define agents with roles, goals, and backstories
  • Task Orchestration - Sequential, parallel, and hierarchical execution
  • Tool System - Calculator, web search, Python REPL, file operations
  • Persistent Memory - MEMORY.md-style storage across sessions
  • Async-First - Built on asyncio for high performance
  • Production Ready - Type-safe, well-documented, stable

Quick Start

Installation

pip install smith-ai

Environment Variables

# Choose your LLM provider
export NVIDIA_API_KEY=your_nvidia_key      # Recommended
export OPENAI_API_KEY=your_openai_key
export ANTHROPIC_API_KEY=your_anthropic_key
export GOOGLE_API_KEY=your_google_key

# Optional
export DEFAULT_LLM_PROVIDER=nvidia
export DEFAULT_MODEL=nvidia/nemotron-3-super-120b-a12b

Basic Agent

import asyncio
from smith_ai import create_agent

async def main():
    agent = await create_agent(
        name="assistant",
        role="AI Assistant",
        goal="Help users with their questions",
        backstory="You are a helpful AI assistant powered by NVIDIA Nemotron",
        provider="nvidia",
    )
    
    result = await agent.execute("What is machine learning?")
    print(result)

asyncio.run(main())

Multi-Agent Crew

import asyncio
from smith_ai import create_agent, create_crew, Task

async def main():
    # Create agents
    researcher = await create_agent(
        name="researcher",
        role="Researcher",
        goal="Research topics thoroughly",
        backstory="Expert researcher with decades of experience"
    )
    
    writer = await create_agent(
        name="writer",
        role="Content Writer",
        goal="Create engaging content",
        backstory="Skilled writer who transforms complex info into clear narratives"
    )
    
    # Create crew with tasks
    crew = create_crew(
        agents_config=[
            {"name": "researcher", "role": "Researcher", 
             "goal": "Research topics", "backstory": researcher.backstory},
            {"name": "writer", "role": "Writer",
             "goal": "Write content", "backstory": writer.backstory},
        ],
        tasks_config=[
            {"description": "Research AI trends 2025", "agent": "researcher",
             "expected_output": "Comprehensive research summary"},
            {"description": "Write article based on research", "agent": "writer",
             "expected_output": "Published article"},
        ],
        process="sequential",
        verbose=True,
    )
    
    # Execute
    results = await crew.kickoff()
    print(results)

asyncio.run(main())

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        SmithAI                               │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐ │
│  │    Crew     │  │   Agent     │  │       Task          │ │
│  │ Orchestrate │  │   Execute   │  │    Work Unit        │ │
│  └──────┬──────┘  └──────┬──────┘  └──────────┬──────────┘ │
│         │                │                    │             │
│         ▼                ▼                    ▼             │
│  ┌─────────────────────────────────────────────────────┐    │
│  │                   LLM Layer                         │    │
│  │  NVIDIA │ OpenAI │ Anthropic │ Google │ Ollama       │    │
│  └─────────────────────────────────────────────────────┘    │
│         │                │                    │             │
│         ▼                ▼                    ▼             │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐ │
│  │   Tools     │  │   Memory     │  │     Config          │ │
│  │ Calculator  │  │  Persistent  │  │  Environment       │ │
│  │  WebSearch  │  │  Storage     │  │  Variables         │ │
│  │  Python     │  │              │  │                    │ │
│  └─────────────┘  └─────────────┘  └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

Core Components

Agent

Autonomous unit with role, goal, and backstory:

from smith_ai import Agent, AgentConfig, LLMFactory, LLMProvider

agent = Agent(AgentConfig(
    name="my_agent",
    role="Researcher",
    goal="Find information quickly",
    backstory="You are a research expert",
    llm=LLMFactory.create(LLMProvider.NVIDIA, api_key="..."),
))

Crew

Orchestrates multiple agents with task management:

from smith_ai import Crew

crew = Crew(
    agents=[agent1, agent2],
    tasks=[task1, task2, task3],
    process=Crew.Process.SEQUENTIAL,  # or PARALLEL, HIERARCHICAL
    verbose=True,
)

results = await crew.kickoff()

Task

Work unit assigned to an agent:

from smith_ai import Task

task = Task(
    description="Research the topic",
    agent=researcher,
    expected_output="Summary of key findings",
    context=[previous_task],  # Pass context from other tasks
)

LLM Providers

from smith_ai import LLMFactory, LLMProvider

# NVIDIA Nemotron (recommended)
llm = LLMFactory.create(LLMProvider.NVIDIA, 
    api_key="...", 
    model="nvidia/nemotron-3-super-120b-a12b")

# OpenAI GPT
llm = LLMFactory.create(LLMProvider.OPENAI,
    api_key="...",
    model="gpt-4o")

# Anthropic Claude
llm = LLMFactory.create(LLMProvider.ANTHROPIC,
    api_key="...",
    model="claude-3-5-sonnet-20241022")

# Google Gemini
llm = LLMFactory.create(LLMProvider.GOOGLE,
    api_key="...",
    model="gemini-2.0-flash-exp")

# Ollama (local)
llm = LLMFactory.create(LLMProvider.OLLAMA,
    model="llama3.2",
    base_url="http://localhost:11434")

Tools

from smith_ai import (
    CalculatorTool,
    WebSearchTool,
    PythonREPLTool,
    FileReadTool,
    FileWriteTool,
    WebFetchTool,
    get_default_tools,
)

# All default tools
tools = get_default_tools()

# Specific tools
tools = [
    CalculatorTool(),
    WebSearchTool(),
    PythonREPLTool(),
]

Examples

Run the examples:

# Test all LLM providers
python examples/04_test_llms.py

# Basic agent
python examples/01_basic_agent.py

# Multi-agent crew
python examples/02_crew_pipeline.py

# Parallel execution
python examples/03_parallel_tasks.py

Configuration

Environment Variables

Variable Description Default
NVIDIA_API_KEY NVIDIA NGC API key Required for NVIDIA
OPENAI_API_KEY OpenAI API key Required for OpenAI
ANTHROPIC_API_KEY Anthropic API key Required for Anthropic
GOOGLE_API_KEY Google AI API key Required for Google
DEFAULT_LLM_PROVIDER Default provider nvidia
DEFAULT_MODEL Default model nvidia/nemotron-3-super-120b-a12b

Python API

from smith_ai import Config, get_config

config = Config(
    nvidia_api_key="your-key",
    default_provider="nvidia",
    verbose=True,
)

Supported Models

NVIDIA NIM

  • nemotron-3-super-120b-a12b
  • nemotron-3-ultra-405b
  • llama-3.1-405b-instruct
  • mixtral-8x7b-instruct

OpenAI

  • gpt-4o
  • gpt-4o-mini
  • gpt-4-turbo
  • o1-preview
  • o1-mini

Anthropic

  • claude-3-5-sonnet-20241022
  • claude-3-opus-20240229
  • claude-3-haiku-20240307

Google

  • gemini-2.0-flash-exp
  • gemini-1.5-pro
  • gemini-1.5-flash

License

MIT License - Himan D himanshu@open.ai

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

smith_ai-1.2.1.tar.gz (87.7 kB view details)

Uploaded Source

Built Distribution

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

smith_ai-1.2.1-py3-none-any.whl (109.8 kB view details)

Uploaded Python 3

File details

Details for the file smith_ai-1.2.1.tar.gz.

File metadata

  • Download URL: smith_ai-1.2.1.tar.gz
  • Upload date:
  • Size: 87.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for smith_ai-1.2.1.tar.gz
Algorithm Hash digest
SHA256 03f4600662ebc8dfb93064cc1295b9953fcb27d4f5ca6e55129d8b1c7a18eaeb
MD5 5a57b7095aac848d508727ffe3066855
BLAKE2b-256 30a2ecc0674bde913f2c1f9e18a4f25f31f52a72c4c1cf06b3748311750818d4

See more details on using hashes here.

File details

Details for the file smith_ai-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: smith_ai-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 109.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for smith_ai-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd96ebedb1b959c3b8c536b327a177227138682500ba09324d6b8f8b110cb33c
MD5 70d70a2dcdd1514218b0c1dfe186ae75
BLAKE2b-256 ddca6cdbdd9fcf8d78ede7bfc72b64d2d30f9af9de57ac85b1c9413dca8721a7

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