Skip to main content

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

Project description

Soorma Core

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 (Gateway, Registry, Event Bus, State Tracker, Memory) for building production-grade multi-agent systems.

๐Ÿšง Status: Pre-Alpha

We are currently building the core runtime. This package provides early access to the SDK and CLI.

Join the waitlist: soorma.ai

Quick Start

Note: Docker images are not yet published. You must clone the repo and build locally.

1. Clone Repository and Build Infrastructure

# Clone the repository (needed for Docker images)
git clone https://github.com/soorma-ai/soorma-core.git
cd soorma-core

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the SDK from PyPI
pip install soorma-core

# Build infrastructure containers (required first time)
soorma dev --build

๐Ÿ’ก Alternative: To install SDK from local source (for development/customization):

pip install -e sdk/python

2. Run the Hello World Example

# Start infrastructure
soorma dev --infra-only

# In separate terminals:
python examples/hello-world/planner_agent.py
python examples/hello-world/worker_agent.py
python examples/hello-world/tool_agent.py
python examples/hello-world/client.py

3. Create a New Agent Project

# Create a Worker agent (default)
soorma init my-worker

# Create a Planner agent (goal decomposition)
soorma init my-planner --type planner

# Create a Tool service (stateless operations)
soorma init my-tool --type tool

cd my-worker
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Start Local Development

# Start infrastructure and run your agent (auto-detects agent in current directory)
soorma dev

Or run infrastructure separately:

# Start only infrastructure
soorma dev --infra-only

# In another terminal, run your agent manually
python -m my_worker.agent

Deploy to Soorma Cloud

soorma deploy  # Coming soon!

The DisCo "Trinity"

Soorma implements the DisCo (Distributed Cognition) architecture with three domain service types:

Type Class Purpose Example Use Cases
Planner Planner Strategic reasoning, goal decomposition Research planning, workflow orchestration
Worker Worker Domain-specific task execution Data processing, analysis, content generation
Tool Tool Atomic, stateless operations API calls, calculations, file parsing

Planner Agent

Planners are the "brain" - they receive high-level goals and decompose them into tasks:

from soorma import Planner, PlatformContext
from soorma.agents.planner import Goal, Plan, Task

planner = Planner(
    name="research-planner",
    description="Plans research workflows",
    capabilities=["research_planning"],
)

@planner.on_goal("research.goal")
async def plan_research(goal: Goal, context: PlatformContext) -> Plan:
    # Discover available workers
    workers = await context.registry.find_all("paper_search")
    
    # Decompose goal into tasks
    return Plan(
        goal=goal,
        tasks=[
            Task(name="search", assigned_to="paper_search", data=goal.data),
            Task(name="summarize", assigned_to="summarizer", depends_on=["search"]),
        ],
    )

planner.run()

Worker Agent

Workers are the "hands" - they execute domain-specific cognitive tasks:

from soorma import Worker, PlatformContext
from soorma.agents.worker import TaskContext

worker = Worker(
    name="research-worker",
    description="Searches and analyzes papers",
    capabilities=["paper_search", "citation_analysis"],
)

@worker.on_task("paper_search")
async def search_papers(task: TaskContext, context: PlatformContext):
    # Report progress
    await task.report_progress(0.5, "Searching...")
    
    # Access shared memory
    prefs = await context.memory.retrieve(f"user:{task.session_id}:prefs")
    
    # Your task logic
    results = await search_academic_papers(task.data["query"], prefs)
    
    # Store for downstream workers
    await context.memory.store(f"results:{task.task_id}", results)
    
    return {"papers": results, "count": len(results)}

worker.run()

Tool Service

Tools are the "utilities" - stateless, deterministic operations:

from soorma import Tool, PlatformContext
from soorma.agents.tool import ToolRequest

tool = Tool(
    name="calculator",
    description="Performs calculations",
    capabilities=["arithmetic", "unit_conversion"],
)

@tool.on_invoke("calculate")
async def calculate(request: ToolRequest, context: PlatformContext):
    expression = request.data["expression"]
    result = safe_eval(expression)
    return {"result": result, "expression": expression}

tool.run()

Platform Context

Every handler receives a PlatformContext that provides access to all platform services:

@worker.on_task("my_task")
async def handler(task: TaskContext, context: PlatformContext):
    # Service Discovery
    tool = await context.registry.find("calculator")
    
    # Shared Memory
    data = await context.memory.retrieve(f"cache:{task.data['key']}")
    await context.memory.store("result:123", {"value": 42})
    
    # Event Publishing
    await context.bus.publish("task.completed", {"result": "done"})
    
    # Progress Tracking (automatic for workers, manual available)
    await context.tracker.emit_progress(
        plan_id=task.plan_id,
        task_id=task.task_id,
        status="running",
        progress=0.75,
    )
