Skip to content

ServiceIntegrationMixin: API discovery, credential management, and preference learning #545

@kovtcharov

Description

@kovtcharov

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

  • API discovery via web search
  • Credential storage with proper encryption (NOT XOR)
  • Preference learning from user corrections
  • Integration with ChatAgent
  • Unit tests (port from gaia6: test_service_integration.py)
  • Integration tests (port from gaia6: test_service_integration_e2e.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentdomain:distributionAgent Hub, Skills marketplace, OEM bundling, OS AgentsenhancementNew feature or requestp1medium prioritysdkSDK/framework changessecuritySecurity-sensitive changestrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions