Skip to main content

A computational graph runtime for research pipelines, agent orchestration, and data virtualization

Project description

Soma

Soma (σῶμα — body) is a computational graph runtime for research pipelines, agent orchestration, and data virtualization. Written in Rust with Python bindings.

Part of the Nous-Soma-Chronos ecosystem:

  • Nous: Understands, reasons — research IDE, agent graphs, automation
  • Soma (this project): Executes, materializes — graphs, optimization, distributed workers
  • ChronosVector: Remembers — temporal vector database

Key Concepts

Concept Description
Filter Data transformation with fit() (learn state) and forward() (transform). Independently cacheable.
Graph Computational DAG of filters. Build with .node()/.connect() or >> / | operators.
Graph.somatize() "You think it. Soma somatizes it." — Materialize a chain/fork topology into an executable graph.
TrainingStrategy Graph-level attribute: Local, DataParallel, ModelParallel, Federated, PopulationBased.
Study Hyperparameter optimization: Grid, Random, or Bayesian (TPE) search with median/percentile pruning.
PBT Population-Based Training: evolutionary train→evaluate→exploit/explore cycles.
ExecutionPlan Compiled from graph. Variants: Sequence, Parallel, Execute, Cached, Remote, Loop, Branch.
DataStore Abstraction for data movement: Local, S3, Zarr (chunked tensors), Cached, Stream.
Worker Remote execution daemon. Auto-detects hardware, Slurm-style resource limits, token auth.
Coordinator Lightweight gateway: worker registration, routing, health monitoring.

Workspace (10 crates)

