Skip to main content

Agent Framework For Fintech

Project description

Upsonic

Production-Ready AI Agent Framework with Safety First

PyPI version License Python Version GitHub stars GitHub issues Documentation Discord

DocumentationQuickstartExamplesDiscord


Overview

Upsonic is an open-source AI agent framework for building production-ready agents. It supports multiple AI providers (OpenAI, Anthropic, Azure, Bedrock) and includes built-in safety policies, OCR, memory, multi-agent coordination, and MCP tool integration.

What Can You Build?

  • Document Analysis: Extract and process text from images and PDFs
  • Customer Service Automation: Agents with memory and session context
  • Financial Analysis: Agents that analyze data, generate reports, and provide insights
  • Compliance Monitoring: Enforce safety policies across all agent interactions
  • Research & Data Gathering: Automate research workflows with multi-agent collaboration
  • Multi-Agent Workflows: Orchestrate tasks across specialized agent teams

Quick Start

Installation

uv pip install upsonic
# pip install upsonic

Basic Agent

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)

Agent with Tools

from upsonic import Agent, Task
from upsonic.tools.common_tools import YFinanceTools

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

task = Task(
    description="Give me a summary about tesla stock with tesla car models",
    tools=[YFinanceTools()]
)

agent.print_do(task)

Agent with Memory

from upsonic import Agent, Task
from upsonic.storage import Memory, InMemoryStorage

memory = Memory(
    storage=InMemoryStorage(),
    session_id="session_001",
    full_session_memory=True
)

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

task1 = Task(description="My name is John")
agent.print_do(task1)

task2 = Task(description="What is my name?")
agent.print_do(task2)  # Agent remembers: "Your name is John"

Ready for more? Check out the Quickstart Guide for additional examples including Knowledge Base and Team workflows.

Key Features

  • Autonomous Agent: An agent that can read, write, and execute code inside a sandboxed workspace, no tool setup required
  • Safety Engine: Policy-based content filtering applied to user inputs, agent outputs, and tool interactions
  • OCR Support: Unified interface for multiple OCR engines with PDF and image support
  • Memory Management: Session memory and long-term storage with multiple backend options
  • Multi-Agent Teams: Sequential and parallel agent coordination
  • Tool Integration: MCP tools, custom tools, and human-in-the-loop workflows
  • Production Ready: Monitoring, metrics, and enterprise deployment support

Core Capabilities

Autonomous Agent

AutonomousAgent extends Agent with built-in filesystem and shell tools, automatic session memory, and workspace sandboxing. Useful for coding assistants, DevOps automation, and any task that needs direct file or terminal access.

from upsonic import AutonomousAgent, Task

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

task = Task("Read the main.py file and add error handling to every function")
agent.print_do(task)

All file and shell operations are restricted to workspace. Path traversal and dangerous commands are blocked.


Safety Engine

The Safety Engine applies policies at three points: user inputs, agent outputs, and tool interactions. Policies can block, anonymize, replace, or raise exceptions on matched content.

from upsonic import Agent, Task
from upsonic.safety_engine.policies.pii_policies import PIIAnonymizePolicy

agent = Agent(
    model="anthropic/claude-sonnet-4-5",
    user_policy=PIIAnonymizePolicy,  # anonymizes PII before sending to the LLM
)

task = Task(
    description="My email is john.doe@example.com and phone is 555-1234. What are my email and phone?"
)

# PII is anonymized before reaching the LLM, then de-anonymized in the response
result = agent.do(task)
print(result)  # "Your email is john.doe@example.com and phone is 555-1234"

Pre-built policies cover PII, adult content, profanity, financial data, and more. Custom policies are also supported.

Learn more: Safety Engine Documentation


OCR and Document Processing

Upsonic provides a unified OCR interface with a layered pipeline: Layer 0 handles document preparation (PDF to image conversion, preprocessing), Layer 1 runs the OCR engine.

uv pip install "upsonic[ocr]"
from upsonic.ocr import OCR
from upsonic.ocr.layer_1.engines import EasyOCREngine

engine = EasyOCREngine(languages=["en"])
ocr = OCR(layer_1_ocr_engine=engine)

text = ocr.get_text("invoice.pdf")
print(text)

Supported engines: EasyOCR, RapidOCR, Tesseract, PaddleOCR, DeepSeek OCR, DeepSeek via Ollama.

Learn more: OCR Documentation

Upsonic AgentOS

AgentOS is an optional deployment platform for running agents in production. It provides a Kubernetes-based runtime, metrics dashboard, and self-hosted deployment.

  • Kubernetes-based FastAPI Runtime: Deploy agents as isolated, scalable microservices
  • Metrics Dashboard: Track LLM costs, token usage, and performance per transaction
  • Self-Hosted: Full control over your data and infrastructure
  • One-Click Deployment: Automated deployment pipelines
AgentOS Dashboard

IDE Integration

Add Upsonic docs as a source in your coding tools:

Cursor: Settings → Indexing & Docs → Add https://docs.upsonic.ai/llms-full.txt

Also works with VSCode, Windsurf, and similar tools.

Documentation and Resources

Community and Support

💬 Join our Discord community! — Ask questions, share what you're building, get help from the team, and connect with other developers using Upsonic.

  • Discord - Chat with the community and get real-time support
  • Issue Tracker - Report bugs and request features
  • Changelog - See what's new in each release

License

Upsonic is released under the MIT License. See LICENCE for details.

Contributing

We welcome contributions from the community! Please read our contributing guidelines and code of conduct before submitting pull requests.


Learn more at upsonic.ai

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.73.1.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

upsonic-0.73.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file upsonic-0.73.1.tar.gz.

File metadata

  • Download URL: upsonic-0.73.1.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for upsonic-0.73.1.tar.gz
Algorithm Hash digest
SHA256 4e0d44320f901ce429bcd2454f2b52521e803baa5ece24fc0e8baafb798ac609
MD5 6a75c56364eb61f9c835e8a8fafbc379
BLAKE2b-256 9e93fc2cfc70f2303cf6213497a7af65a2c1e296ea6b0e6e27d36b2974be00b5

See more details on using hashes here.

File details

Details for the file upsonic-0.73.1-py3-none-any.whl.

File metadata

  • Download URL: upsonic-0.73.1-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for upsonic-0.73.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1033d7cbac545fca88a24cee3268c42c1426f8eabaafd1856842741adf96a401
MD5 6347b6d479b4c1d516d99010293871ce
BLAKE2b-256 d1b00829a12d525edc71ca04eaa242501fd59bcc5e24246665e74255300a942a

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