Skip to content

Commit 8bbabb5

Browse files
authored
Update README.md
1 parent 90e3fbc commit 8bbabb5

1 file changed

Lines changed: 97 additions & 58 deletions

File tree

README.md

Lines changed: 97 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,146 @@
11
# SynapDrive-AI
22

3-
**SynapDrive-AI** is a **simulation-first** prototype of an **intent → safety → actuation** control pipeline inspired by BCI/autonomy workflows.
3+
**SynapDrive-AI** is a **simulation-first** reference implementation of an **intent → context → safety gate → actuation** pipeline inspired by autonomy + BCI workflows.
44

5-
This repo **does not** claim medical/clinical functionality. It is intentionally built to be runnable on any machine without hardware:
6-
- **Text pathway** = “decoded intent” (what a BCI decoder *could* output)
7-
- **Signal pathway** = simulated EEG-like waveforms + label-driven reasoning
5+
This repo makes **no medical/clinical claims**. It’s designed to be runnable without hardware, while still supporting **optional** real-world input pathways (BrainFlow / LSL).
86

97
---
108

11-
## What you can do with it (today)
9+
## What it does
1210

13-
- Run a full end-to-end loop: **intent → context → safety gate → actuation → evaluation**
14-
- Verify safety gating blocks low-confidence actions
15-
- View stable telemetry logs (intended for dashboards/tests)
16-
- Extend it with real adapters later (robotics, vehicles, BCI devices)
11+
- End-to-end loop: **intent → optimizer (memory + vision context) → safety gate → actuation → evaluation**
12+
- **Safe-by-default:** unknown / low-confidence intents are blocked
13+
- **Telemetry contract:** stable log schema for dashboards/tests
14+
- **Reproducibility:** record/replay (JSONL)
15+
- **Quality gates:** tests + CI + lint + type-check + coverage
16+
- **Dashboard:** local Flask UI for quick inspection
1717

1818
---
1919

2020
## Architecture (canonical pipeline)
2121