soma-macros     → proc macro (#[derive(SomaFilter)])
soma-core       → types + traits: Filter, Value, Graph, TrainingStrategy, Schema, Event
                  DataStore (Local/S3/Zarr), VirtualValue, StreamCache
soma-compiler   → Graph → ExecutionPlan (caching, parallelism, distribution)
                  Scheduler, plan visualization (Mermaid/Graphviz)
soma-runtime    → GraphSession, executor, FilterLibrary, caches, samplers, pruners
                  StudyRunner, PbtRunner, stream executor
soma-memory     → KnowledgeBase trait + MemoryKB + ChronosKB
soma-worker     → Worker, Coordinator, Protocol, EnvManager, token auth
                  Auto-detect capabilities, resource limits, CLI binary
soma-agent      → Research agent loop (observe → hypothesize → experiment → conclude)
soma-mcp        → MCP server (13 tools for code, execution, knowledge)
soma-python     → PyO3 bindings: Graph, Filter, Study, Lab, Chain/Fork operators

Quick Start

# Run all tests (355 Rust + 29 Python)
cargo test --workspace
cd soma-python && maturin develop && pytest tests/ -v

# With S3/Zarr DataStore
cargo test -p soma-core --features s3
cargo test -p soma-core --features zarr

# With ChronosVector
cargo test -p soma-memory --features chronos

# MCP server
cargo run -p soma-mcp -- /path/to/project

Python Usage

from soma import Filter, Graph, Study, search

class Scaler(Filter):
    _differentiable = True

    def fit(self, x, y=None):
        return {"mean": sum(x) / len(x)}

    def forward(self, x, state):
        return [v - state["mean"] for v in x]

class Model(Filter):
    lr: float = search(0.001, 1.0, scale="log")

    def fit(self, x, y=None):
        return {"weights": [0.5] * len(x)}

    def forward(self, x, state):
        return [v * w for v, w in zip(x, state["weights"])]

# Build with >> (chain) and | (fork)
g = Graph.somatize(Scaler() >> Model())
g.fit(train_data)
result = g.forward(test_data)

# Visualize
print(g.to_mermaid())
print(g.to_text())

# Complex topologies
g = Graph.somatize(
    (LoadA() >> NormA() | LoadB() >> NormB())
    >> Aggregate()
    >> Backbone()
    >> (HeadA() | HeadB())
)

# Events
g.on_event(lambda e: print(e["event_type"], e.get("node_id", "")))

# Distributed training
g.set_strategy(DataParallel(num_replicas=4))
g.set_coordinator("http://coord:9090", token="sk-xxx")

Workers

# Start a worker with auto-detected capabilities
soma-worker --port 8080 --tags gpu,training --token sk-xxx

# With resource limits (Slurm-style)
soma-worker --cpus 4 --memory 8G --gpus 1 --max-concurrent 2

# With coordinator auto-registration
soma-worker --coordinator http://coord:9090 --token sk-xxx --tags gpu

Workers auto-detect CPU cores, RAM, GPUs (nvidia-smi), and Python environments. Each worker creates isolated venv/conda environments per job with incremental dependency updates.

Feature Flags

  • soma-core/s3 — S3-compatible DataStore (AWS, Backblaze B2, MinIO)
  • soma-core/zarr — Zarr v3 chunked tensor storage with compression
  • soma-memory/chronos — ChronosVector-backed KnowledgeBase

License

Elastic License 2.0

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

somatize-0.2.5.tar.gz (156.1 kB view details)

Uploaded Source

Built Distributions

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

somatize-0.2.5-cp313-cp313-manylinux_2_38_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.38+ x86-64

somatize-0.2.5-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

somatize-0.2.5-cp312-cp312-manylinux_2_38_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.38+ x86-64

somatize-0.2.5-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

somatize-0.2.5-cp311-cp311-manylinux_2_38_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.38+ x86-64

somatize-0.2.5-cp311-cp311-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file somatize-0.2.5.tar.gz.

File metadata

  • Download URL: somatize-0.2.5.tar.gz
  • Upload date:
  • Size: 156.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for somatize-0.2.5.tar.gz
Algorithm Hash digest
SHA256 95b568b0af0209e44a0b30d77fbaa6d7b74ec2f498d028ebe974b719cbb85b07
MD5 ce506779f58fc877fdfef16c4f92ed96
BLAKE2b-256 b0d4724801f053617cfbafbced258192848f1a7feca189a668aa7d7f157732c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5.tar.gz:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-0.2.5-cp313-cp313-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for somatize-0.2.5-cp313-cp313-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 d966c557c96cc184eeb33ab93e5a39e564bf3e1c2f403a1a1acf102c118bff66
MD5 f35411b55fddfea5e3f2bf27fe82e285
BLAKE2b-256 8274b4fab6b2a70b9533ac6a98d9615a42a87ea03225d98ececb979c0e877915

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5-cp313-cp313-manylinux_2_38_x86_64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-0.2.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for somatize-0.2.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8474e06b09b01cbc7366d0dcbff98a44a53a626c7e33ac9f6b16e97a833f2502
MD5 bf7c42f69f7d787158c5be972a305a2e
BLAKE2b-256 1121af3d94e1a371ae224c8225b958aa1e7e15bf352c8940f687345109c2366f

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-0.2.5-cp312-cp312-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for somatize-0.2.5-cp312-cp312-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 fe2e338c316131d2b44c263d5f635a4c0e35e94c3ef846420d8054e0bce288c7
MD5 fb1d8112104964672b71e9f9a5af1951
BLAKE2b-256 f9140bfbb788bb0b6a65ba8248e75dac19bbd4a2edb2ddc1b6f3e364de2c87ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5-cp312-cp312-manylinux_2_38_x86_64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-0.2.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for somatize-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9a3fa642006ef912ce9fe7567582ed8eee7b94977d79abcad8bf4df33fa88cce
MD5 a4d367853bebba8d1b7729ae42cff3af
BLAKE2b-256 bbd1f89edbfecbe66495dde82b9807063d524dceaa6e0e0344a0fdd9b3937693

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-0.2.5-cp311-cp311-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for somatize-0.2.5-cp311-cp311-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 966d52ef4b8224ff09bd9e9c03bee7b1b50dfbbcb6c5429742671174795f6e77
MD5 77874d1ba93d04cb3dd1e87b6e266454
BLAKE2b-256 463ecd1dd5932a8813ad9c37e598e2d88d14fee9419a25c5fc4c2272fd129c84

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5-cp311-cp311-manylinux_2_38_x86_64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-0.2.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for somatize-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d92127e223aee5ee34e0f06d4a65b7e603cb989668b62c7c455562a5bd679e61
MD5 43029ded9c1563eb1dc302d018c31554
BLAKE2b-256 e731c909dfc3bbe10c2c8193ff863ee1103c3c11b8d5be18153b78ac1327847c

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-0.2.5-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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