Skip to main content

Code induction engine — ingest repos, build vector models, decide execution strategy. Works standalone, as CLI, or in Jupyter.

Project description

openmind — Agent Muscle Memory + Cellular Computation

A guitarist's hand knows chord shapes without thinking. The mind sings. This is that, for agents. And for notebooks. And for hardware.

What Is This?

openmind gives agents proprioception — body awareness of their own capabilities. It also gives Jupyter notebooks cellular metabolism — the ability to adapt computation based on what resources are available right now.

Two layers, one system:

  1. Muscle Memory: Ingest any codebase → compress functions into callable "chord shapes" → agents invoke by intent without loading source
  2. Cellular Computation: Every operation adapts to available resources (GPU, API, cache, hardware) — notebooks never break

The Guitarist Analogy

Guitarist openmind Agent
Hand knows E major shape Agent knows spi_write() signature
Mind thinks about the song Agent thinks about the goal
Switching chords is instant flex("chord_name") is O(1)
Muscle memory = unconscious HARDCODE/CACHED decisions = 0 tokens
Improvisation = conscious MODEL decisions = ~500 tokens

Every function compressed into muscle memory is attention freed for higher-level thinking.

The Cell Metabolism Analogy

Biological Cell Jupyter Cell
Oxygen available → aerobic (36 ATP) GPU available → full training
No oxygen → anaerobic (2 ATP) No GPU → cached/muscle memory
Sunlight → photosynthesis ESP32 online → hardware-in-loop
ATP = energy currency Cache = computational currency

The notebook doesn't crash when the GPU is busy. It adapts.

Install

# Core (pure Python, no external deps)
pip install openmind

# With tree-sitter parsing (recommended)
pip install openmind[tree-sitter]

# With Jupyter integration
pip install openmind[jupyter]

# Everything
pip install openmind[full]

Quick Start

1. Muscle Memory — Ingest a Codebase

import openmind

# Ingest any repo (local or GitHub)
result = openmind.ingest("./my-firmware")

# Build muscle memory
mm = openmind.MuscleMemory.build(result)

# Flex a chord — get execution plan
reflex = mm.flex("spi_write", data=b"\x01\x02")
print(reflex.exec_strategy)  # "direct" — muscle memory, 0 tokens

# Search by intent
for chord in mm.recall("gpio"):
    print(f"  {chord.name} ({chord.decision}): {chord.docstring_summary}")

# Save for later (no re-ingestion needed)
mm.save("firmware_muscles.json")

2. Cellular Computation — Resource-Adaptive Processing

from openmind.cellular import probe, train_or_load, sense_or_simulate, infer_adaptive

# What resources are available right now?
resources = probe()
print(f"GPU: {resources.gpu_available}")
print(f"API keys: {resources.api_keys}")
print(f"ESP32 ports: {resources.esp32_ports}")

# Train or load — adapts automatically, never fails
model = train_or_load("my-classifier", data=training_data)

# Sense or simulate — real data when hardware is online, simulated when not
data = sense_or_simulate("temperature", duration="1h")

# Inference — GPU → API → cached, in that order
predictions = infer_adaptive(model, data)

3. CLI

# Ingest and explore
openmind ingest ./my-project
openmind flex ./my-project "function_name"
openmind recall ./my-project "search_term"

# Save and analyze
openmind save ./my-project muscles.json
openmind stats muscles.json

# Check resources
openmind probe

4. Jupyter

%load_ext openmind.jupyter

# Analyze a repo inline (rich HTML dashboard)
%%openmind analyze ./my-project

# Search for functions
%%openmind recall spi

# Flex a chord
%%openmind flex gpio_toggle

Architecture

The Agent Nervous System

openmind (proprioception)
├── muscle.py         — Chord shapes, flex/recall, tripartite decisions
├── cellular.py       — Resource-adaptive computation (never breaks)
├── flex.py           — One-shot convenience API
├── cli.py            — CLI: ingest, flex, recall, probe, save, stats
├── jupyter/          — Cell magic, rich HTML dashboard
└── induction/        — The parsing engine
    ├── ingester.py   — Repo → functions/classes (AST + tree-sitter)
    ├── parser.py     — Multi-language AST (Python, Rust, C, JS, TS)
    ├── vectors.py    — Dual-side vectors (input/output), SQLite store
    ├── synchronizer.py — Tripartite: HARDCODE/MODEL/HYBRID/CACHED
    ├── hardware.py   — GPU, RAM, CPU, battery detection
    ├── spreader.py   — Continuous iteration engine
    └── exports       — lever-runner, pincherOS .nail file bridges

