Skip to main content

Smart AI agent with reasoning and tool use capabilities

Project description

Smart Agent

A powerful AI agent chatbot that leverages external tools through the Model Context Protocol (MCP) to extend its capabilities beyond traditional language models.

Quick Start

# Install Smart Agent
pip install smart-agent

# For web interface (Chainlit), install with web extras
pip install smart-agent[web]

# Initialize configuration
smart-agent init

# Start the CLI chat interface (connects to remote tools by default)
smart-agent chat

# OR start the web interface
smart-agent chainlit

# If you need to run your own tools locally:
smart-agent start  # Start the server components

Understanding Smart Agent

Smart Agent operates in two primary modes:

1. Client Mode

Client mode provides chat interfaces that connect to MCP servers (either local or remote).

  • What it does: Provides CLI or web interfaces to interact with the agent
  • When to use: When you want to chat with the agent using available tools
# CLI interface
smart-agent chat

# Web interface (Chainlit)
smart-agent chainlit

2. Server Mode

Server mode manages MCP (Model Context Protocol) servers that provide tools and capabilities to the agent.

  • What it does: Launches and manages tool servers that expose capabilities through standardized endpoints
  • When to use: When you need to run tools locally or host tools for remote clients
# Start all server components (tools and LLM proxy)
smart-agent start

# Check status of running services
smart-agent status

# Stop all services
smart-agent stop

Connection Types

Smart Agent supports two primary connection types between clients and servers:

Local Connection (stdio)

  • How it works: Direct communication through standard input/output
  • When to use: For tools running locally on the same machine
  • Configuration: Use transport: stdio in your config

Remote Connection (SSE)

  • How it works: Communication via Server-Sent Events over HTTP/HTTPS
  • When to use: For connecting to tools running on remote machines
  • Configuration: Use transport: sse in your config

Transport Conversion

Smart Agent provides conversion mechanisms between transport types:

  • stdio_to_sse: Converts local stdio tools to SSE endpoints

    • Useful for exposing local tools as network services
    • Example: transport: stdio_to_sse in config
  • sse_to_stdio: Converts remote SSE endpoints to local stdio

    • Useful for using remote tools as if they were local
    • Example: transport: sse_to_stdio in config

Configuration Example

# config.yaml
llm:
  base_url: "http://localhost:4000"
  model: "claude-3-7-sonnet-20240229"
  api_key: "api_key"
  temperature: 0.0

tools:
  # Local tool with stdio_to_sse conversion
  mcp_think_tool:
    enabled: true
    url: "http://localhost:8000/sse"
    command: "uvx mcp-think --sse --host 0.0.0.0"
    transport: stdio_to_sse

  # Remote tool
  remote_tool:
    enabled: true
    url: "https://api.remote-tool.com/sse"
    transport: sse

Common Usage Patterns

Using Remote Tools (Simplest)

# Initialize configuration
smart-agent init

# Edit config.yaml to use remote URLs
# Example: url: "https://api.remote-tool.com/sse"

# Start client interface - will automatically connect to remote tools
smart-agent chat  # or chainlit

Local Development (Running Your Own Tools)

# Initialize configuration
smart-agent init

# Start server components
smart-agent start

# Start client interface
smart-agent chat  # or chainlit

Prerequisites

  • Python 3.9+
  • Node.js and npm (for running tools via supergateway)
  • Docker (optional, for container-based tools)
  • API keys for language models

Installation

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install from PyPI
pip install smart-agent

# For web interface (Chainlit)
pip install smart-agent[web]

# For monitoring features
pip install smart-agent[monitoring]

For more detailed information, see the documentation.

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

smart_agent-0.8.1.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

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

smart_agent-0.8.1-py3-none-any.whl (42.7 kB view details)

Uploaded Python 3

File details

Details for the file smart_agent-0.8.1.tar.gz.

File metadata

  • Download URL: smart_agent-0.8.1.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for smart_agent-0.8.1.tar.gz
Algorithm Hash digest
SHA256 b81b56df86d6cc9e7fb46c8e457c0714e1ab62c098d2c673460ce586ccf592df
MD5 212b091629d38205e65dd271167930fb
BLAKE2b-256 111dd3f7c3e5c97b0b5ef8f1f4df1199dfb5d25394dfd4964f7be569088b7ee7

See more details on using hashes here.

File details

Details for the file smart_agent-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: smart_agent-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 42.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for smart_agent-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b02cdca26259355de35b15b3e347d64e0e415ab1fa013be425c7cf7ee8322572
MD5 dde0a5e0be8ac1036ccc3ac2fb4ccc60
BLAKE2b-256 567a43f2ea8dd03396076c7e6942e87ffcc51d5c471cd0fe2f9fe4dcf1f19293

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