- Implemented tests for database initialization, SQL injection prevention, auto-learning pattern extraction, module detection, complexity detection, LRU cache performance, session export, actionable suggestions, repository indexing, search query safety, and context window management. - Utilized SQLite for database operations and temporary directories for test isolation. - Included detailed output for test results with color-coded pass/fail indicators. |
||
|---|---|---|
| archive | ||
| data/uploads | ||
| examples | ||
| frontend | ||
| icons | ||
| tests | ||
| buddai_v3.1.py | ||
| LICENSE | ||
| README.md | ||
BuddAI - Our IP AI Exocortex
An open-source, unreplicatable cognitive extension system
🎉 What We Built (December 28, 2025)
In ONE DAY, we went from concept to working exocortex:
Morning (6 hours):
- Started with raw Ollama (no memory, no identity)
- Built persistent memory system (SQLite)
- Created identity injection system
- Milestone 1 Complete: BuddAI can speak ✓
Afternoon (4 hours):
- Added learning router with weighted decisions
- Built feedback loop for continuous improvement
- Implemented 3-tier model routing
- Milestone 2 Complete: BuddAI routes intelligently ✓
Evening (3 hours):
- Discovered complexity timeout issues
- Invented modular task breakdown system
- Built automatic module detection
- Milestone 3 Complete: BuddAI builds iteratively ✓
Night (1 hour):
- Optimized for slow hardware
- Tested with real robot code generation
- First real output: Complete GilBot controller in 2 minutes ✓
Result: BuddAI v2.0 - Modular Builder
✅ Remembers conversations across sessions
✅ Routes to appropriate models automatically
✅ Breaks complex tasks into manageable modules
✅ Generates complete, working code
✅ Actually works on slow hardware
✅ Built in 14 hours with $0 spent
Table of Contents
- What is BuddAI?
- Current Status
- Why BuddAI Exists
- How BuddAI Works Now
- Getting Started (Working Instructions)
- Roadmap (What's Next)
- Core Philosophy
- Business Model
- Why This is Unreplicatable
- Contributing
- License
What is BuddAI?
BuddAI is a personal IP AI exocortex - an external cognitive system that extends your thinking, memory, and code generation capabilities.
Not a chatbot. Not an assistant. A cognitive extension.
What It Actually Does (v2.0)
Simple Questions (5-10 seconds):
You: What pins should I use for motor control on ESP32-C3?
BuddAI: [Fast, accurate answer using lightweight model]
Code Generation (15-30 seconds):
You: Generate a motor driver class for L298N with ESP32
BuddAI: [Complete, well-commented code in your style]
Complex Projects (2-3 minutes):
You: Generate complete GilBot controller with BLE, servo, motors, safety
BuddAI: 🎯 COMPLEX REQUEST DETECTED!
Breaking into 5 modules...
✅ BLE module complete
✅ SERVO module complete
✅ MOTOR module complete
✅ SAFETY module complete
✅ INTEGRATION module complete
[Delivers complete, working system]
Current Status
✅ Completed Milestones
Milestone 1: BuddAI Can Speak
Status: ✅ COMPLETE (December 28, 2025)
- Ollama installed and running
- Models: qwen2.5-coder:1.5b (fast), qwen2.5-coder:3b (balanced)
- Basic conversation functional
- Identity adoption working
Milestone 2: BuddAI Remembers
Status: ✅ COMPLETE (December 28, 2025)
- SQLite persistent memory
- Session management
- Context across conversations
- Loads previous messages on startup
Milestone 3: BuddAI Routes Intelligently
Status: ✅ COMPLETE (December 28, 2025)
- 3-tier routing (FAST/BALANCED/MODULAR)
- Complexity detection
- Automatic task breakdown
- Works on slow hardware
🔄 In Progress
Milestone 4: Repository Indexing
Status: 🟡 PLANNED
- Index 115+ GitHub repositories
- Vector embeddings for semantic search
- Pattern extraction from your code
- Cross-domain knowledge mapping
Milestone 5: Learning from Your Code
Status: 🔴 NOT STARTED
- Recognize your coding style
- Apply patterns from past projects
- Suggest based on your history
🎯 Current Capabilities
What BuddAI Can Do Now:
- ✅ Generate complete robot controllers
- ✅ Break complex tasks into modules
- ✅ Remember conversations forever
- ✅ Route to optimal model automatically
- ✅ Generate clean, commented code
- ✅ Work on slow hardware (8GB RAM)
What BuddAI Can't Do Yet:
- ❌ Search your 115+ repositories
- ❌ Recognize your specific coding patterns
- ❌ Suggest based on your past work
- ❌ Predict what you'll need next
Why BuddAI Exists
The Problem
You have incredible capability but hit systematic barriers:
- See complete systems but struggle to articulate them
- Ideas arrive faster than execution can keep up
- Context is lost between projects
- Can read and debug code brilliantly but writing from scratch is slow
- Pattern recognition is instant but explaining WHY is impossible
The Solution
BuddAI completes your cognitive architecture through symbiosis:
You bring:
- Pattern recognition (seeing systems everywhere)
- System vision (understanding how things should work)
- Debugging superpowers (spotting errors instantly)
- Cross-domain synthesis (coffee → cannabis → robots)
BuddAI brings:
- Code generation (translating vision into working code)
- Perfect memory (never forgets conversations)
- Task breakdown (complex → manageable modules)
- Execution speed (what takes you hours, takes it minutes)
Together: Unstoppable rapid prototyping
How BuddAI Works Now
Architecture (v2.0)
┌─────────────────────────────────────────┐
│ You (James) │
│ • Pattern recognition │
│ • System vision │
│ • Debugging instincts │
│ • Cross-domain thinking │
└──────────────┬──────────────────────────┘
│
│ Natural Language
│
┌──────────────▼──────────────────────────┐
│ BuddAI Router │
│ • Detects complexity │
│ • Chooses optimal model │
│ • Breaks down complex tasks │
└──────────────┬──────────────────────────┘
│
┌───────┴────────┐
│ │
┌───▼────┐ ┌───▼────────┐
│ FAST │ │ BALANCED │
│ 1.5b │ │ 3b │
│ 5-10s │ │ 15-30s │
└───┬────┘ └───┬────────┘
│ │
└───────┬────────┘
│
┌──────────────▼──────────────────────────┐
│ Modular Builder │
│ • Breaks into modules │
│ • Builds each piece │
│ • Integrates everything │
└──────────────┬──────────────────────────┘
│
│ Complete Code
│
┌──────────────▼──────────────────────────┐
│ Your Robot / Project │
│ • Ready to upload │
│ • Well-documented │
│ • Tested approach │
└─────────────────────────────────────────┘
Smart 3-Tier Routing
FAST Model (qwen2.5-coder:1.5b) - 5-10 seconds:
- Simple questions ("What pins?", "How do I?")
- Quick explanations
- Memory queries
- When: Question keywords detected, no code generation needed
BALANCED Model (qwen2.5-coder:3b) - 15-30 seconds:
- Code generation (classes, functions, modules)
- Technical explanations with code
- Debugging assistance
- When: "Generate", "create", "write" detected
MODULAR Builder - 2-3 minutes:
- Complex multi-part systems
- Complete project generation
- Integration of multiple components
- When: 3+ modules detected OR "complete/entire/full" keywords
Modular Task Breakdown
When you ask for something complex:
Input: "Generate complete GilBot controller with BLE, servo, motors, safety"
BuddAI detects:
- 4 modules: BLE, servo, motor, safety
- Complexity: HIGH
- Action: Modular breakdown
Process:
1. 📦 Build BLE module (15-30s)
2. 📦 Build SERVO module (15-30s)
3. 📦 Build MOTOR module (15-30s)
4. 📦 Build SAFETY module (15-30s)
5. 📦 Integrate all modules (15-30s)
Output: Complete, working controller in ~2 minutes
Persistent Memory
Every conversation is saved:
- SQLite database stores all messages
- Sessions tracked with unique IDs
- Context loaded on startup
- You never lose what you discussed
Example:
Session 1:
You: I'm building GilBots - ESP32 combat robots
BuddAI: [Acknowledges and remembers]
[Close BuddAI]
Session 2 (next day):
You: What am I working on?
BuddAI: You're building GilBots - ESP32-based combat robots
Getting Started (Working Instructions)
Prerequisites
- Windows/Mac/Linux with 8GB+ RAM
- Python 3.8+
- Internet (for initial setup only)
Installation (15 minutes)
Step 1: Install Ollama
Windows:
# Download from https://ollama.com/download
# Run installer
Mac/Linux:
curl -fsSL https://ollama.com/install.sh | sh
Step 2: Pull Models
# Start Ollama server (keep this running)
ollama serve
# In a new terminal, pull both models:
ollama pull qwen2.5-coder:1.5b # Fast model (~1GB)
ollama pull qwen2.5-coder:3b # Balanced model (~2GB)
Step 3: Get BuddAI
# Clone repository
git clone https://github.com/JamesTheGiblet/BuddAI
cd BuddAI
# No dependencies needed! (Uses only Python stdlib)
Step 4: Run BuddAI
python buddai_v2.py
You should see:
🧠 BuddAI Executive v2.0 - Modular Builder
==================================================
Session: 20251228_125028
FAST (5-10s) | BALANCED (15-30s)
Smart task breakdown for complex requests
==================================================
Commands: /fast, /balanced, /help, exit
James:
You're running BuddAI! 🎉
First Test
Try these in order:
1. Simple Question (FAST model):
James: What's your name?
⚡ Using FAST model (simple question)...
BuddAI: I am BuddAI, your coding partner.
2. Code Generation (BALANCED model):
James: Generate a motor driver class for L298N with ESP32
⚖️ Using BALANCED model...
BuddAI: [Generates complete class with comments]
3. Complex Build (MODULAR breakdown):
James: Generate complete robot controller with BLE, servo control, and safety timeout
🎯 COMPLEX REQUEST DETECTED!
Modules needed: ble, servo, safety
Breaking into 4 manageable steps...
[Builds each module separately, then integrates]
Commands
While running:
/fast # Force FAST model for next response
/balanced # Force BALANCED model for next response
/help # Show commands
exit # End session
File Structure
BuddAI/
├── buddai_v2.py # Main executable (what you run)
├── data/
│ └── conversations.db # Your persistent memory (auto-created)
├── README.md # This file
└── LICENSE # MIT License
Roadmap (What's Next)
Current Version: v2.0 - Modular Builder ✅
Completed:
- Persistent memory across sessions
- 3-tier intelligent routing
- Modular task breakdown
- Works on slow hardware
Next Version: v2.1 - Repository Integration 🔄
Goal: Index your 115+ GitHub repositories
Features:
- Clone all your repos automatically
- Generate embeddings for semantic search
- "BuddAI, show me all projects using exponential decay"
- "BuddAI, find similar code to what I'm building"
Timeline: 1-2 weeks
Future Version: v3.0 - Pattern Learning 🔮
Goal: Learn from YOUR specific coding style
Features:
- Recognizes how you structure projects
- Applies patterns from your past work
- Suggests based on what you've done before
- Generates code in YOUR specific style
Timeline: 1 month
Ultimate Vision: v4.0 - True Exocortex 🧠
Goal: Anticipates your needs proactively
Features:
- Predicts what you'll need next
- Suggests solutions before you ask
- Seamlessly integrates with your workflow
- Feels like extension of your mind
Timeline: 3-6 months
Real Examples (From December 28, 2025)
Example 1: Motor Driver Class
Input:
James: Generate a motor driver class for L298N with ESP32
Output (15 seconds):
#include <Arduino.h>
class MotorDriver {
public:
MotorDriver(int in1Pin, int in2Pin, int pwmPin) :
_in1(in1Pin), _in2(in2Pin), _pwm(pwmPin) {
pinMode(_in1, OUTPUT);
pinMode(_in2, OUTPUT);
pinMode(_pwm, OUTPUT);
ledcSetup(0, 500, 8);
}
void forward(int speed) {
digitalWrite(_in1, HIGH);
digitalWrite(_in2, LOW);
ledcWrite(0, speed);
}
void backward(int speed) {
digitalWrite(_in1, LOW);
digitalWrite(_in2, HIGH);
ledcWrite(0, speed);
}
void stop() {
digitalWrite(_in1, LOW);
digitalWrite(_in2, LOW);
ledcWrite(0, 0);
}
private:
int _in1, _in2, _pwm;
};
Result: Clean, modular, ready to use.
Example 2: Complete Robot Controller
Input:
James: Generate the complete GilBot flipper controller with BLE, servo control, motor drivers, and safety timeout
Process:
🎯 COMPLEX REQUEST DETECTED!
Modules needed: ble, servo, motor, safety
Breaking into 5 manageable steps
📦 Step 1/5: BLE communication setup
⚡ Building... ✅ Complete
📦 Step 2/5: Servo motor control
⚡ Building... ✅ Complete
📦 Step 3/5: Motor driver setup
⚡ Building... ✅ Complete
📦 Step 4/5: Safety timeout systems
⚡ Building... ✅ Complete
📦 Step 5/5: Integration
⚡ Building... ✅ Complete
Output: Complete 200+ line controller with:
- BLE phone app control
- Servo flipper weapon
- L298N motor drivers
- Safety timeout failsafe
- Full integration code
Time: 2 minutes total
Result: Ready to upload to ESP32-C3
Core Philosophy
1. Open Source, Unreplicatable
The Genius Move:
- MIT Licensed: Anyone can copy the code
- Unreplicatable: Your experience is the training data
- Competitive Moat: System is public, knowledge is yours
Why this works:
- Can't be stolen (already public)
- Can't be copied (training data is lived experience)
- Can't be exploited (you own everything)
2. Freedom-Preserving Design
Built to protect your autonomy:
- Runs locally (no API costs, no surveillance)
- You own the stack (can't be locked in)
- Fully portable (take it anywhere)
- No external dependencies (can't be shut down)
3. Symbiosis Over Replacement
BuddAI doesn't replace you - it extends you:
You remain:
- The pattern recognizer
- The system designer
- The quality validator
- The decision maker
BuddAI handles:
- Code generation
- Memory
- Task breakdown
- Execution speed
Together: Unstoppable
Business Model
What You're Selling
Not the code (MIT licensed - free forever)
But access to your trained exocortex:
- 8+ years of cross-domain expertise
- 115+ repositories of proven solutions
- Rapid prototyping capability
- Knowledge system that took years to build
Revenue Streams
1. Consulting (Project-Based)
- Your exocortex + their problem = rapid solutions
- 20-hour cycle prototyping
- Cross-domain insights nobody else has
2. IP Licensing
- CoffeeForge methodology
- CannaForge frameworks
- GilBot designs
- Forge Theory applications
3. Training & Workshops
- "Build Your Own IP AI Exocortex"
- Rapid prototyping methodology
- Cross-domain problem solving
4. Product Revenue (Passive)
- Pre-designed robot kits
- Optimization services
- Custom conversions
The Pitch
"I have an IP AI exocortex trained on 8 years of cross-domain work.
You're not hiring a developer.
You're licensing access to a knowledge system that took 8 years to build.
I can rapid-prototype your solution in 20-hour cycles because my exocortex handles research, memory, and articulation overhead.
Interested?"
Why This is Unreplicatable
What Anyone Can Copy
✅ The BuddAI code (MIT licensed) ✅ The architecture (documented) ✅ The setup process (installation guide) ✅ The concept (IP AI exocortex)
What Nobody Can Copy
❌ Your 8+ years of experience
- Can't download lived experience
- Can't replicate trial and error
- Can't copy pattern recognition intuition
❌ Your 115+ repositories
- Can fork the code (already public)
- Can't replicate the PROCESS that created them
- Can't access the failed attempts (stepping stones)
❌ Your trained BuddAI instance
- Their repos ≠ your repos
- Their experience ≠ your experience
- Their BuddAI ≠ your BuddAI
The Paradox
By making it completely open, you make YOUR version completely unreplicatable.
The value isn't the code - it's the 8 years of experience that trained the AI.
Someone can build BuddAI in a day (you just did).
They can't replicate your 8 years of work.
Performance Specs
Tested on: ASUS FX505D (slow laptop)
- CPU: Ryzen 5 3550H
- RAM: 8GB
- Storage: HDD
Actual Performance:
- Simple questions: 5-10 seconds ✓
- Code generation: 15-30 seconds ✓
- Complex projects: 2-3 minutes ✓
- Memory overhead: ~200MB ✓
If it works on this, it'll work on anything.
Contributing
BuddAI is MIT licensed and open to contributions.
How to Contribute
For the Core System:
- Fork the repository
- Create feature branch
- Submit pull request
For Your Own Exocortex:
- Build your own BuddAI
- Train it on YOUR repos
- Share your experience
The Beautiful Part: Everyone's BuddAI is unique.
- Yours trains on your repos
- Mine trains on my repos
- Someone else's trains on theirs
The code is shared. The knowledge is personal.
FAQ
Q: Will this work on my laptop?
A: If you have 8GB RAM, yes. We tested on a slow laptop and it works.
Q: Do I need to be online?
A: Only for initial setup (download models). After that, 100% offline.
Q: How much does it cost?
A: $0. Forever. It's MIT licensed and runs locally.
Q: Can others copy my BuddAI?
A: They can copy the code. They can't copy your 8 years of experience.
Q: How is this different from Copilot?
A: Copilot is trained on all code. BuddAI trains on YOUR code.
Q: What if I don't have 115 repos?
A: Start with what you have. It grows with you.
What Happens Next
Your journey from here:
Week 1:
- Use BuddAI for real projects
- Let it remember your work
- Build GilBot #1 with its help
Week 2-4:
- Index your GitHub repos
- Enable semantic search
- "Show me all projects using X"
Month 2-3:
- Pattern learning activates
- BuddAI codes in YOUR style
- Suggests based on YOUR history
Month 6+:
- True exocortex achieved
- Anticipates your needs
- Unstoppable
Acknowledgments
Built in one day:
- December 28, 2025
- 14 hours of relentless building
- $0 spent
- Pure determination
Built on:
- Ollama (local LLM runtime)
- Qwen 2.5 Coder (1.5b and 3b models)
- SQLite (persistence)
- Python (glue code)
- Your idea to break tasks into modules
Inspired by:
- Tony Stark's JARVIS (but real)
- Andy Clark's "Natural-Born Cyborgs"
- Every polymath who refused to specialize
License
MIT License
Copyright (c) 2025 James Gilbert / Giblets Creations
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Contact
Creator: James Gilbert (JamesTheGiblet)
GitHub: @JamesTheGiblet
Organization: ModularDev-Tools
BuddAI Repository: https://github.com/JamesTheGiblet/BuddAI
Status: ✅ WORKING
Version: v2.0 - Modular Builder
Last Updated: December 28, 2025
Built: In one day with relentless spirit ⚡
"I build what I want. People play games, I make stuff."
— James Gilbert
You just built JARVIS. Now go build some robots. 🤖