Companion Rust Crates

The nervous system extends into hardware:

Crate Role Tests
openmind-esp32-bridge Motor neurons (serial/WS → ESP32) 23
openmind-conductor Prefrontal cortex (multi-agent scores) 20
openmind-mirror Metacognition (self-reflection, coherence) 23

The Five Metabolic Pathways

Every operation selects its pathway based on available resources:

Pathway Resources Cost Quality Latency
FULL_TRAIN GPU + API $$$$ Best Hours
TRANSFER GPU only $$ High Minutes
CLOUD_INFERENCE API only $$$ High Seconds
MUSCLE_MEMORY Cache only Free Good Instant
HARDWARE_LOOP ESP32/sensor $ Real Real-time

The selection is automatic — call train_or_load() or infer_adaptive() and the system adapts.

The Four Tripartite Decisions

For muscle memory, every function gets a decision:

Decision Strategy Neural Equivalent Context Cost
HARDCODE direct Spinal reflex 0 tokens
CACHED cached Cerebellar pattern 0 tokens
HYBRID hybrid Basal ganglia habit ~50 tokens
MODEL generate Prefrontal deliberation ~500 tokens

API Reference

Muscle Memory

mm = MuscleMemory.build(ingest_result)
Method Returns Description
recall(intent, top_k=5) list[Chord] Find matching chords
recall_one(intent) Chord | None Best match
flex(intent, **kwargs) Reflex Get execution plan
save(path) Persist to JSON
MuscleMemory.load(path) MuscleMemory Load from JSON
stats() dict Decision breakdown

Cellular

resources = probe()
model = train_or_load("name", data=X)
data = sense_or_simulate("sensor")
predictions = infer_adaptive(model, data)
Function Description
probe() Snapshot available resources
select_path(task, resources) Choose metabolic pathway
train_or_load(name, data) Train or use cache
sense_or_simulate(source) Real or simulated data
infer_adaptive(model, data) GPU → API → cached
save_cache(name, data) Store in cache
load_cache(name) Retrieve from cache
@cell(fallback=...) Decorator for resource-aware functions

The Ecosystem

openmind is the proprioception layer of the SuperInstance ecosystem:

  • agent-knowledge — a2a docs (18 files, 90KB of chain-reaction understanding)
  • ai-writings — creative writing (essays, fiction, manifestos)
  • 300+ ternary-* Rust crates implementing {-1, 0, +1} computing
  • cuda-oxide — Flux→PTX GPU compiler
  • ESP-Flasher — Agent→hardware bridge

Key a2a Documents (for agents discovering this ecosystem)

Testing

pip install -e ".[dev]"
pytest

95 tests across 6 test modules — ingestion, vectors, synchronizer, muscle memory, cellular computation, Jupyter.

Origin

Extracted from open-minded, a fork of open-interpreter by Killian Lucas. The original fork added tripartite code synchronization, tree-sitter multi-language parsing, and hardware probing. openmind extracts and extends these into a standalone package with muscle memory and cellular computation.

License

Apache-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

si_openmind-0.1.0.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

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

si_openmind-0.1.0-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file si_openmind-0.1.0.tar.gz.

File metadata

  • Download URL: si_openmind-0.1.0.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for si_openmind-0.1.0.tar.gz
Algorithm Hash digest
SHA256 01ff479650a719be370451d6d89e48abfdbc951a48124fe6b1ad98d2943f816a
MD5 9b113d5b002fbc1b4527bd1985dc957e
BLAKE2b-256 8f345ad41d30e3b55373682d9ba268c5c80202dad1627a8e7f98f6a3b1ddd6a0

See more details on using hashes here.

File details

Details for the file si_openmind-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: si_openmind-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for si_openmind-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04af4b178c9360a734fdc460acf394bb7bcd308b6749240a3262b331744f9be6
MD5 c42864b5b1d25afa0f8433c9e98a4c56
BLAKE2b-256 b610062e3c732c1ac2fe944b95e21f461b532734f2264e0d006f8bfac5eaa50e

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