valstorm-plugin-ai — Hybrid Valstorm AI Gateway, Agent Chat, Tool Bridge & Working Memory Plugin (FI-473)
Hybrid (Python + Go) AI plugin for Open Valstorm, mounted at platform.ai (VALSTORM_PLUGINS=ai or *).
Provides:
- LLM Gateway & Native Gemini Pass-Through (
gateway_service.py):
- OpenAI-compatible
POST /v1/ai/chat/completions&POST /v1/ai/prompt(including SSE streaming). - Native Gemini pass-through
POST /v1/ai/gemini/{api_version}/models/{model_method:path}(preserves thought signatures, function calls, and streaming forapps/agent-runtime). - Model Registry (
GET /v1/ai/models— resolvesgemini-flash-latest->gemini-3.8-flashand mapsreasoning_effortto Gemini thinking levels). - Audio transcription (
POST /v1/ai/audio/transcribe) and meeting transcript synthesis (POST /v1/ai/recording/summarize).
- Agent Chat, Dynamic Cross-Plugin Tool Bridge & Runtime Proxy (
agent_chat_service.py):
POST /v1/ai/agent/chat,POST /v1/ai/agent/confirm,POST /v1/ai/agent/cancel.GET /v1/ai/tools&GET /v1/ai/agent/{agent_id}/tools— dynamically aggregates corePlatformContexttools + every enabled plugin'sai_tools(plugin_registry.get_ai_tools()) + tenant custom Pythonfunctiontools.- Cloud & Desktop Agent Runtime health and SSE run proxy (
/v1/ai/agent/runtime/status,/v1/ai/agent/runtime/run,/v1/ai/agent/runtime/run/{run_id}/events).
- Sub-10ms Go Desktop Sync (
plugins/valstorm-plugin-ai/go/):
POST /v1/ai/chat/{chat_id}/desktop-syncbacked by Native GoPlatformContext(ai_chataich_,ai_messageaim_) with atomic RedisSetNXdeduplication and real-time WebSocket broadcast.
- Chief of Staff Working Memory (
working_memory_service.py):
GET /v1/ai/memory/working-context,POST /v1/ai/memory/pin-asset,POST /v1/ai/memory/fact,DELETE /v1/ai/memory/fact(user_ai_memoryuaim_).
🤖 Agent-Assisted Quick Setup (Let the Valstorm Agent Set It Up)
You only need a Google Gemini API Key (GEMINI_API_KEY from aistudio.google.com) or Vertex AI Service Account credentials. Your Valstorm AI Agent can save your encrypted AI credentials, verify the model registry (gemini-3.8-flash), and confirm cross-plugin tool discovery across all installed plugins.
Copy-Paste Prompt for Your Valstorm Agent
Drop this prompt into Valstorm Chat:
"Set up
valstorm-plugin-aiusing my Gemini API Key<YOUR_GEMINI_API_KEY>. Save the encrypted credentials viaplatform.ai.save_credentials(...), verify connection viaai_verify_connection, and list the discovered cross-plugin AI tools."
🛠️ End-to-End DIY Setup Guide (Manual)
python
await platform.ai.save_credentials(
gemini_api_key="AIzaSy...",
default_model="gemini-flash-latest",
default_thinking_level="high",
)
# Verify active models and cross-plugin tool discovery
status = await platform.ai.verify_connection()
tools = platform.ai.get_all_tools()Running Tests (Python & Go)
bash
# Run Python unit & route tests (including cross-plugin tool discovery)
cd apps/open-api
.venv/bin/pytest tests/test_plugin_ai.py -v
# Run Go sub-10ms desktop-sync race tests
cd ../../plugins/valstorm-plugin-ai/go
go test -race -v ./...