Name | upsonic JSON |
Version |
0.44.2
JSON |
| download |
home_page | None |
Summary | Task oriented AI agent framework for digital workers and vertical AI agents |
upload_time | 2025-02-19 18:58:07 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<img src="https://github.com/user-attachments/assets/10a3a9ca-1f39-410c-ac48-a7365de589d9" >
<br>
<br>
<a name="readme-top"></a>
<div align="center">
</div>
<p>
<a href="https://discord.gg/dNKGm4dfnR">
<img src="https://img.shields.io/badge/Discord-Join-7289DA?logo=discord&logoColor=white">
</a>
<a href="https://twitter.com/upsonicai">
<img src="https://img.shields.io/twitter/follow/upsonicai?style=social">
</a>
<a href="https://trendshift.io/repositories/10584" target="_blank"><img src="https://trendshift.io/api/badge/repositories/10584" alt="unclecode%2Fcrawl4ai | Trendshift" style="width: 100px; height: 20px;"
<a href="https://www.python.org/">
<img src="https://img.shields.io/badge/Made%20with-Python-1f425f.svg" alt="Made_with_python">
</a>
<img src="https://static.pepy.tech/personalized-badge/upsonic?period=total&units=international_system&left_color=grey&right_color=blue&left_text=PyPI%20Downloads" alt="pypi_downloads">
</p>
# 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**: 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**: 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- **Secure Runtime**: Isolated environment to run agents