Service Purpose Methods
context.registry Service Discovery find(), register(), query_schemas()
context.memory Distributed State retrieve(), store(), search()
context.bus Event Choreography publish(), subscribe(), request()
context.tracker Observability start_plan(), emit_progress(), complete_task()

CLI Commands

First-time setup: Run soorma dev --build --infra-only to build Docker images before using other commands.

Command Description
soorma init <name> Scaffold a new agent project
soorma init <name> --type planner Create a Planner agent
soorma init <name> --type worker Create a Worker agent (default)
soorma init <name> --type tool Create a Tool service
soorma dev Start infra + run agent with hot reload
soorma dev --build Build service images from source first
soorma dev --build --infra-only Build images without running agent (first-time setup)
soorma dev --infra-only Start infra without running agent
soorma dev --stop Stop the development stack
soorma dev --status Show stack status
soorma dev --logs View infrastructure logs
soorma deploy Deploy to Soorma Cloud (coming soon)
soorma version Show CLI version

How soorma dev Works

The CLI implements an "Infra in Docker, Code on Host" pattern for optimal DX:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Your Machine                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Docker Containers (Infrastructure)                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”‚
โ”‚  โ”‚ Registry โ”‚  โ”‚   NATS   โ”‚  โ”‚ Event Service โ”‚              โ”‚
โ”‚  โ”‚  :8081   โ”‚  โ”‚  :4222   โ”‚  โ”‚    :8082      โ”‚              โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚
โ”‚        โ–ฒ            โ–ฒ               โ–ฒ                       โ”‚
โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€ localhost โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                       โ”‚
โ”‚                     โ–ฒ                                       โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                    โ”‚
โ”‚  โ”‚    Native Python (Your Agent)       โ”‚                    โ”‚
โ”‚  โ”‚  โ€ข Hot reload on file change        โ”‚                    โ”‚
โ”‚  โ”‚  โ€ข Full debugger support            โ”‚                    โ”‚
โ”‚  โ”‚  โ€ข Auto-connects to Event Service   โ”‚                    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Benefits:

  • โšก Fast iteration - No docker build cycle, instant reload
  • ๐Ÿ” Debuggable - Attach VS Code/PyCharm debugger
  • ๐ŸŽฏ Production parity - Same infrastructure as prod

Event-Driven Architecture

Unlike single-threaded agent loops, Soorma enables Autonomous Choreography via events:

Client                Planner              Worker              Tool
  โ”‚                     โ”‚                    โ”‚                   โ”‚
  โ”‚  goal.submitted     โ”‚                    โ”‚                   โ”‚
  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚                    โ”‚                   โ”‚
  โ”‚                     โ”‚  action.request    โ”‚                   โ”‚
  โ”‚                     โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚                   โ”‚
  โ”‚                     โ”‚                    โ”‚  tool.request     โ”‚
  โ”‚                     โ”‚                    โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚
  โ”‚                     โ”‚                    โ”‚  tool.response    โ”‚
  โ”‚                     โ”‚                    โ”‚<โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚
  โ”‚                     โ”‚  action.result     โ”‚                   โ”‚
  โ”‚                     โ”‚<โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                   โ”‚
  โ”‚  goal.completed     โ”‚                    โ”‚                   โ”‚
  โ”‚<โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                    โ”‚                   โ”‚

Roadmap

  • v0.1.0: Core SDK & CLI (soorma init, soorma dev)
  • v0.1.1: Event Service & DisCo Trinity (Planner, Worker, Tool)
  • v0.2.0: Subscriber Groups & Unified Versioning
  • v0.3.0: Memory Service & State Tracker
  • v1.0.0: Enterprise GA

License

MIT

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.2.0.tar.gz (40.1 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.2.0-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: soorma_core-0.2.0.tar.gz
  • Upload date:
  • Size: 40.1 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.2.0.tar.gz
Algorithm Hash digest
SHA256 0e0fd64576837956459b1787acac8a1a513b8868f4e821d6e6c895d4cc8dd736
MD5 558ce36feee6b0ac26df8612c7386709
BLAKE2b-256 a365a065ac2cd3da1d0c70a3a5f6dfb77b8be025e8d9231b76eace21f179ef95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: soorma_core-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 45.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7f9f89f1579c73e71d660086364a66df6b5eb4f16f5d7d2c766e20a730c53e9
MD5 37f7d9ada5bce263fd29b7397756a6a0
BLAKE2b-256 6dec6419f3767f4b0022f2f5b6d18f8c3249cf6dc8425f590d5b71d5b3100fdc

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