MCP HubMCP Hub
Upsonic

Upsonic

by: Upsonic

The most reliable AI agent framework that supports MCP.

7323created 26/05/2024
Visit
AI
framework

📌Overview

Purpose: Upsonic aims to provide a reliable framework for building and deploying trusted agent workflows in real-world applications.

Overview: Upsonic is a next-generation, reliability-focused framework designed to make agents production-ready by addressing key challenges in reliability, tool integration, and execution flexibility. It enhances agent workflows with advanced features that simplify the development process and ensure high-quality outcomes.

Key Features:

  • Production-Ready Scalability: Easily deploy agents on cloud platforms like AWS and GCP or locally with Docker, ensuring robust scalability.

  • Task-Centric Design: Focuses on practical task execution with multiple levels of complexity, ranging from basic LLM tasks to advanced automation using integrated tools.

  • Model Context Protocol (MCP) Integration: Simplifies the use of third-party tools and custom tools without extensive coding, enhancing functionality across applications.

  • Multi-Agent Support: Facilitates effective task distribution and collaborative problem-solving through automated task management.

  • Reliability Layers: Implements a multi-layered approach to ensure output accuracy, including verifier and editor agents that enhance the quality of outputs through iterative feedback and control.

  • Direct LLM Calls: Enables quick and economical execution of simple tasks without overhead, maintaining structured output organization.


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.

Why Choose Upsonic?

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

  1. Reliability: Provides easy-to-activate reliability layers without disrupting functionality.
  2. Model Context Protocol (MCP): Leverage tools with various functionalities developed both officially and by third parties without building custom tools from scratch.
  3. Integrated Browser Use and Computer Use: Deploy agents that work on non-API systems.
  4. Secure Runtime: Runs agents in an isolated environment.

📊 Reliability Layer

LLM output reliability is critical, especially 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: Revises and refines outputs based on verifier feedback until quality standards are met.
  • Rounds: Iterative quality improvement through scored verification cycles.
  • Loops: Controlled feedback loops at critical reliability checkpoints ensure accuracy.

Reliability Benchmark Results

Tests were performed using a small dataset with GPT-4o, showing error counts out of 10 in transforming JSON keys:

NameReliability Score %ASIN CodeHS CodeCIS CodeMarketing URLUsage URLWarranty TimePolicy LinkPolicy Description
Upsonic99.301000000
CrewAI87.503211012
Langgraph6.310107108101010
class ReliabilityLayer:
  prevent_hallucination = 10

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

Key Features

  • Production-Ready Scalability: Deploy seamlessly on AWS, GCP, or locally via Docker.
  • Task-Centric Design: Supports basic tasks via LLM calls, advanced tasks with V1 agents, and complex automation with V2 agents and MCP integration.
  • MCP Server Support: Multi-client processing for high-performance tasks.
  • Tool-Calling Server: Secure tool management with robust server API integrations.
  • Computer Use Integration: Execute human-like tasks using Anthropic’s ‘Computer Use’ capabilities.
  • Easy Tool Addition: Add custom and MCP tools with a single line of code.

📙 Documentation

Access all concepts and examples at docs.upsonic.ai.

🛠️ Getting Started

Prerequisites

  • Python 3.10 or higher
  • 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("Coder")

agent.print_do(task)

Tool Integration via MCP

Upsonic supports Model Context Protocol (MCP) and custom tools. Hundreds of MCP servers are available at glama.ai and mcp.run. Python functions inside a class can also be used as tools.

Example:

from upsonic import Agent, Task, ObjectResponse

class FetchMCP:
    command = "uvx"
    args = ["mcp-server-fetch"]

class WebContent(ObjectResponse):
    title: str
    content: str
    summary: str
    word_count: int

web_agent = Agent("Web Content Analyzer", model="openai/gpt-4o")

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
)
    
result = web_agent.print_do(task)
print(result.title)
print(result.summary)

Agent with Multi-Task Example

Distribute tasks effectively across agents using automated task distribution based on the relationship between agent and task. This facilitates collaborative problem-solving and structured output formats.

Example:

from upsonic import Agent, Task, MultiAgent, ObjectResponse
from upsonic.tools import Search
from typing import List

our_company = "https://redis.io/"
targeted_url = "https://upsonic.ai/"

class CompanyResearch(ObjectResponse):
   industry: str
   product_focus: str
   company_values: List[str]
   recent_news: List[str]

class Mail(ObjectResponse):
   subject: str
   content: str

researcher = Agent("Company Researcher", company_url=our_company)
strategist = Agent("Outreach Strategist", company_url=our_company)

company_task = Task(
   "Research company website and analyze key information",
   context=[targeted_url],
   tools=[Search],
   response_format=CompanyResearch
)

position_task = Task(
   "Analyze Senior Developer position context and requirements",
   context=[company_task, targeted_url],
)

message_task = Task(
   "Create personalized outreach message using research",
   context=[company_task, position_task, targeted_url],
   response_format=Mail
)

results = MultiAgent.do(
   [researcher, strategist],
   [company_task, position_task, message_task]
)

print(f"Company Industry: {company_task.response.industry}")
print(f"Company Focus: {company_task.response.product_focus}")
print(f"Company Values: {company_task.response.company_values}")
print(f"Company Recent News: {company_task.response.recent_news}")
print(f"Position Analyze: {position_task.response}")
print(f"Outreach Message Subject: {message_task.response.subject}")
print(f"Outreach Message Content: {message_task.response.content}")

Direct LLM Call

Direct LLM calls provide fast and cost-effective solutions for simple tasks. Upsonic allows direct calls to model providers and organizes structured outputs, with support for tools.

Example:

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

Many examples showing how to build agents using MCP tools and browser use with Upsonic are available in the Cookbook repository.

Telemetry

Upsonic collects anonymous usage data to improve development focus. You can disable telemetry by setting the environment variable:

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