<br>
**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.
<br>
# 📙 Documentation
You can access our documentation at [docs.upsonic.ai](https://docs.upsonic.ai/). All concepts and examples are available there.
<br>
# 🛠️ Getting Started
### Prerequisites
- Python 3.10 or higher
- Access to OpenAI or Anthropic API keys (Azure and Bedrock Supported)
## Installation
```bash
pip install upsonic
```
# Basic Example
Set your OPENAI_API_KEY
```console
export OPENAI_API_KEY=sk-***
```
Start the agent
```python
from upsonic import Task, Agent
task = Task("Who developed you?")
agent = Agent("Coder")
agent.print_do(task)
```
<br>
<br>
## 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
```python
class ReliabilityLayer:
prevent_hallucination = 10
agent = Agent("Coder", reliability_layer=ReliabilityLayer)
```
## Tool Integration via MCP
Upsonic officially supports [Model Context Protocol (MCP)](https://github.com/modelcontextprotocol/servers) and custom tools. You can use hundreds of MCP servers at [glama](https://glama.ai/mcp/servers) or [mcprun](https://mcp.run) We also support Python functions inside a class as a tool. You can easily generate your integrations with that.
```python
from upsonic import Agent, Task, ObjectResponse
# Define Fetch MCP configuration
class FetchMCP:
command = "uvx"
args = ["mcp-server-fetch"]
# Create response format for web content
class WebContent(ObjectResponse):
title: str
content: str
summary: str
word_count: int
# Initialize agent
web_agent = Agent(
"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
web_agent.print_do(task)
print(result.title)
print(result.summary)
```
## Agent with Multi-Task Example
Distribute tasks effectively across agents with our automated task distribution mechanism. This tool matches tasks based on the relationship between agent and task, ensuring collaborative problem-solving across agents and tasks. The output is essential for deploying an AI agent across apps or as a service. Upsonic uses Pydantic BaseClass to define structured outputs for tasks, allowing developers to specify exact response formats for their AI agent tasks.
```python
from upsonic import Agent, Task, MultiAgent, ObjectResponse
from upsonic.tools import Search
from typing import List
# Targeted Company and Our Company
our_company = "https://redis.io/"
targeted_url = "https://upsonic.ai/"
# Response formats
class CompanyResearch(ObjectResponse):
industry: str
product_focus: str
company_values: List[str]
recent_news: List[str]
class Mail(ObjectResponse):
subject: str
content: str
# Creating Agents
researcher = Agent(
"Company Researcher",
company_url=our_company
)
strategist = Agent(
"Outreach Strategist",
company_url=our_company
)
# Creating Tasks and connect
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
)
# Run the Tasks over agents
results = MultiAgent.do(
[researcher, strategist],
[company_task, position_task, message_task]
)
# Print the results
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 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.
```python
from upsonic import Direct
Direct.do(task1)
```
## Reliable Computer Use
Computer use can able to human task like humans, mouse move, mouse click, typing and scrolling and etc. So you can build tasks over non-API systems. It can help your linkedin cases, internal tools. Computer use is supported by only Claude for now.
```python
from upsonic.client.tools import ComputerUse
...
tools = [ComputerUse]
...
```
<br>
<br>
## 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.
```python
import os
os.environ["UPSONIC_TELEMETRY"] = "False"
```
<br>
<br>
### Coming Soon
- **Dockerized Server Deploy**
- **Verifiers For Computer Use**
Raw data
{
"_id": null,
"home_page": null,
"name": "upsonic",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Onur ULUSOY <onur@upsonic.co>",
"download_url": "https://files.pythonhosted.org/packages/79/5e/f516f756c4e2b08da576f0cff9edd94bd525c356734854b0e92f0c10283b/upsonic-0.44.2.tar.gz",
"platform": null,
"description": "<img src=\"https://github.com/user-attachments/assets/10a3a9ca-1f39-410c-ac48-a7365de589d9\" >\n<br>\n<br>\n<a name=\"readme-top\"></a>\n\n<div align=\"center\">\n\n\n</div>\n\n\n <p>\n <a href=\"https://discord.gg/dNKGm4dfnR\">\n <img src=\"https://img.shields.io/badge/Discord-Join-7289DA?logo=discord&logoColor=white\">\n </a>\n <a href=\"https://twitter.com/upsonicai\">\n <img src=\"https://img.shields.io/twitter/follow/upsonicai?style=social\">\n </a>\n <a href=\"https://trendshift.io/repositories/10584\" target=\"_blank\"><img src=\"https://trendshift.io/api/badge/repositories/10584\" alt=\"unclecode%2Fcrawl4ai | Trendshift\" style=\"width: 100px; height: 20px;\" \n <a href=\"https://www.python.org/\">\n <img src=\"https://img.shields.io/badge/Made%20with-Python-1f425f.svg\" alt=\"Made_with_python\">\n </a>\n <img src=\"https://static.pepy.tech/personalized-badge/upsonic?period=total&units=international_system&left_color=grey&right_color=blue&left_text=PyPI%20Downloads\" alt=\"pypi_downloads\">\n </p>\n\n\n# Introduction\nUpsonic 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.\n\n# Why Choose Upsonic?\nUpsonic is a next-generation framework that makes agents production-ready by solving three critical challenges:\n\n1- **Reliability**: While other frameworks require expertise and complex coding for reliability features, Upsonic offers easy-to-activate reliability layers without disrupting functionality.\n\n2- **Model Context Protocol**: 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.\n\n3- **Secure Runtime**: Isolated environment to run agents\n\n\n\n<br>\n\n**Key features:**\n\n- **Production-Ready Scalability**: Deploy seamlessly on AWS, GCP, or locally using Docker.\n- **Task-Centric Design**: Focus on practical task execution, with options for:\n - Basic tasks via LLM calls.\n - Advanced tasks with V1 agents.\n - Complex automation using V2 agents with MCP integration.\n- **MCP Server Support**: Utilize multi-client processing for high-performance tasks.\n- **Tool-Calling Server**: Exception-secure tool management with robust server API interactions.\n- **Computer Use Integration**: Execute human-like tasks using Anthropic\u2019s \u2018Computer Use\u2019 capabilities.\n- **Easily adding tools:**\u00a0You can add your custom tools and MCP tools with a single line of code.\n<br>\n\n# \ud83d\udcd9 Documentation\n\nYou can access our documentation at [docs.upsonic.ai](https://docs.upsonic.ai/). All concepts and examples are available there.\n\n<br>\n\n# \ud83d\udee0\ufe0f Getting Started\n\n### Prerequisites\n\n- Python 3.10 or higher\n- Access to OpenAI or Anthropic API keys (Azure and Bedrock Supported)\n\n## Installation\n\n```bash\npip install upsonic\n\n```\n\n\n\n# Basic Example\n\nSet your OPENAI_API_KEY\n\n```console\nexport OPENAI_API_KEY=sk-***\n```\n\nStart the agent \n\n```python\nfrom upsonic import Task, Agent\n\ntask = Task(\"Who developed you?\")\n\nagent = Agent(\"Coder\")\n\nagent.print_do(task)\n```\n\n<br>\n<br>\n\n\n## Reliability Layer\n\nLLM 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.\n\n**Verifier Agent**: Validates outputs, tasks, and formats - detecting inconsistencies, numerical errors, and hallucinations\n\n**Editor Agent**: Works with verifier feedback to revise and refine outputs until they meet quality standards\n\n**Rounds**: Implements iterative quality improvement through scored verification cycles\n\n**Loops**: Ensures accuracy through controlled feedback loops at critical reliability checkpoints\n\n```python\nclass ReliabilityLayer:\n prevent_hallucination = 10\n\nagent = Agent(\"Coder\", reliability_layer=ReliabilityLayer)\n```\n\n## Tool Integration via MCP\n\nUpsonic officially supports [Model Context Protocol (MCP)](https://github.com/modelcontextprotocol/servers) and custom tools. You can use hundreds of MCP servers at [glama](https://glama.ai/mcp/servers) or [mcprun](https://mcp.run) We also support Python functions inside a class as a tool. You can easily generate your integrations with that.\n\n```python\nfrom upsonic import Agent, Task, ObjectResponse\n\n# Define Fetch MCP configuration\nclass FetchMCP:\n command = \"uvx\"\n args = [\"mcp-server-fetch\"]\n\n# Create response format for web content\nclass WebContent(ObjectResponse):\n title: str\n content: str\n summary: str\n word_count: int\n\n# Initialize agent\nweb_agent = Agent(\n \"Web Content Analyzer\",\n model=\"openai/gpt-4o\", # You can use other models\n)\n\n# Create a task to analyze a web page\ntask = Task(\n description=\"Fetch and analyze the content from url. Extract the main content, title, and create a brief summary.\",\n context=[\"https://upsonic.ai\"],\n tools=[FetchMCP],\n response_format=WebContent\n)\n \n# Usage\nweb_agent.print_do(task)\nprint(result.title)\nprint(result.summary)\n\n```\n\n\n## Agent with Multi-Task Example \n\nDistribute tasks effectively across agents with our automated task distribution mechanism. This tool matches tasks based on the relationship between agent and task, ensuring collaborative problem-solving across agents and tasks. The output is essential for deploying an AI agent across apps or as a service. Upsonic uses Pydantic BaseClass to define structured outputs for tasks, allowing developers to specify exact response formats for their AI agent tasks.\n\n```python\nfrom upsonic import Agent, Task, MultiAgent, ObjectResponse\nfrom upsonic.tools import Search\nfrom typing import List\n\n# Targeted Company and Our Company\nour_company = \"https://redis.io/\"\ntargeted_url = \"https://upsonic.ai/\"\n\n\n# Response formats\nclass CompanyResearch(ObjectResponse):\n industry: str\n product_focus: str\n company_values: List[str]\n recent_news: List[str]\n\nclass Mail(ObjectResponse):\n subject: str\n content: str\n\n\n# Creating Agents\nresearcher = Agent(\n \"Company Researcher\",\n company_url=our_company\n)\n\nstrategist = Agent(\n \"Outreach Strategist\", \n company_url=our_company\n)\n\n\n# Creating Tasks and connect\ncompany_task = Task(\n \"Research company website and analyze key information\",\n\n context=[targeted_url],\n tools=[Search],\n response_format=CompanyResearch\n)\n\nposition_task = Task(\n \"Analyze Senior Developer position context and requirements\",\n context=[company_task, targeted_url],\n)\n\nmessage_task = Task(\n \"Create personalized outreach message using research\",\n context=[company_task, position_task, targeted_url],\n response_format=Mail\n)\n\n\n# Run the Tasks over agents\nresults = MultiAgent.do(\n [researcher, strategist],\n [company_task, position_task, message_task]\n)\n\n\n# Print the results\nprint(f\"Company Industry: {company_task.response.industry}\")\nprint(f\"Company Focus: {company_task.response.product_focus}\")\nprint(f\"Company Values: {company_task.response.company_values}\")\nprint(f\"Company Recent News: {company_task.response.recent_news}\")\nprint(f\"Position Analyze: {position_task.response}\")\nprint(f\"Outreach Message Subject: {message_task.response.subject}\")\nprint(f\"Outreach Message Content: {message_task.response.content}\")\n\n```\n\n\n\n\n\n\n## Direct LLM Call\n\nDirect 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.\n\n```python\nfrom upsonic import Direct\n\nDirect.do(task1)\n\n```\n\n## Reliable Computer Use\nComputer use can able to human task like humans, mouse move, mouse click, typing and scrolling and etc. So you can build tasks over non-API systems. It can help your linkedin cases, internal tools. Computer use is supported by only Claude for now.\n\n```python\n\nfrom upsonic.client.tools import ComputerUse\n\n...\n\ntools = [ComputerUse]\n...\n\n```\n\n<br>\n<br>\n\n## Telemetry\n\nWe 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.\n\n```python\nimport os\nos.environ[\"UPSONIC_TELEMETRY\"] = \"False\"\n```\n<br>\n<br>\n\n\n\n### Coming Soon\n\n- **Dockerized Server Deploy**\n- **Verifiers For Computer Use**\n",
"bugtrack_url": null,
"license": null,
"summary": "Task oriented AI agent framework for digital workers and vertical AI agents",
"version": "0.44.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2fe86ba2e281b68a9c6867cffb285fc59b8381999b4560f691c17a9e4dedff22",
"md5": "ac52fa87581637dcedbbd5fa9e936d6c",
"sha256": "5f1dab0d60c6d06580bded26328a96e3627ccfd67663f2e6ac1bd4c8775a8476"
},
"downloads": -1,
"filename": "upsonic-0.44.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ac52fa87581637dcedbbd5fa9e936d6c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 78819,
"upload_time": "2025-02-19T18:58:05",
"upload_time_iso_8601": "2025-02-19T18:58:05.381275Z",
"url": "https://files.pythonhosted.org/packages/2f/e8/6ba2e281b68a9c6867cffb285fc59b8381999b4560f691c17a9e4dedff22/upsonic-0.44.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "795ef516f756c4e2b08da576f0cff9edd94bd525c356734854b0e92f0c10283b",
"md5": "2008ecb79044543619bb238f465a4171",
"sha256": "538fd77d67814b4f27b0911370626e5e313f552dc33876ed9a255a6f8d7fa952"
},
"downloads": -1,
"filename": "upsonic-0.44.2.tar.gz",
"has_sig": false,
"md5_digest": "2008ecb79044543619bb238f465a4171",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 201094,
"upload_time": "2025-02-19T18:58:07",
"upload_time_iso_8601": "2025-02-19T18:58:07.907906Z",
"url": "https://files.pythonhosted.org/packages/79/5e/f516f756c4e2b08da576f0cff9edd94bd525c356734854b0e92f0c10283b/upsonic-0.44.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-19 18:58:07",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "upsonic"
}