Skip to main content

Task oriented AI agent framework for digital workers and vertical AI agents

Project description



unclecode%2Fcrawl4ai | Trendshift Made_with_python

Introduction

Upsonic is a reliability-focused framework designed for real-world applications. It enables trusted agent workflows in your organization through advanced reliability features, including verification layers, triangular architecture, validator agents, and output evaluation systems.

🛠️ Getting Started

Prerequisites

  • Python 3.10 or higher
  • Access to OpenAI or Anthropic API keys (Azure and Bedrock Supported)

Installation

pip install upsonic

Basic Example

Set your OPENAI_API_KEY

export OPENAI_API_KEY=sk-***

Start the agent

from upsonic import Task, Agent

task = Task("Who developed you?")

agent = Agent(name="Coder")

agent.print_do(task)


Why Choose Upsonic?

Upsonic is a next-generation framework that makes agents production-ready by solving three critical challenges:

1- Reliability: While other frameworks require expertise and complex coding for reliability features, Upsonic offers easy-to-activate reliability layers without disrupting functionality.

2- Model Context Protocol (MCP): The MCP allows you to leverage tools with various functionalities developed both officially and by third parties without requiring you to build custom tools from scratch.

3- Integrated Browser Use and Computer Use: Directly use and deploy agents that works on non-API systems.

4- Secure Runtime: Isolated environment to run agents

sdk-server


📊 Reliability Layer

LLM output reliability is critical, particularly for numerical operations and action execution. Upsonic addresses this through a multi-layered reliability system, enabling control agents and verification rounds to ensure output accuracy.

Verifier Agent: Validates outputs, tasks, and formats - detecting inconsistencies, numerical errors, and hallucinations

Editor Agent: Works with verifier feedback to revise and refine outputs until they meet quality standards

Rounds: Implements iterative quality improvement through scored verification cycles

Loops: Ensures accuracy through controlled feedback loops at critical reliability checkpoints

Upsonic is a reliability-focused framework. The results in the table were generated with a small dataset. They show success rates in the transformation of JSON keys. No hard-coded changes were made to the frameworks during testing; only the existing features of each framework were activated and run. GPT-4o was used in the tests.

10 transfers were performed for each section. The numbers show the error count. So if it says 7, it means 7 out of 10 were done incorrectly. The table has been created based on initial results. We are expanding the dataset. The tests will become more reliable after creating a larger test set. Reliability benchmark repo

class ReliabilityLayer:
  prevent_hallucination = 10

agent = Agent(name="Coder", reliability_layer=ReliabilityLayer, model="openai/gpt4o")

Key features:

  • Production-Ready Scalability: Deploy seamlessly on AWS, GCP, or locally using Docker.
  • Task-Centric Design: Focus on practical task execution, with options for:
    • Basic tasks via LLM calls.
    • Advanced tasks with V1 agents.
    • Complex automation using V2 agents with MCP integration.
  • MCP Server Support: Utilize multi-client processing for high-performance tasks.
  • Tool-Calling Server: Exception-secure tool management with robust server API interactions.
  • Computer Use Integration: Execute human-like tasks using Anthropic’s ‘Computer Use’ capabilities.
  • Easily adding tools: You can add your custom tools and MCP tools with a single line of code.

📙 Documentation

You can access our documentation at docs.upsonic.ai All concepts and examples are available there.


Tool Integration via MCP

Upsonic officially supports Model Context Protocol (MCP) and custom tools. You can use hundreds of MCP servers at glama or mcprun We also support Python functions inside a class as a tool. You can easily generate your integrations with that.

from upsonic import Agent, Task
from pydantic import BaseModel

# Define Fetch MCP configuration
class FetchMCP:
    command = "uvx"
    args = ["mcp-server-fetch"]

# Create response format for web content
class WebContent(BaseModel):
    title: str
    content: str
    summary: str
    word_count: int

# Initialize agent
web_agent = Agent(
    name="Web Content Analyzer",
    model="openai/gpt-4o",  # You can use other models
)

# Create a task to analyze a web page
task = Task(
    description="Fetch and analyze the content from url. Extract the main content, title, and create a brief summary.",
    context=["https://upsonic.ai"],
    tools=[FetchMCP],
    response_format=WebContent
)
    
# Usage
result = web_agent.print_do(task)
print(result.title)
print(result.summary)

Direct LLM Call

Direct LLM calls offer faster, cheaper solutions for simple tasks. In Upsonic, you can make calls to model providers without any abstraction level and organize structured outputs. You can also use tools with LLM calls.

from upsonic import Task, Direct

direct = Direct(model="openai/gpt-4o")

task = Task("Where can I use agents in real life?")

direct.print_do(task)

Cookbook

You can check out many examples showing how to build agents using MCP tools and browser use with Upsonic.


Telemetry

We use anonymous telemetry to collect usage data. We do this to focus our developments on more accurate points. You can disable it by setting the UPSONIC_TELEMETRY environment variable to false.

import os
os.environ["UPSONIC_TELEMETRY"] = "False"


Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

upsonic-0.60.0a1754435135.tar.gz (254.7 kB view details)

Uploaded Source

Built Distribution

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

upsonic-0.60.0a1754435135-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

Details for the file upsonic-0.60.0a1754435135.tar.gz.

File metadata

  • Download URL: upsonic-0.60.0a1754435135.tar.gz
  • Upload date:
  • Size: 254.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.5

File hashes

Hashes for upsonic-0.60.0a1754435135.tar.gz
Algorithm Hash digest
SHA256 f641a5535549ff07eeff2b81acb3c2ba827b93b0bbbe383184635862b81eba88
MD5 3971d665cfb490e51ccda193b99d60ce
BLAKE2b-256 1501120b041967699a428f8fa7856fbe496db2015f1f96f995760fcefaf62b7f

See more details on using hashes here.

File details

Details for the file upsonic-0.60.0a1754435135-py3-none-any.whl.

File metadata

File hashes

Hashes for upsonic-0.60.0a1754435135-py3-none-any.whl
Algorithm Hash digest
SHA256 96b1856009939f9728925fe2a9753c76f9eeed4d260677bc161da8375e9c1d63
MD5 4f9eedbd439f1b203c66c6768d653cca
BLAKE2b-256 6345d04997b067a3382655d5b85f6e5afb42526177b4b6588055950cfa72666b

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