2222
```mermaid
2323
flowchart LR
24-
A[Input: decoded text OR simulated signal] --> B[Intent decode / reasoning]
25-
B --> C[Optimizer: memory + vision context]
26-
C --> D[SafetyGuard]
27-
D -->|safe| E[DecisionRouter]
28-
D -->|blocked| X[Blocked result]
29-
E --> F[ActuationEngine (simulated)]
30-
F --> G[EpisodicMemory]
31-
F --> H[MetaEvaluator]
32-
G --> C
33-
24+
A[Input: decoded text / simulated signal / BrainFlow / LSL] --> B[Intent packet]
25+
B --> C[Context optimizer: memory + vision]
26+
C --> D{SafetyGate}
27+
D -- safe --> E[DecisionRouter]
28+
D -- blocked --> X[Blocked response]
29+
E --> F[ActuationEngine (simulated)]
30+
F --> G[EpisodicMemory]
31+
F --> H[MetaEvaluator]
32+
G --> C
3433
3534
Single source of truth wiring: synapdrive_ai/pipeline.py
3635
3736
Quickstart
38-
1) Install
37+
Install
3938
python -m venv .venv
4039
source .venv/bin/activate
4140
pip install -r requirements.txt
41+
Run (decoded intent text)
42+
python -m synapdrive_ai --text "move left" --image road --no-delay
43+
python -m synapdrive_ai --text "stop" --image hazard --no-delay
44+
Run (simulated signal label)
45+
python -m synapdrive_ai --signal walk --count 3 --interval 1 --no-delay
46+
python -m synapdrive_ai --signal stop --no-delay
47+
Tests
48+
pip install -r requirements-dev.txt
49+
pytest -q
50+
Record & replay (reproducible runs)
4251
43-
2) Run one cycle (decoded intent text)
44-
python -m synapdrive_ai --text "move left" --image road
45-
python -m synapdrive_ai --text "stop" --image hazard
52+
Record a run to JSONL:
4653
47-
3) Run one cycle (simulated signal label)
48-
python -m synapdrive_ai --signal walk --count 3 --interval 1
49-
python -m synapdrive_ai --signal stop
54+
python -m synapdrive_ai --text "move left" --image road --record runs.jsonl --no-delay
55+
python -m synapdrive_ai --signal walk --count 3 --record runs.jsonl --no-delay
5056
51-
4) Run tests
52-
pytest -q
57+
Replay later (deterministic, no-delay):
58+
59+
python -m synapdrive_ai --replay runs.jsonl
60+
Dashboard (Flask)
61+
62+
Run:
63+
64+
python -m synapdrive_ai.interface.web_dashboard
65+
66+
Open:
67+
68+
http://127.0.0.1:5055
69+
70+
Optional integrations (not installed by default)
71+
BrainFlow (optional)
72+
73+
Install:
74+
75+
pip install -r requirements-brainflow.txt
76+
77+
Run (defaults to BrainFlow Synthetic board, id=0):
78+
79+
python -m synapdrive_ai --brainflow --bf-board-id 0 --bf-seconds 2 --no-delay
80+
LSL / pylsl (optional)
81+
82+
Install:
83+
84+
pip install -r requirements-lsl.txt
85+
86+
Run (recommend specifying stream type or name):
87+
88+
python -m synapdrive_ai --lsl --lsl-type EEG --lsl-seconds 2 --no-delay
89+
# or
90+
python -m synapdrive_ai --lsl --lsl-name "MyEEGStream" --lsl-seconds 2 --no-delay
91+
Repo map
92+
93+
synapdrive_ai/pipeline.py — canonical wiring (supports deterministic --no-delay)
94+
95+
synapdrive_ai/bci/intent_generator.py — conservative text → intent packet
96+
97+
synapdrive_ai/bci/signal_simulator.py — synthetic EEG-like signals
5398
54-
Repo map (what matters)
99+
synapdrive_ai/agi/core_reasoning.py — RMS-based confidence from signal energy
55100
56-
synapdrive_ai/pipeline.py
57-
Canonical end-to-end pipeline.
101+
synapdrive_ai/agi/cognitive_optimizer.py — memory + vision context injection
58102
59-
synapdrive_ai/bci/signal_simulator.py
60-
Generates EEG-like synthetic waveforms.
103+
synapdrive_ai/safety/safety_guard.py — safety gating
61104
62-
synapdrive_ai/agi/core_reasoning.py
63-
Label + waveform → structured intent packet (uses RMS energy for confidence).
105+
synapdrive_ai/action/decision_router.py — normalized result packets
64106
65-
synapdrive_ai/agi/cognitive_optimizer.py
66-
Injects memory + vision context into intent.
107+
synapdrive_ai/control/actuation_engine.py — simulated actuation + telemetry schema
67108
68-
synapdrive_ai/safety/safety_guard.py
69-
Blocks low-confidence or suspicious actions.
109+
synapdrive_ai/replay/recording.py — JSONL record/replay utilities
70110
71-
synapdrive_ai/action/decision_router.py
72-
Normalizes results and routes to actuation.
111+
synapdrive_ai/interface/web_dashboard.py — Flask dashboard
73112
74-
synapdrive_ai/control/actuation_engine.py
75-
Simulated actuator + telemetry log schema.
113+
synapdrive_ai/tests/ — contract tests (pipeline shape, telemetry keys, dashboard API)
76114
77-
synapdrive_ai/tests/
78-
Contract tests enforcing stable output + telemetry.
115+
examples/ — reviewer quickcheck + golden runs generator
79116
80-
Safety stance
117+
docs/ — architecture + safety model writeups
81118
82-
This project enforces a conservative safety default:
119+
Reviewer validation pack
83120
84-
Unknown / low-confidence intents are blocked
121+
examples/REVIEWER_QUICKCHECK.md (2–5 minute checklist)
85122
86-
Telemetry schema is treated as a contract (dashboard/tests depend on it)
123+
examples/generate_golden_runs.py → examples/golden_runs.jsonl
87124
88-
Roadmap (credible next steps)
125+
Generate & replay:
89126
90-
Add optional integration adapters (not enabled by default):
127+
python examples/generate_golden_runs.py --out examples/golden_runs.jsonl
128+
python -m synapdrive_ai --replay examples/golden_runs.jsonl
129+
Safety stance (explicit)
91130
92-
BrainFlow input stream (device or replay)
131+
Unknown or low-confidence intents are blocked
93132
94-
MNE-based feature extraction for offline datasets
133+
Stable response shapes (no crashing on drift)
95134
96-
LSL (Lab Streaming Layer) bridge for research setups
135+
Telemetry schema is a contract (UI/tests depend on it)
97136
98-
Add real actuator adapters:
137+
Non-goals:
99138
100-
ROS2 topic publisher
139+
clinical diagnosis
101140
102-
MAVLink command emitter
141+
medical-device claims
103142
104-
Game/Sim environment interface
143+
real-world safety certification for actuation
105144
106145
License
107146

0 commit comments

Comments
 (0)