Skip to main content

The Open Source Foundation for AI Agents. Powered by the DisCo (Distributed Cognition) architecture.

Project description

Soorma Core SDK

The Open Source Foundation for AI Agents.

Soorma is an agentic infrastructure platform based on the DisCo (Distributed Cognition) architecture. It provides a standardized Control Plane (Registry, Event Bus, Memory Service) for building production-grade multi-agent systems.

PyPI version Python 3.11+ License: MIT

🚧 Status: Day 0 (Pre-Alpha)

We're in active pre-launch refactoring to solidify architecture and APIs before v1.0. The SDK and infrastructure are functional for building multi-agent systems.

Learn more: soorma.ai

Installation

During Pre-Launch: We recommend installing from local source to stay synchronized with breaking changes:

# Clone the repository
git clone https://github.com/soorma-ai/soorma-core.git
cd soorma-core

# Install from source
pip install -e sdk/python

After v1.0 Release: Standard PyPI installation will be recommended: pip install soorma-core

Requirements: Python 3.11+

Quick Start

Note: Infrastructure runs locally via Docker. Clone the repo to get started.

# 1. Clone the repository
git clone https://github.com/soorma-ai/soorma-core.git
cd soorma-core

# 2. Start local infrastructure
soorma dev --build

# 3. Run the Hello World example
cd examples/01-hello-world
python worker.py

# 4. In another terminal, send a request
python client.py Alice

Next steps: See the Examples Guide for a complete learning path.

Core Concepts

Soorma provides three agent types for building distributed AI systems:

  • Tool - Synchronous, stateless operations (< 1 second)
  • Worker - Asynchronous, stateful tasks with delegation
  • Planner - Strategic reasoning and goal decomposition (Stage 4)

Platform Services:

  • context.registry - Service discovery
  • context.memory - Distributed state (Semantic, Episodic, Working memory)
  • context.bus - Event choreography
  • context.tracker - Observability

Learn more: See the comprehensive documentation for architecture details, patterns, and API references.

Agent Models

Tool Model (Synchronous)

Tools handle fast, stateless operations that return immediate results:

from soorma import Tool
from soorma.agents.tool import InvocationContext

tool = Tool(name="calculator")

@tool.on_invoke("calculate.add")
async def add_numbers(request: InvocationContext, context):
    numbers = request.data["numbers"]
    return {"sum": sum(numbers)}  # Auto-published to caller

Characteristics:

  • Stateless: No persistence between calls
  • 🚀 Fast: Returns immediately (< 1 second)
  • 🔄 Auto-complete: SDK publishes response automatically
  • 📊 Use cases: Calculations, lookups, validations

Example: 01-hello-tool

Worker Model (Asynchronous with Delegation)

Workers handle multi-step, stateful tasks with delegation:

from soorma import Worker
from soorma.task_context import TaskContext, ResultContext

worker = Worker(name="order-processor")

@worker.on_task("order.process.requested")
async def process_order(task: TaskContext, context):
    # Save state
    task.state["order_id"] = task.data["order_id"]
    await task.save()
    
    # Delegate to sub-workers
    await task.delegate_parallel([
        DelegationSpec("inventory.reserve.requested", {...}, "inventory.reserved"),
        DelegationSpec("payment.process.requested", {...}, "payment.processed"),
    ])

@worker.on_result("inventory.reserved")
@worker.on_result("payment.processed")
async def handle_result(result: ResultContext, context):
    task = await result.restore_task()
    task.update_sub_task_result(result.correlation_id, result.data)
    
    # Complete when all results arrived
    if task.aggregate_parallel_results(task.state["group_id"]):
        await task.complete({"status": "completed"})

Characteristics:

  • 💾 Stateful: TaskContext persists across delegations
  • 🔄 Asynchronous: Manual completion with task.complete()
  • 🎯 Delegation: Sequential or parallel sub-tasks
  • ⚙️ Use cases: Workflows, long-running operations, coordination

Delegation Patterns:

  • Sequential: task.delegate() - One sub-task at a time
  • Parallel: task.delegate_parallel() - Fan-out with aggregation
  • Multi-level: Workers can delegate to Workers (arbitrary depth)

Example: 08-worker-basic

Comparison

Feature Tool Worker
Execution Synchronous Asynchronous
State Stateless Stateful (TaskContext)
Completion Auto Manual (task.complete())
Delegation ❌ No ✅ Yes
Memory I/O ❌ No ✅ Yes
Latency < 100ms Seconds to minutes
Example Calculator Order processing

CLI Reference

Command Description
soorma init <name> Create a new agent project
soorma dev Start local infrastructure
soorma dev --build Build and start (first time)
soorma dev --status Show infrastructure status
soorma dev --logs View infrastructure logs
soorma dev --stop Stop infrastructure
soorma dev --stop --clean Stop and remove all data
soorma version Show SDK version

The soorma dev command runs infrastructure (Registry, NATS, Event Service, Memory Service) in Docker while your agent code runs natively on the host for fast iteration and debugging.

Documentation & Resources

📚 Complete Documentation: github.com/soorma-ai/soorma-core

Key Guides:

🎓 Learning Path:

  1. 01-hello-world - Basic Worker pattern
  2. 02-events-simple - Event pub/sub
  3. 03-events-structured - LLM-based event selection
  4. 04-memory-working - Workflow state
  5. 05-memory-semantic - RAG patterns
  6. 06-memory-episodic - Multi-agent chatbot

Contributing & Support

License

MIT License - see LICENSE for details.

Project details


Download files

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

Source Distribution

soorma_core-0.7.7.tar.gz (71.6 kB view details)

Uploaded Source

Built Distribution

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

soorma_core-0.7.7-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

Details for the file soorma_core-0.7.7.tar.gz.

File metadata

  • Download URL: soorma_core-0.7.7.tar.gz
  • Upload date:
  • Size: 71.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for soorma_core-0.7.7.tar.gz
Algorithm Hash digest
SHA256 79a9a59cbcca893d74699aa2c2820224294c22e762e89750dc5eb4f0aa887039
MD5 6d7f1773773d50b60fc556fe966e8518
BLAKE2b-256 3aa9ed117ef1e13badef01538b2b23b44f26e1c1aa6611c67dd34462d929a5dd

See more details on using hashes here.

File details

Details for the file soorma_core-0.7.7-py3-none-any.whl.

File metadata

  • Download URL: soorma_core-0.7.7-py3-none-any.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for soorma_core-0.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 01c19a033eb456d747f10022d27f6a77b331481b4acddf8ca19d84295f5509cc
MD5 98689e405342ee232209bd0a4df91311
BLAKE2b-256 2e2e25fd93bd3b7b9c74d2543d20330f611c7ce12823a613daf25bbbf371aaaf

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