Quick Start · Features · Architecture · Usage · Deploy · Contributing
The event-driven nervous system connecting all OpenSIN agents — durable, replayable, and Ouroboros-aware.
1. Start NATSdocker compose up -d nats |
2. Installnpm install |
3. Testnpm test |
Tip
Full setup: npm install && docker compose up -d nats && npm test — all tests cover pub/sub, request/reply, durable resume, and replay.
| Capability | Description | Status |
|---|---|---|
| JetStream Integration | Stable connect/reconnect wrapper with validated event envelopes | ✅ |
| Durable Consumers | Resume from last acked message after restart — no context loss | ✅ |
| Request/Reply | Synchronous request-response pattern over NATS subjects | ✅ |
| Event Envelopes | Standardized envelope with correlation IDs and source tracking | ✅ |
| Subject Taxonomy | Documented subject hierarchy for all event types | ✅ |
| Ouroboros Bridge | Auto-bridge to memory (rememberLesson) and capability (registerCapability) |
✅ |
| Python SDK | SQLite-backed memory with apply_event_envelope() |
✅ |
| Agent Runtime | Reusable publish/consume patterns for A2A agents | ✅ |
Core Exports (TypeScript)
import {
OpenCodeJetStreamClient, // Stable NATS connection wrapper
OpenSinAgentRuntime, // Agent runtime with pub/sub patterns
SUBJECTS, // Subject taxonomy constants
createEventEnvelope, // Envelope factory with validation
} from "@opensin/neural-bus";flowchart TB
subgraph Agents["Agent Runtimes"]
HERMES[A2A-SIN-Hermes]
ORCH[A2A-SIN-Orchestrator]
CLI[OpenCode CLI]
end
subgraph Bus["Neural Bus (NATS JetStream)"]
PUB[Publish]
SUB[Subscribe]
REQ[Request/Reply]
DUR[Durable Consumer]
end
subgraph Memory["Ouroboros Memory"]
LESSON[rememberLesson]
CAPA[registerCapability]
SQLITE[(SQLite Memory)]
end
HERMES --> PUB
ORCH --> REQ
CLI --> PUB
PUB --> SUB
REQ --> SUB
SUB --> DUR
DUR --> LESSON
DUR --> CAPA
LESSON --> SQLITE
CAPA --> SQLITE
classDef agentClass fill:#e1f5fe,stroke:#01579b,stroke-width:2px
classDef busClass fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef memClass fill:#fce4ec,stroke:#880e4f,stroke-width:2px
class HERMES,ORCH,CLI agentClass
class PUB,SUB,REQ,DUR busClass
class LESSON,CAPA,SQLITE memClass
For detailed subject taxonomy see docs/jetstream-subject-taxonomy.md.
const runtime = new OpenSinAgentRuntime({
agentId: "a2a-sin-hermes",
sessionId: "session-001",
bus,
});
await runtime.publishObservation({
message: "worker booted",
branch: "feat/new-feature",
});
await runtime.publishLessonLearned({
context: "JetStream reconnect handling",
lesson: "Reuse durable consumer name for automatic restart recovery.",
successRate: 1.0,
});const worker = await runtime.consumeAssignedWork(
{
subject: SUBJECTS.workflowRequest,
stream: "OPENSIN_WORKFLOW_EVENTS",
durableName: "my-worker",
deliverPolicy: "all",
ackWaitMs: 500,
},
async (event) => {
console.log("received work", event.payload);
},
);Important
Reusing the same durableName after restart resumes from the last acked message — no context resend needed!
// Server side
const server = await bus.serveRequests(SUBJECTS.workflowRequest, async (request) => {
return createEventEnvelope({
kind: "workflow.reply",
subject: SUBJECTS.workflowReply,
source: { id: "a2a-sin-orchestrator", runtime: "agent-runtime" },
correlationId: request.id,
payload: { accepted: true },
});
});
// Client side
const reply = await bus.request(
createEventEnvelope({
kind: "workflow.request",
subject: SUBJECTS.workflowRequest,
source: { id: "opencode-cli", runtime: "opencode-cli" },
payload: { task: "resume durable work" },
}),
);The bus automatically invokes bridge methods when events include ouroboros.rememberLesson or ouroboros.registerCapability:
| Bridge Method | Purpose | Storage |
|---|---|---|
rememberLesson(record) |
Store learned lessons for future agents | SQLite |
registerCapability(record) |
Register new agent capabilities | SQLite |
The Python SDK exposes apply_event_envelope() for mirroring JetStream envelopes into SQLite-backed memory.
| Methode | Target | Zweck |
|---|---|---|
| Local | docker compose up -d nats |
Development with embedded NATS |
| OCI VM | 92.5.60.87:4222 |
Production NATS JetStream server |
| Package | @opensin/neural-bus (npm) |
Shared library for all agents |
Warning
The production NATS server runs on the OCI VM. All agents must connect to nats://92.5.60.87:4222 in production.
| Document | Purpose |
|---|---|
| Subject Taxonomy | Complete NATS subject hierarchy |
| ARCHITECTURE.md | System architecture deep dive |
| CONTRIBUTING.md | How to contribute |
- JetStream integration surface with stable connect/reconnect
- Validated event envelopes with correlation IDs
- Durable consumer pattern for restart recovery
- Request/reply helpers over NATS subjects
- Ouroboros bridge points (rememberLesson, registerCapability)
- Python SDK with SQLite-backed memory
- Documented subject taxonomy
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Start NATS:
docker compose up -d nats - Install:
npm install - Run tests:
npm test - Commit and push
- Open a Pull Request
MIT. See LICENSE for details.
Built by OpenSIN-AI Fleet
This project is part of the OpenSIN-AI agent ecosystem and uses the unified agent configuration system:
| Datei | Zweck |
|---|---|
oh-my-sin.json |
Zentrales Team Register |
oh-my-openagent.json |
Subagenten-Modelle |
my-sin-team-infra.json |
Team Infrastructure Modelle |
| Subagent | Modell |
|---|---|
| explore | nvidia-nim/stepfun-ai/step-3.5-flash |
| librarian | nvidia-nim/stepfun-ai/step-3.5-flash |
Bei Codebase-Analyse auf grossen Projekten MUESSEN Agenten 5-10 parallele explore + 5-10 librarian-Agenten starten.