How kartiks417/arduclaw works
Arduclaw is an Arduino library for LLM-driven agents on constrained microcontrollers. The documented flow starts in a device sketch, uses the Arduclaw API to submit prompts through a selected provider, and returns generated text asynchronously; the provider manager also offers queued/retried and streaming requests. Separate capabilities cover device setup and configuration, communication channels, agent actions/prompts, and security/operations. Some subsystem links are documented only at a high level or are unsampled, so those links are omitted or marked unverified rather than inferred from names.
Main entry points: ProviderManager.cpp Provider manager · ConfigManager.cpp Config and portal · Arduclaw.h Arduclaw API · AsyncRequestQueue.h Async request queue
Components 26
Agent runtime
- Arduclaw API
src/Arduclaw.h - Action registry
src/core/ActionRegistry.h - Prompt manager
src/core/PromptManager.h - JSON validator
src/core/JsonValidator.h
LLM providers
- Provider manager
src/core/ProviderManager.cpp - Async request queue
src/core/AsyncRequestQueue.h - Provider interface
src/providers/BaseProvider.h - Local LLM adapter
src/providers/AC_LocalLLMProvider.cpp - OpenAI adapter
src/providers/AC_OpenAIProvider.cpp - Sarvam adapter
src/providers/AC_SarvamProvider.cpp
Device channels
- Channel manager
src/core/ChannelManager.h - HTTP channel
src/channels/HTTPChannel.h - Secure MQTT channel
src/channels/MQTTChannel.h - Serial channel
src/channels/SerialChannel.h - MQTT signing
src/core/MQTTSecurity.h
Setup and operations
- Config and portal
src/ConfigManager.cpp - Device configuration
src/ConfigManager.h - Config integrity
src/core/ConfigIntegrity.h - Signed OTA verifier
src/core/OTASignatureVerifier.h - Request tracking
src/core/RequestTracker.h - Rate limiting
src/core/RateLimiter.h - Watchdog helper
src/core/WatchdogHelper.h - MCU resource profile
src/core/MCUConfig.h - Logging
src/core/Logger.h
Other components
- Arduino sketch
- LLM service
Connections 14
- Arduino sketch → Arduclaw API: uses
- Arduclaw API → Provider manager: exposes
src/Arduclaw.h - Provider manager → Async request queue: enqueues
src/core/ProviderManager.cpp - Provider manager → Provider interface: dispatches
src/core/ProviderManager.cpp - Async request queue → Provider interface: calls
src/core/AsyncRequestQueue.h - Provider manager → Rate limiting: checks
src/core/ProviderManager.cpp - Provider manager → Request tracking: records
src/core/ProviderManager.cpp - Local LLM adapter → LLM service: posts prompt
src/providers/AC_LocalLLMProvider.cpp - OpenAI adapter → LLM service: requests completion
- Sarvam adapter → LLM service: requests completion
- Secure MQTT channel → MQTT signing: verifies and signs
src/channels/MQTTChannel.h - Config and portal → Device configuration: loads and saves
src/ConfigManager.cpp - Config and portal → Config integrity: verifies and hashes
src/ConfigManager.cpp - Config and portal → Arduino sketch: serves setup portal
src/ConfigManager.cpp