Skip to content

Kilolost13/kilo-guardian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🧠 Kilo Guardian - AI Cognitive Support System

Privacy-First, Self-Hosted, Kubernetes-Deployed AI Assistant

License: MIT K3s React Python


✨ Overview

Kilo Guardian is a comprehensive cognitive support system running entirely on your local infrastructure. It combines AI-powered memory management, health tracking, financial oversight, and habit formation into a unified, privacy-first platform.

Current Status: βœ… 100% Operational - 15 microservices running on K3s


🎯 Quick Access

From Your Tablet or Mobile Device

# SSH tunnel to access Kilo Guardian
ssh -L 3000:localhost:30000 -L 8000:localhost:30800 kilo@192.168.68.66

Then open: http://localhost:3000

See docs/TABLET_ACCESS.md for detailed setup.

From Server (Local)


πŸ—οΈ Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          KILO GUARDIAN KUBERNETES CLUSTER               β”‚
β”‚                    (K3s on Pop!_OS)                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

External Access (NodePort):
β”œβ”€β–Ί Frontend (30000)  ──► React UI
└─► Gateway (30800)   ──► API Router

Kubernetes Services (ClusterIP):
β”œβ”€β–Ί Frontend Service     : kilo-frontend (80)
β”œβ”€β–Ί API Gateway         : kilo-gateway (8000)
β”‚
β”œβ”€β–Ί Core Services:
β”‚   β”œβ”€β–Ί Medications     : kilo-meds (9001)
β”‚   β”œβ”€β–Ί Medications v2  : kilo-meds-v2 (9001)
β”‚   β”œβ”€β–Ί Reminders       : kilo-reminder (9002)
β”‚   β”œβ”€β–Ί Habits          : kilo-habits (9003)
β”‚   β”œβ”€β–Ί Financial       : kilo-financial (9005)
β”‚   └─► Library         : kilo-library (9006)
β”‚
β”œβ”€β–Ί Intelligence Layer:
β”‚   β”œβ”€β–Ί AI Brain        : kilo-ai-brain (9004)
β”‚   β”œβ”€β–Ί ML Engine       : kilo-ml-engine (9008)
β”‚   └─► Ollama          : kilo-ollama (11434)
β”‚
β”œβ”€β–Ί I/O Services:
β”‚   β”œβ”€β–Ί Camera          : kilo-cam (9007)
β”‚   β”œβ”€β–Ί Voice           : kilo-voice (9009)
β”‚   └─► USB Transfer    : kilo-usb-transfer (8006)
β”‚
└─► Real-Time:
    └─► SocketIO        : kilo-socketio (9010)

All services in namespace: kilo-guardian
Network: 10.42.0.0/16 (K3s Pod Network)

Technology Stack

Infrastructure:

  • K3s (Lightweight Kubernetes)
  • Kubernetes 1.28+
  • Pop!_OS 22.04 LTS

Backend:

  • Python 3.11
  • FastAPI
  • SQLite + SQLModel
  • sentence-transformers
  • Ollama (Local LLM)

Frontend:

  • React 19.2.3
  • TypeScript 4.9.5
  • TailwindCSS
  • React Router v6

πŸ“¦ What's Running

Service Pod Name Status Function
Frontend kilo-frontend βœ… Running React UI
Gateway kilo-gateway βœ… Running API Router & Auth
Medications kilo-meds βœ… Running Med tracking & OCR
Medications v2 kilo-meds-v2 βœ… Running Updated version
Reminders kilo-reminder βœ… Running Timeline & alerts
Habits kilo-habits βœ… Running Habit tracking
AI Brain kilo-ai-brain βœ… Running RAG & Memory
Financial kilo-financial βœ… Running Budget & receipts
Library kilo-library βœ… Running Knowledge base
Camera kilo-cam βœ… Running Pose detection
ML Engine kilo-ml-engine βœ… Running ML processing
Voice kilo-voice βœ… Running Voice input
USB Transfer kilo-usb-transfer βœ… Running File transfer
SocketIO kilo-socketio βœ… Running Real-time events
Ollama kilo-ollama βœ… Running Local LLM

Total: 15 pods, all healthy


πŸš€ Features

πŸ”’ Privacy & Security

  • βœ… 100% Self-Hosted - All data stays on your server
  • βœ… No Cloud Dependencies - Fully offline capable
  • βœ… Local AI - Ollama runs LLMs on-premise
  • βœ… Encrypted Storage - Sensitive data protected
  • βœ… Network Isolation - K3s internal networking

πŸ€– AI Intelligence

  • βœ… Semantic Memory - RAG-powered context recall
  • βœ… Smart Suggestions - AI-driven recommendations
  • βœ… Natural Language - Chat interface for all modules
  • βœ… Context Awareness - Learns your patterns

πŸ“± Tablet-Optimized

  • βœ… Touch-Friendly UI - Large touch targets (60px+)
  • βœ… Responsive Design - Works on any screen size
  • βœ… PWA-Ready - Install as app on mobile
  • βœ… Fast Performance - Optimized React build

πŸ”§ Production Features

  • βœ… High Availability - K3s self-healing
  • βœ… Service Discovery - Automatic DNS routing
  • βœ… Health Monitoring - Built-in health checks
  • βœ… Easy Scaling - Kubernetes-native scaling
  • βœ… Rolling Updates - Zero-downtime deployments

πŸ“š Documentation

Getting Started

Operations

Features

Technical Details


πŸ› οΈ Common Operations

Check System Status

# View all pods
kubectl get pods -n kilo-guardian

# Check services
kubectl get svc -n kilo-guardian

# View logs for a service
kubectl logs -n kilo-guardian deployment/kilo-gateway --tail=50

Manage Services

# Restart a service
kubectl rollout restart deployment/kilo-meds -n kilo-guardian

# Scale a service
kubectl scale deployment/kilo-ml-engine --replicas=2 -n kilo-guardian

# View resource usage
kubectl top pods -n kilo-guardian

Troubleshooting

# Check pod details
kubectl describe pod <pod-name> -n kilo-guardian

# Get pod events
kubectl get events -n kilo-guardian --sort-by='.lastTimestamp'

# Access pod shell
kubectl exec -it deployment/kilo-gateway -n kilo-guardian -- /bin/sh

See docs/OPERATIONS.md for comprehensive operations guide.


πŸ” Project Structure

kilo-guardian-core/
β”œβ”€β”€ services/              # Microservice implementations
β”‚   β”œβ”€β”€ ai_brain/         # RAG & memory search
β”‚   β”œβ”€β”€ cam/              # Camera & pose detection
β”‚   β”œβ”€β”€ financial/        # Budget & transaction tracking
β”‚   β”œβ”€β”€ gateway/          # API router & authentication
β”‚   β”œβ”€β”€ habits/           # Habit tracking & analytics
β”‚   β”œβ”€β”€ library_of_truth/ # Knowledge base & PDF storage
β”‚   β”œβ”€β”€ meds/             # Medication management
β”‚   β”œβ”€β”€ ml_engine/        # ML processing engine
β”‚   β”œβ”€β”€ reminder/         # Timeline & reminders
β”‚   β”œβ”€β”€ socketio-relay/   # Real-time communication
β”‚   β”œβ”€β”€ usb_transfer/     # File transfer service
β”‚   β”œβ”€β”€ voice/            # Voice input processing
β”‚   └── k3s_manager/      # K3s cluster management
β”‚
β”œβ”€β”€ frontend/             # React frontend
β”‚   └── kilo-react-frontend/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ pages/
β”‚       β”‚   └── services/
β”‚       └── public/
β”‚
β”œβ”€β”€ core/                 # Core agent functionality
β”‚   β”œβ”€β”€ kilo_agent.py    # Main agent logic
β”‚   β”œβ”€β”€ kilo_agent_brain.py
β”‚   β”œβ”€β”€ kilo_agent_ui.py # UI interface (canonical)
β”‚   β”œβ”€β”€ kilo_memory.py   # Memory management
β”‚   β”œβ”€β”€ kilo_router.py   # Command routing
β”‚   └── kilo_pod_access.py
β”‚
β”œβ”€β”€ shared/               # Shared utilities & config
β”‚   β”œβ”€β”€ config.py        # Centralized configuration
β”‚   β”œβ”€β”€ db.py            # Unified database access (SQLModel)
β”‚   β”œβ”€β”€ models/          # Shared data models
β”‚   └── utils/           # Helper functions
β”‚
β”œβ”€β”€ k3s/                  # Kubernetes manifests
β”‚   β”œβ”€β”€ deployments/
β”‚   β”œβ”€β”€ services/
β”‚   └── configmaps/
β”‚
β”œβ”€β”€ docs/                 # Documentation
β”‚   β”œβ”€β”€ ROADMAPS/        # Future planning
β”‚   β”œβ”€β”€ REPORTS/         # Historical reports
β”‚   └── *.md             # Current documentation
β”‚
β”œβ”€β”€ scripts/              # Operational scripts
β”‚   β”œβ”€β”€ deploy-to-k3s.sh
β”‚   β”œβ”€β”€ check-status.sh
β”‚   └── launch_*.sh
β”‚
β”œβ”€β”€ legacy/               # Legacy/experimental code
β”‚   β”œβ”€β”€ v1/              # Old version 1
β”‚   β”œβ”€β”€ v2/              # Old version 2
β”‚   └── *.py             # Archived experiments
β”‚
β”œβ”€β”€ kilo_agent_api.py     # Agent API service
β”œβ”€β”€ kilo_proactive_agent.py # Proactive monitoring agent
└── start-proactive-agent.sh # Agent startup script


