Architecture
The engineering picture — what the system is made of, and how a single request travels from a click to a finished, logged piece of work.
The shape of the system
Three surfaces, one backend. The web portal, the REST API and the Telegram bot are all thin entry points — the agents, the intelligence services and your data live in a single backend behind them.
Authentication, agent loop, tool execution, intelligence services
The pieces
A request, end to end
Take a concrete task — “find prospects and draft a cold-email campaign.” Here is the full path it travels:
- 1Entry & authenticationThe request arrives from the portal, the API or Telegram. The API server verifies the caller and resolves which business this is — every downstream query is scoped to that one tenant.
- 2Routed to an agentThe work is handed to the right agent — here, Marketing Senior — and the agent runtime starts its loop.
- 3Context assembledBefore any model call, the runtime injects the business brain — archetype, profile, voice, knowledge base — plus any high-priority messages waiting in the agent's mailbox.
- 4The agent loopThe model is called; it asks to run tools — research prospects, draft copy; the runtime executes them and feeds the results back. This repeats until the task is complete.
- 5Approval gateThe campaign is ready to send — an outward, irreversible action — so execution pauses. This gate is enforced in code; the agent cannot pass it on its own.
- 6ExecutionYou approve. The runtime sends the campaign through the email service and writes every action to the decision trail.
- 7Learning, laterHours later, a queued job reads the campaign's results and feeds the lessons back into the business brain — closing the loop.
Multi-tenancy & isolation
Rigyx is multi-tenant — many businesses on shared infrastructure — but each business is fully walled off. The tenant a request belongs to is derived from its authenticated identity, never from anything the caller can set freely, and every database query is scoped to it.
Staying up
Two design choices keep the system dependable. The model layer tracks each provider's health and fails over to a healthy one when a provider degrades — a single provider outage does not stop work. And autonomous services never fail silently: if a background job breaks, you are told, rather than discovering it from missing results.