Skip to content

rohanbalixz/BrainLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrainLab OS

A Local Cognitive Operating System for macOS

Overview

BrainLab OS is a local, privacy-first cognitive system designed to simulate key aspects of human thought — memory, reflection, and association. It runs entirely offline on macOS and leverages local LLM inference via Ollama (Llama 3.1). This project demonstrates how a personal AI agent can store, recall, and reason about experiences using modular memory systems and graph-based reflection.

Core Features

Module Function
memory.py Stores and retrieves memories using FAISS + SQLite
reflection.py Performs LLM-based summarization and reasoning
graph_analysis.py Visualizes semantic connections between stored memories
brain.py Natural-language conversational interface
brain (CLI script) Enables global terminal interaction: brain "..."

Architecture

  1. Memory Layer (Hippocampus): Encodes input text into vector embeddings using sentence-transformers and stores them in FAISS and SQLite.
  2. Reflection Layer (Cortex): Uses Llama 3.1 (via Ollama) to synthesize insights and summarize recent activity.
  3. Visualization Layer (Perceptual Network): Builds a similarity graph of ideas using NetworkX and Matplotlib.
  4. Interface Layer (Prefrontal Cortex): The brain.py interface allows users to converse naturally, with context from recent memories shaping LLM responses.

Installation

Requirements

  • macOS (tested on Apple Silicon M3 Pro)
  • Python 3.9+
  • Ollama installed (brew install ollama)
  • Model pulled locally (ollama pull llama3.1)

Setup

git clone https://github.com/rohanbalixz/BrainLab.git
cd BrainLab
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

If no requirements.txt yet, manually install:

pip install numpy==1.26.4 torch==2.1.0 faiss-cpu==1.7.4 transformers==4.35.2 sentence-transformers==2.2.2 huggingface-hub==0.19.4 matplotlib networkx

Usage

Run the brain in natural language:

brain "hello"
brain "add I studied small-world networks"
brain "recall graph theory"
brain "reflect"
brain "visualize"

Everything runs locally — no external API calls, no internet dependency.

Example Conversation

$ brain "hello"
Hello. How have you been today?

$ brain "what's up"
Not much. I’ve been thinking about our last discussion on network theory.

$ brain "reflect"
I noticed your interests revolve around complex systems and AI design.
They seem deeply interconnected through ideas of modularity and resilience.

Academic Context

This project was developed as a Master's in Data Science capstone to explore how symbolic cognition, neural embeddings, and local inference can form the foundation of a personal knowledge operating system.

Future Work

  • Add long-term memory consolidation (periodic compression of embeddings)
  • Integrate emotion tagging and mood context
  • Introduce event-driven reflection scheduling
  • Add voice-based interface layer (macOS Speech APIs)

Author

Rohan Bali
M.S. Data Science, University of Massachusetts Dartmouth
GitHub: rohanbalixz
LinkedIn: rohan-bali-301345293

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors