Skip to content
View SuperInstance's full-sized avatar

Block or report SuperInstance

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
SuperInstance/README.md

SuperInstance

Conservation spectral framework: persistent multi-agent AI with spectral resource management

What This Does

SuperInstance is the main Python SDK for building persistent, multi-agent AI systems. It provides agents with long-term memory (stored as markdown files), fleet management for coordinating multiple agents, and a spectral conservation framework that treats agent resources (compute, attention, memory) as conserved quantities governed by spectral laws.

The Key Idea

Think of a fleet of agents like a physical system: there's a total "energy budget" that's conserved. When one agent consumes more resources, others get less. The spectral framework tracks this through eigenvalues of the agent-resource matrix — dominant eigenvalues indicate overloaded agents, spectral gaps indicate good load distribution. This isn't a metaphor; it's enforced mathematically.

Install

pip install superinstance

Quick Start

from superinstance.agent import Agent, AgentConfig
from superinstance.fleet import Fleet
from superinstance.memory import AgentMemory

# Create an agent with persistent memory
config = AgentConfig(
    name="researcher",
    model="gpt-4",
    temperature=0.7,
    max_tokens=4096,
)
agent = Agent(config)

# The agent remembers across sessions (stored at ~/.superinstance/agents/researcher/)
agent.remember("User prefers concise summaries")

# Create a fleet
fleet = Fleet(name="analysis-team")
fleet.add_agent(agent)
fleet.add_agent(Agent(AgentConfig(name="coder", model="gpt-4")))

# Dispatch a task
result = fleet.dispatch("Analyze this dataset and write a summary")
print(result)

# Check spectral balance
balance = fleet.spectral_balance()
print(f"Spectral gap: {balance.gap}")
print(f"Dominant agent: {balance.dominant_agent}")

API Reference

agent

Type Description
AgentConfig { name, model, temperature, max_tokens } Agent configuration.
Agent(config) Create a new agent. Memory auto-loads from disk.
send(message) Send a message, get a response.
remember(fact) Store a fact in long-term memory (persisted to ~/.superinstance/agents/{name}/memory.md).
recall(query) Retrieve relevant memories.
spawn_sub_agent(name) Create a child agent that inherits context.

fleet

Type Description
Fleet(name) Create a named fleet.
add_agent(agent) Add an agent to the fleet.
dispatch(task) Dispatch a task to the best-suited agent.
broadcast(message) Send to all agents.
spectral_balance() Returns SpectralBalance { gap, dominant_agent, eigenvalues }.

memory

Type Description
AgentMemory(name) Persistent memory manager for an agent.
store(key, value) Store a key-value pair.
retrieve(key) Get a stored value.
search(query) Semantic search over memories.
path File path: ~/.superinstance/agents/{name}/.

exceptions

Exception When
SuperInstanceError Base error.
AgentNotFoundError Referenced agent doesn't exist.
FleetConnectionError Can't reach an agent in the fleet.

How It Works

  1. Agent Creation: Each agent gets a directory at ~/.superinstance/agents/{name}/ with a memory.md file for long-term memory.
  2. Memory: Facts are stored as markdown. On startup, the agent loads its memory file. The remember() method appends entries.
  3. Fleet Coordination: The Fleet maintains a spectral model of agent capabilities. When a task arrives, it's routed to the agent whose capability eigenvalue best matches the task's spectral profile.
  4. Conservation: Total fleet resources are tracked. The spectral balance method computes the eigenvalue gap — a large gap means one agent dominates, which triggers rebalancing.

Testing

Tests covering:

  • Agent lifecycle (create, send, remember, recall)
  • Memory persistence across sessions
  • Fleet dispatch and broadcast
  • Spectral balance computation
  • Sub-agent spawning
  • Exception handling

License

MIT

Pinned Loading

  1. cocapn cocapn Public

    repo-first Agent for local or cloud. grow an agent in a repo using the repo itself as the muscle-memory. Run from localhost, from pages.dev, or embedded into any platform app. Move to gitlab or any…

    Python 3 1

  2. constraint-theory-core constraint-theory-core Public

    Unified geometric constraint theory — Eisenstein lattices, deadband funnels, Laman rigidity, metronome consensus, holonomy verification. 83 tests, zero deps.

    Rust 3

  3. mud-arena mud-arena Public

    Flow-state engineering arena — agents run forward simulations, listen for spectral nudges, maintain conservation in Plato's cave. Conservation spectral framework meets live agent rooms.

    Python 3

  4. sonar-vision sonar-vision Public

    Depth sounder → underwater video prediction with self-supervised multi-camera learning

    Python 2

  5. forgemaster forgemaster Public

    Constraint-aware agentic compiler — assembles optimal components from the SuperInstance ecosystem with proof-carrying guarantees

    Python 2 1

  6. sunset-ecosystem sunset-ecosystem Public

    Trinity-architecture agent ecosystem: ethos, pathos, logos. Agents sunset with dignity and seed the next generation.

    Python 1