🎯 Module Features

πŸ’Š Medications

  • Medication schedule with timers
  • Prescription OCR scanning
  • Dosage tracking
  • Prescriber management

πŸ“… Reminders

  • Timeline view
  • Voice input support
  • Recurring reminders
  • Priority levels

πŸ’° Financial

  • Budget tracking
  • Receipt OCR
  • Transaction categorization
  • Monthly summaries
  • Goal setting

βœ… Habits

  • Daily habit tracking
  • Streak counters
  • Progress visualization
  • Weekly calendar view
  • Custom icons

🧠 AI Brain

  • Semantic memory search
  • RAG-powered chat
  • Context-aware responses
  • Memory consolidation

πŸ“š Library

  • PDF knowledge base
  • Document search
  • Note management
  • Tag organization

πŸ“Š Performance

  • Pod Startup: < 30 seconds
  • API Response: < 100ms (avg)
  • Frontend Load: < 2 seconds
  • Memory Usage: ~4GB total
  • CPU Usage: < 20% (idle)

πŸ” Security Features

  • βœ… Network Policies - Service-to-service restrictions
  • βœ… RBAC - Role-based access control
  • βœ… Pod Security - Non-root containers
  • βœ… Secret Management - Kubernetes secrets
  • βœ… Internal DNS - ClusterIP-only backend services
  • βœ… NodePort Limited - Only frontend & gateway exposed

πŸ§ͺ Testing

API Testing

# Test gateway
curl http://localhost:30800/meds/

# Test financial summary
curl http://localhost:30800/financial/summary

# Test reminder list
curl http://localhost:30800/reminder/reminders

Frontend Testing

Open http://localhost:30000 and verify:

  • βœ… Dashboard loads
  • βœ… All 6 modules accessible
  • βœ… Data persists across refreshes
  • βœ… Navigation works smoothly

🚨 Troubleshooting

Services Won't Start

  1. Check pod status: kubectl get pods -n kilo-guardian
  2. View logs: kubectl logs <pod-name> -n kilo-guardian
  3. Check events: kubectl get events -n kilo-guardian

Can't Access Frontend

  1. Verify NodePort: kubectl get svc -n kilo-guardian
  2. Check firewall: sudo ufw status
  3. Test locally: curl http://localhost:30000

Database Issues

  1. Check pod restart count: kubectl get pods -n kilo-guardian
  2. View logs for errors
  3. Verify volume mounts: kubectl describe pod <pod-name> -n kilo-guardian

🀝 Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.


πŸ“ License

MIT License - see LICENSE for details.


πŸ™ Acknowledgments

  • K3s - Lightweight Kubernetes
  • Ollama - Local LLM runtime
  • sentence-transformers - Semantic embeddings
  • FastAPI - Modern Python API framework
  • React - UI framework
  • TailwindCSS - Utility-first CSS

πŸ“ž Support

For issues or questions:


πŸŽ‰ Current Status

βœ… Infrastructure: K3s cluster fully operational βœ… Backend: 13 microservices running βœ… Frontend: React UI deployed and accessible βœ… Database: SQLite with persistent storage βœ… AI: Ollama LLM ready βœ… Networking: All services communicating βœ… Documentation: Comprehensive guides available

System Health: 100% - All 15 pods running


Built for privacy-conscious users who want powerful AI without compromising data sovereignty

πŸ€– Deployed with Kubernetes | πŸ”’ Secured by Design | 🏠 Runs Entirely On-Premise

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors