Add ESP32-S3 portable AI companion firmware with ethical network security scanning, BLE networking, full config portal, and persistent memory & RAG#1
Conversation
Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/4e986b25-518d-47ad-bb1b-be6cf35d3018 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/4e986b25-518d-47ad-bb1b-be6cf35d3018 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/4e986b25-518d-47ad-bb1b-be6cf35d3018 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
|
@copilot ok commit all changes please onto the main branch |
All changes from this PR are already pushed and up-to-date on the To get them onto I'm not able to push directly to
All changes are committed and pushed to this PR branch ( |
|
@copilot ok so . it will aslo need to be able to connecgt to local wifi netowrk sfor access to llms etc and can we also add bluetooth networking capabilities. there shoudl be a full config screen fora ll aspects of the app including all llms with sample configs and network setings, to agent behaviour and personality etc |
Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/22321e97-0113-4701-b064-f09c0b0ab890 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
…e dead code Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/22321e97-0113-4701-b064-f09c0b0ab890 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
Done in commit Local WiFi (multi-network)
Bluetooth (BLE)
Full tabbed config portal (visit
|
|
@copilot it also needs its own memory and rag implimentation so it can be more effective in its answering.. and have a persistance |
…n server Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/579a96ff-263f-4aae-b142-0e518af43f49 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
Agent-Logs-Url: https://github.com/magicalmutation-coder/DebbieDoesMobile/sessions/579a96ff-263f-4aae-b142-0e518af43f49 Co-authored-by: magicalmutation-coder <246345154+magicalmutation-coder@users.noreply.github.com>
Done in commit Short-term memory (on-device)
Long-term facts (NVS persisted)
Companion RAG (server-side, searchable)
New 🧠 Memory tab in the config portal (
Voice commands: "Remember that..." / "What do you know about me?" / "Forget everything" |
|
@copilot ok.. carry on.. im keen to get the first test running on this.. |
|
@copilot ok push all to the main brach |
All commits are already on this PR branch and up-to-date. To land them on |
Implements full firmware and companion server for Debbie — a voice-controlled portable AI assistant on Freenove Media Kit ESP32-S3 (FNK0102), interfacing with OpenAI Realtime API and a custom agent backend. Adds ethical network security scanning as a first-class voice-commanded feature, multi-network WiFi, Bluetooth Low Energy networking, a comprehensive tabbed configuration portal, and a full memory and retrieval-augmented generation (RAG) system for persistent, context-aware conversations.
Firmware (ESP-IDF C)
openai_client— WebSocket client to OpenAI Realtime API (gpt-4o-realtime-preview); bidirectional PCM16 audio, function-call dispatch with correctcall_idpropagation;OAI_EVT_USER_TRANSCRIPTevent captures user speech separately from AI responses;save_memorytool registered in every session so the AI can proactively store factsaudio_manager— I2S mic capture with VAD (configurable threshold), I2S speaker output, beep tonescamera_manager— OV2640 JPEG capture → base64 for vision APIdisplay_manager— LVGL animated avatar (eyes, speech bubble, state-driven colour)wifi_manager/web_server— STA+AP dual mode; multi-network fallback (up to 3 saved SSIDs tried in priority order on boot); captive portal HTML config UI; NVS persistencebluetooth_manager— BLE GATT server with the official Nordic UART Service (128-bit NUS UUIDs6E40000x-B5A3-F393-E0A9-E50E24DCCA9E); NUS RX accepts JSON config commands identical to the HTTP/configureendpoint; advertises as "Debbie" so any BLE Serial app (nRF Toolbox, Serial Bluetooth Terminal) can configure the device without joining WiFimemory_manager(new) — Short-term RAM circular buffer of the last N turns (configurable, default 20); up to 50 long-term key-value facts persisted to NVS flash; prompt enrichment injects facts + recent turns into every OpenAI session; HTTP-based companion RAG queries retrieve semantically relevant past context before each responsenotification_client— WebSocket client to companion server for WhatsApp/email/agent push notificationsnetwork_scanner— WiFi AP scan, ARP host discovery, TCP port scan (65+ ports), banner grabbing, MAC OUI lookup, HTTP probe, per-host risk scoring (0–100)vuln_reporter— Banner signature matching, port-based CVE checks (Modbus, Docker API, Redis, WEP/open WiFi, etc.), HTML/JSON/voice report formats, device self-assessmentself_agent— Full agent tools: internet HTTP GET, DNS resolution, NVD CVE API lookup, system introspection; OpenAI function-call dispatcher registering all tools as session toolsFull Tabbed Configuration Portal
Accessible at
http://192.168.4.1/(Debbie AP) or via BLE Serial:Companion Server (Node.js)
network_tools.js— nmap wrapper (restricted to RFC 1918 ranges), NVD CVE API client, HTML vulnerability report generator with full HTML escaping; report served from server-stored state (GET/network/report) rather than reflecting request bodymemory_store.js(new) — SQLite database (viabetter-sqlite3) with an FTS5 full-text search table for all conversation turns and a key-value facts table; REST API:GET /memory/query(RAG retrieval),POST /memory/turn,POST /memory/fact,GET /memory/stats,DELETE /memory/clear; graceful degradation if module is not installed; automatic pruning at 500 turnsserver.js—express-rate-limiton all sensitive routes (including memory endpoints); WebSocket handler stores device scan results server-side; mounts memory routesspotify.js— Rate-limited OAuth routes; generic error on auth failure (no exception reflection into HTML)Memory & RAG Architecture
save_memory(key, value, importance)automatically when users share personal contextsave_memorytool call; "What do you know about me?" → facts injected into context; "Forget everything" →memory_clearSecurity constraints
10.x,172.16–31.x,192.168.x) — public internet blocked at the route layerVoice commands (examples)
Original prompt