AnyaSelf Docs

Events & Communication

How AnyaSelf microservices interact.

Internal Communication Flow

AnyaSelf relies heavily on the Orchestrator reaching out to other microservices sequentially or concurrently as the Vertex AI Langchain agent decides on its "Tools."

Because the stack relies on synchronous HTTP and gRPC rather than a unified message bus (like Kafka), it utilizes a webhooks & polling approach to bridge the asynchronous gaps.

Example: The Styling & Automation Flow

  1. User Request: The React client hits POST /missions/{mission_id}/chat on the api-gateway, which is forwarded to the orchestrator.
  2. LLM Loop Start: The Orchestrator's Vertex AI Agent thinks, and decides it needs to see what the user owns.
  3. Internal Tool Call (1): The Orchestrator fires an internal synchronous GET /items to the wardrobe service.
  4. Internal Tool Call (2): The Orchestrator decides a new piece is needed, and fires a synchronous POST /search to the commerce service.
  5. Session Bootstrap: The Orchestrator uses the create_hyperbeam_session tool, hitting the hyperbeam-bridge to spin up an ephemeral cloud Chromium instance.
  6. Streaming Return: The Orchestrator streams the reasoning and final tool output (the Hyperbeam URL) back to the user via Server-Sent Events (SSE).
  7. DOM Polling: The Agent (or User) now directly hits the hyperbeam-bridge looking for GET /elements and submitting POST /agent-action.
  8. Logging: After the flow terminates, the Orchestrator hits the artifacts-audit service to store a permanent transcript and outcome-summary.

Internal Auth (X-Internal-Token)

Because the microservices must trust each other (e.g., the Orchestrator must be able to read Wardrobe data without the User's explicit JWT token on every sub-call), services accept an X-Internal-Token HTTP header.

This token must match the <SERVICE>_INTERNAL_TOKEN defined in each .env file to bypass standard JWT verification barriers.

On this page