Skip to content

h-990/system_synapse

Repository files navigation

System Synapse

System Synapse is an advanced, bio-inspired AI operating system designed to bridge the gap between Large Language Models (LLMs) and local execution. It creates a nervous system for your computer, allowing AI to "think" and "act" through a robust, event-driven architecture.

🧠 Core Architecture

The system mimics a biological nervous system, distinguishing between the Brain (Decision Making), the Nervous System (Communication), and the Hand (Action).

1. Cortex Citadel (The Brain & Supervisor)

The central command node implemented in Rust (egui + tokio).

  • Neural Interface: Integrated Gemini AI (Brain) that processes natural language into structured intents.
  • Dynamic Model Discovery: Automatically scans and links to the best available Gemini model (e.g., gemini-1.5-flash, gemini-pro) upon API key entry.
  • Supervisor: Monitors the health of all connected components via a generic Heartbeat protocol.
  • Visual Cortex: A GUI dashboard for monitoring system status, chat interaction, and neural configuration.

2. Cortex Executor (The Hand)

A detached, autonomous agent that performs kinetic actions on the host machine.

  • Kinetic Engine: Listens for Command impulses and executes them via the OS shell (e.g., "Open Calculator").
  • Sensory Feedback: Captures stdout/stderr of executed commands and sends Feedback impulses back to the Citadel.
  • Vital Signs: Emits a Heartbeat every 2 seconds to signal its presence to the Supervisor.

3. The Nervous System (ZeroMQ Bus)

A low-latency, asynchronous communication bus connecting all components.

  • Protocol: JSON-based "Impulses".
  • Impulse Types:
    • Heartbeat: Component health check.
    • Command: Structured execution instruction (Citadel -> Executor).
    • Feedback: Execution result/logs (Executor -> Citadel).
    • Intention/Perception: Reserved for future cognitive flows.

🚀 Capabilities ("v1.0" State)

  • Natural Language Layout: "Open WhatsApp", "Ping google.com", "List my files".
  • Auto-Healing Connection: If the Executor dies, the Citadel detects it within 5 seconds. When it restarts, they auto-negotiate and reconnect.
  • AI Model Agnostic: The system adapts to available AI API capabilities automatically.
  • Closed-Loop Verification: The AI knows if its command failed or succeeded via the Feedback loop.

🛠️ Usage Guide

Prerequisites

  • Rust: Latest stable.
  • ZeroMQ: brew install zeromq (macOS) or apt install libzmq3-dev (Linux).
  • Gemini API Key: From Google AI Studio.

Quick Start

  1. Launch the Citadel (Brain)

    cargo run --bin cortex_citadel
    • Action: Enter your Gemini API Key in the GUI Settings.
    • Observation: Watch the chat for "🧠 Neural Link Established".
  2. Launch the Executor (Hand) Open a new terminal:

    cargo run --bin cortex_executor
    • Observation: Citadel UI "Cortex Executor" light will turn GREEN.
  3. Command & Control Type in Citadel Chat:

    "Open Calculator"

    • Chain of Events:
      1. Brain parses intent -> open -a Calculator.
      2. Citadel sends Command via ZMQ.
      3. Executor receives, executes, and captures output.
      4. Executor sends Feedback.
      5. Citadel displays: 🤖 Executor Report: ✅ Success.

📂 Project Structure

  • cortex_citadel/: The GUI and Brain logic.
    • src/brain.rs: Gemini API client & Model Discovery.
    • src/bus/: ZeroMQ implementation.
    • src/supervisor.rs: Component monitoring logic.
  • cortex_executor/: The execution agent.
    • src/main.rs: Command loop and feedback system.
  • PROTOCOL.md (internal): Detailed wire specification.

📄 License

MIT License

About

ecosystem for ai and automation with rule based structure.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages