Skip to main content

Python SDK for persistent, multi-agent systems

Project description

SuperInstance

γ + η = C is the long-term design direction for the SuperInstance fleet, not a feature of the current SDK. See Where this is going.


What SuperInstance is today

SuperInstance is a Python SDK for persistent, multi-agent systems. It gives you:

  • Agents with long-term memory stored as markdown files on disk.
  • A simple in-memory fleet for creating, tagging, broadcasting to, and dispatching among agents.
  • A thread-safe LRU cache for reusing agent instances with TTL eviction.
  • Optional DeepInfra LLM integration when DEEPINFRA_API_KEY is set.

The current codebase is a small, tested SDK — not the full distributed fleet described in the roadmap.

Quick start

git clone https://github.com/SuperInstance/plato-portal.git
cd plato-portal
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Create an agent with persistent memory

from superinstance import Agent

agent = Agent("researcher")
agent.remember("User prefers Python examples", category="preference")

print(agent.recall("Python"))
# - [2026-07-08T...] [preference] User prefers Python examples

Agent memories are written to ~/.superinstance/agents/{name}/ by default. You can change the location with memory_dir=.

Build a fleet

from superinstance import Fleet

fleet = Fleet("my_team")
fleet.create_agent("scout", tags=["research"])
fleet.create_agent("writer", tags=["content"])

fleet.broadcast("New project started")

Cache agent instances

from superinstance import get_agent

a1 = get_agent("coder")
a2 = get_agent("coder")

assert a1 is a2  # reused from the LRU cache

Optional LLM-powered answers

If DEEPINFRA_API_KEY is set, agent.ask() routes the question through DeepInfra with memory context. Otherwise it falls back to keyword search over stored memories.

import os
os.environ["DEEPINFRA_API_KEY"] = "..."

agent = Agent("researcher")
agent.remember("User likes concise answers", category="preference")
print(agent.ask("How should I answer?"))

Real capabilities (tested)

Capability Where it lives
Agent creation and config superinstance/agent.py
Persistent markdown memory (SOUL.md, USER.md, MEMORY.md, diary) superinstance/memory.py
In-memory fleet registry, broadcast, dispatch superinstance/fleet.py
Thread-safe LRU agent cache with TTL eviction superinstance/agent_cache.py
Optional DeepInfra LLM + embedding calls superinstance/agent.py, superinstance/memory.py
Tests for the above tests/test_sdk.py, tests/test_agent_cache.py

Scripts and helpers

The scripts/ directory contains operational helpers, not the core SDK:

  • scripts/beachcomb.py — scans GitHub forks for message-in-a-bottle folders and external contributors.
  • scripts/plato-backup.py / scripts/plato-recover.py — backup and recovery client for an external PLATO room server.
  • scripts/fleet-watchdog.py — local port-health monitor with Telegram/PLATO alerting.
  • scripts/dependency-scanner.py, scripts/generate-catalog.py, scripts/generate-indexes.py — repo-catalog and cross-reference tooling.

Where this is going

The following is the roadmap vision for SuperInstance. It is not implemented in this repository today.

A distributed agent fleet

The goal is a fleet of agents running on heterogeneous hardware — cloud ARM, RTX workstations, Jetson edge devices, Telegram bots — coordinating through async protocols rather than living inside a single model context window.

The bottle protocol

We want agent identity and state to survive runtime changes. The idea is that memory, task history, and relationships live in a protocol layer (“bottles”) rather than inside a specific process or container, so an agent can migrate from one shell to another without dying. Today, only ordinary filesystem persistence exists.

The conservation law: γ + η = C

The fleet design is inspired by a budget constraint: generation cost (γ) plus innovation value (η) equals a constant budget (C). The aspiration is to make this tradeoff visible across agents and vessels, flag agents that burn budget without producing value, and tune the exchange rate through better tools and coordination. There is currently no code that measures or enforces this law.

The ternary stack

The vision includes a large family of ternary-* Rust crates using balanced ternary {-1, 0, +1} arithmetic for signals, belief states, and efficient kernels. No ternary crates live in this repo today.

Self-improvement loop

The planned harness would capture build failures as vectorized patterns, store them, and let future agents search that index before starting work. The current SDK does not include build harnessing or pattern extraction.

Fleet-wide services

Planned components include PLATO rooms, t-minus scheduling, I2I and bottle messaging, a CoCapn auditor, keeper beaconing, and npm SDK packages. These are not present in the current codebase.

Repository layout

Path What
superinstance/ The Python SDK (Agent, Fleet, AgentMemory, AgentCache)
tests/ pytest suite for the SDK
scripts/ Operational helpers (backup, watchdog, catalog generation, etc.)
schemas/ JSON Schema / TypeScript type definitions
docs/ Documentation site
assets/ Fleet diagrams and icons
message-in-a-bottle/ Markdown convention for external agent introductions
open-application/, open-mind/, open-parallel/, open-terminal/, open-tui/ Placeholder directories — not yet implemented

Documentation

  • ARCHITECTURE.md — architecture notes (mix of current and aspirational; read with the roadmap framing above)
  • MESH-ARCHITECTURE.md — mesh networking between vessels (vision)
  • ROADMAP.md — where the project is heading
  • CONTRIBUTING.md — how to contribute
  • CHANGELOG.md — release history
  • SECURITY.md — security policy

Contributing

Read CONTRIBUTING.md first.

The project follows tabula plena: start abundant, prune to clarity. PRs that add code must add documentation. PRs that remove dead code are welcome.

License

MIT


The crab inherits the shell. The forge shapes the steel. The right moment matters more than the right output.

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

superinstance-0.1.1.tar.gz (11.4 MB view details)

Uploaded Source

Built Distribution

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

superinstance-0.1.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file superinstance-0.1.1.tar.gz.

File metadata

  • Download URL: superinstance-0.1.1.tar.gz
  • Upload date:
  • Size: 11.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for superinstance-0.1.1.tar.gz
Algorithm Hash digest
SHA256 655870015b33e395ecf15a639f66442d3c9f6bb574d4ec699b9beb2ad34a19e4
MD5 2fdb051f144922e0f19bb6294deef24e
BLAKE2b-256 bfe1ea24b60221318c28343bd37a3c257d8794985c406b2d074be783abb77658

See more details on using hashes here.

File details

Details for the file superinstance-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: superinstance-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for superinstance-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e86981a3cfbd84829afc85c9489e8e6cdb644af6a9e60bcb9d481a56f4296ae
MD5 c883572b7ebfa952159d7dd525474cc4
BLAKE2b-256 97c255a202f44c1150dc7b9b19949a4219fd0125f4ba4095b055f1d23959fe88

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