Summary
Port ServiceIntegrationMixin from gaia6 (agents/base/service_integration.py, ~1,089 lines). Enables agents to discover external APIs, securely store credentials, and learn user preferences.
Components
API Discovery
discover_api(service) — Search web for API docs, determine auth type
setup_integration(service, credential_data) — Store credentials + create API skill
- Uses Perplexity API for documentation discovery
Credential Management
store_credential(service, data) / get_credential(service) / refresh_credential(service)
list_credentials() — List stored service credentials
- Encrypted storage in KnowledgeDB
Preference Learning
- Explicit corrections: user says "no, always use dark mode"
- Implicit confirmations: user accepts agent's choice
- Decision workflow: observe → recall → apply rules → fallback
⚠️ Security Note
gaia6 uses XOR + base64 with a machine-derived key (SHA-256 of hostname). The code explicitly states this is "lightweight obfuscation, not production crypto."
Before shipping, upgrade to:
- Windows: DPAPI via
win32crypt or keyring library
- Linux/macOS:
keyring library (uses system keychain)
- Fallback:
cryptography library with Fernet (proper AES)
Dependencies
- SharedAgentState (KnowledgeDB for storage)
- MemoryMixin (preference learning builds on memory)
Source
Port from gaia6/src/gaia/agents/base/service_integration.py
Acceptance Criteria
Summary
Port ServiceIntegrationMixin from gaia6 (
agents/base/service_integration.py, ~1,089 lines). Enables agents to discover external APIs, securely store credentials, and learn user preferences.Components
API Discovery
discover_api(service)— Search web for API docs, determine auth typesetup_integration(service, credential_data)— Store credentials + create API skillCredential Management
store_credential(service, data)/get_credential(service)/refresh_credential(service)list_credentials()— List stored service credentialsPreference Learning
gaia6 uses XOR + base64 with a machine-derived key (SHA-256 of hostname). The code explicitly states this is "lightweight obfuscation, not production crypto."
Before shipping, upgrade to:
win32cryptorkeyringlibrarykeyringlibrary (uses system keychain)cryptographylibrary with Fernet (proper AES)Dependencies
Source
Port from
gaia6/src/gaia/agents/base/service_integration.pyAcceptance Criteria