█

AI/TLDR

Buy me a coffee
Buy me a coffee

Upsonic

Build autonomous and traditional AI agents in Python

Agent Frameworks & BuildersOpen source
Language
Python
License
MIT
$uv pip install upsonic
IN SHORT

What is Upsonic?

Upsonic is an open-source Python framework for building AI agents. It supports both autonomous agents, which run multi-step tasks on their own, and more traditional agents that you drive task by task. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Python and licensed MIT.

Overview

Upsonic is an open-source Python framework for building AI agents. It supports both autonomous agents, which run multi-step tasks on their own, and more traditional agents that you drive task by task. You describe what you want as a Task and hand it to an Agent, which calls a language model and any tools you give it.

It is aimed at Python developers who want to wire agents into real workflows without building the orchestration plumbing themselves. Autonomous agents restrict file and shell operations to a defined workspace, blocking path traversal and dangerous commands, which makes them safer to point at log analysis or other system tasks.

As a general agent framework, Upsonic covers the common building blocks: model selection, custom tools, MCP integration, prebuilt community agents, and an optional OCR pipeline for pulling text out of PDFs and images.

What it does

  • Two agent styles: AutonomousAgent for self-directed multi-step tasks and Agent for step-by-step traditional workflows
  • Custom tools defined with a simple @tool decorator on typed Python functions
  • Sandboxed workspaces for autonomous agents that block path traversal and dangerous shell commands
  • Prebuilt, community-contributed autonomous agents that run from install in seconds
  • MCP tools integration to connect agents to external data sources and services
  • Optional OCR pipeline with multiple engines (EasyOCR, RapidOCR, Tesseract, PaddleOCR, DeepSeek OCR)

Getting started

Install Upsonic, then run either an autonomous or a traditional agent against a task.

Install Upsonic

Install the package with uv (or pip).

bashbash
uv pip install upsonic
# pip install upsonic

Run a traditional agent

Create an Agent with a model, wrap your instruction in a Task, and call print_do.

pythonpython
from upsonic import Agent, Task

agent = Agent(model="anthropic/claude-sonnet-4-5", name="Stock Analyst Agent")

task = Task(description="Analyze the current market trends")

agent.print_do(task)

Add a custom tool

Decorate a typed function with @tool and pass it to a Task via the tools argument.

pythonpython
from upsonic import Agent, Task
from upsonic.tools import tool

@tool
def sum_tool(a: float, b: float) -> float:
    """
    Add two numbers together.

    Args:
        a: First number
        b: Second number

    Returns:
        The sum of a and b
    """
    return a + b

task = Task(
    description="Calculate 15 + 27",
    tools=[sum_tool]
)

agent = Agent(model="anthropic/claude-sonnet-4-5", name="Calculator Agent")

result = agent.print_do(task)

Run an autonomous agent

Give an AutonomousAgent a model and a workspace; file and shell operations stay restricted to that workspace.

pythonpython
from upsonic import AutonomousAgent, Task

agent = AutonomousAgent(
    model="anthropic/claude-sonnet-4-5",
    workspace="/path/to/logs"
)

task = Task("Analyze server logs and detect anomaly patterns")

agent.print_do(task)

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Run an autonomous agent over a workspace to analyze server logs and surface anomaly patterns
  • Build a task-driven agent that calls your own Python functions as tools
  • Extract text from scanned PDFs and images using the optional OCR pipeline
  • Connect agents to external services and data sources through MCP tools

How Upsonic compares

Upsonic alongside other open-source agent frameworks & builders tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
DeepSeek Harness★ 289kDeepSeek AI's open-source agent harness (dsh), built on Cordis, where models, tools, skills, sessions, sandboxes, storage and the UI are all plugins composed through profiles.
AutoGPT★ 188kOne of the earliest autonomous agent projects, now a platform for building and running agents from reusable blocks and workflows.
DeerFlow★ 86kByteDance's open-source super agent harness built on LangGraph: skills, sub-agents, sandboxes, a filesystem and long-term memory for long-horizon research, coding and content tasks.
nanobot★ 50.5kLightweight self-hosted personal AI agent framework in Python, with a WebUI, terminal and chat-app channels, tools, long-term memory, MCP and scheduled automations.
LangGraph★ 45.6kA library from the LangChain team for building stateful, graph-based agent workflows with explicit control over steps, memory, and human-in-the-loop checkpoints.
Agno★ 43.3kA fast Python framework (formerly Phidata) for building agents with memory, tools, and multimodal inputs, plus a runtime for deploying them in production.
AgentGPT★ 36.3kAgentGPT lets you name a custom AI, give it a goal, and watch it plan tasks, run them, and learn from the results, all from a web browser.
Upsonic★ 8kBuild autonomous and traditional AI agents in Python