Skip to main content

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

Project description



unclecode%2Fcrawl4ai | Trendshift Made_with_python pypi_downloads

What is Upsonic?

Upsonic offers a cutting-edge enterprise-ready framework where you can orchestrate LLM calls, agents, and computer use to complete tasks cost-effectively. It provides more reliable systems, scalability, and a task-oriented structure that you need while completing real-world cases.

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.
  • Client-server architecture: Production-ready stateless enterprise-ready system


📙 Documentation

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



🛠️ 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("Coder")

agent.print_do(task)


🚀 Features

Reliabilty Layer

The most critical issue with LLMs is the very low reliability of their outputs. This problem, especially in cases involving number generation and action-taking, negates all other benefits, resulting in an unusable system. Upsonic includes a reliability layer system that can be adjusted on a scale of 1-10. If desired, you can add a large-scale reliability layer to your system that triggers control agents and runs them in rounds to ensure the reliability of results.

class ReliabilityLayer:
  prevent_hallucination = 10

agent = Agent("Coder", reliability_layer=ReliabilityLayer)

Direct LLM Call

LLMs have always been intelligent. We know exactly when to call an agent or an LLM. This creates a smooth transition from LLM to agent systems. The call method works like an agent, based on tasks and optimizing cost and latency for your requirements. Focus on the task. Don't waste time with complex architectures.

from upsonic import Direct

Direct.do(task1)

Response Format

The output is essential for deploying an AI agent across apps or as a service. In Upsonic, we use Pydantic BaseClass as input for the task system. This allows you to configure the output exactly how you want it, such as a list of news with title, body, and URL. You can create a flexible yet robust output mechanism that improves interoperability between the agent and your app.

from upsonic import ObjectResponse

# Example ObjectResponse usage
class News(ObjectResponse):
    title: str
    body: str
    url: str
    tags: list[str]

class ResponseFormat(ObjectResponse):
    news_list: list[News]

Tool Integration

Our Framework officially supports Model Context Protocol (MCP) and custom tools. You can use hundreds of MCP servers at https://glama.ai/mcp/servers or https://smithery.ai/ We also support Python functions inside a class as a tool. You can easily generate your integrations with that.

from upsonic.tools import Search

# MCP Tool
class HackerNewsMCP:
    command = "uvx"
    args = ["mcp-hn"]

# Custom Tool
class MyTools:
    def our_server_status():
        return True

tools = [Search, MyTools] # HackerNewsMCP

Other LLM's

agent = Agent("Coder", model="openai/gpt-4o")

Access other LLMs through the docs

Memory

Humans have an incredible capacity for context length, which reflects their comprehensive context awareness and consistently produces superior results. In Upsonic, our memory system adeptly handles complex workflows, delivering highly personalized outcomes. It seamlessly remembers prior tasks and preferences, ensuring optimal performance. You can confidently set up memory settings within Agent, leveraging the agent_id system. Agents, each with their distinct personality, are uniquely identified by their ID, ensuring precise and efficient execution.

agent_id_ = "product_manager_agent"

agent = Agent(
    agent_id_=agent_id_
    ...
    memory=True
)

Knowledge Base

The Knowledge Base provides private or public content to your agent to ensure accurate and context-aware tasks. For example, you can provide a PDF and URL to the agent. The Knowledge Base seamlessly integrates with the Task System, requiring these sources.

from upsonic import KnowledgeBase

my_knowledge_base = KnowledgeBase(files=["sample.pdf", "https://upsonic.ai"])

task1 = Task(
    ...
    context[my_knowledge_base]
)

Connecting Task Outputs

Chaining tasks is essential for complex workflows where one task's output informs the next. You can assign a task to another as context for performing the job. This will prepare the response of task 1 for task 2.

task1 = Task(
    ...
)

task2 = Task(
    ...
    context[task1]
)

Be an Human

Agent and characterization are based on LLM itself. We are trying to characterize the developer, PM, and marketing. Sometimes, we need to give a human name. This is required for tasks like sending personalized messages or outreach. For these requirements, we have name and contact settings in Agent. The agent will feel like a human as you specify.

product_manager_agent = Agent(
    ...
    name="John Walk"
    contact="john@upsonic.ai"
)

Multi Agent

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.

from upsonic import MultiAgent

MultiAgent.do([agent2, agent1], [task1, task2])

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.

from upsonic.client.tools import ComputerUse

...

tools = [ComputerUse]
...

Reflection

LLM's by their nature oriented to finish your process. By the way its mean sometimes you can get empty result. Its effect your business logic and your application progress. We support reflection mechanism for that to check the result is staisfying and if not give a feedback. So you can use the reflection for preventing blank messages and other things.

product_manager_agent = Agent(
    ...
    reflection=True
)

Compress Context

The context windows can be small as in OpenAI models. In this kind of situations we have a mechanism that compresses the message, system_message and the contexts. If you are working with situations like deepsearching or writing a long content and giving it as context of another task. The compress_context is full fit with you. This mechanism will only work in context overflow situations otherwise everything is just normal.

product_manager_agent = Agent(
    ...
    compress_context=True
)


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"


Coming Soon

  • Dockerized Server Deploy
  • Verifiers For Computer Use

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.44.0a1739565955.tar.gz (202.3 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.44.0a1739565955-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

Details for the file upsonic-0.44.0a1739565955.tar.gz.

File metadata

  • Download URL: upsonic-0.44.0a1739565955.tar.gz
  • Upload date:
  • Size: 202.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for upsonic-0.44.0a1739565955.tar.gz
Algorithm Hash digest
SHA256 17b7b900a9859084afdac460b1da0ee69a637b6a013511ad3586819686d803e6
MD5 6ff8025c180ec0cbbe2240f115cbcc3c
BLAKE2b-256 5cb471a29e011728069408cf68814bf1fc678b381a88efb5920e9bdd79919e0a

See more details on using hashes here.

File details

Details for the file upsonic-0.44.0a1739565955-py3-none-any.whl.

File metadata

File hashes

Hashes for upsonic-0.44.0a1739565955-py3-none-any.whl
Algorithm Hash digest
SHA256 fd193dfc7df08ffe78aad1a96018616bd557a455526f8371a0d6643abe02d2df
MD5 de1bad92276b96c1e90883387b9e53c9
BLAKE2b-256 478185b1bc1e59d30820516d6d396230d0af739d68dad13a28818ca0694e3692

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