Skip to main content

Architecture Overview

Complete architecture of the Synap Backend ecosystem


High-Level Architecture

Synap follows a pure event-driven architecture where all state changes flow through events:

UI or Automation (Agents) →Events → Workers → Data Layer (Database & File Storage)

[!NOTE] External Services in the diagram represent remote plugins that authenticate with the Data Pod via the Hub Protocol. These are plugins hosted externally that extend Data Pod functionality.


Complete User Flow

Simple Flow: Creating a Note

Complex Flow: AI-Powered Request with External Service


Core Components

Data Pod (Core OS)

  • Event Store: Immutable event log (TimescaleDB)
  • Projections: Materialized views for fast reads
  • tRPC APIs: Type-safe APIs
  • Authentication: Ory Kratos + Hydra
  • Storage: R2/MinIO for file storage
  • Local Agents: LangGraph workflows for basic tasks

Intelligence (Plugins & Services)

  • Agent Plugins: LangGraph-powered agents (single or multi-agent graphs)
  • External Services: Specialized AI services via Hub Protocol (marketplace)
  • Tool Registry: Dynamic tool registration for extensibility

Client SDK

  • TypeScript SDK: @synap/client
  • React Integration: Hooks and components
  • Real-time: WebSocket support

Key Concepts


Technology Stack

  • Runtime: Node.js 20+
  • Database: PostgreSQL with TimescaleDB + pgvector
  • Event Bus: Inngest
  • ORM: Drizzle ORM
  • API: tRPC + Hono
  • AI: LangGraph + Vercel AI SDK
  • Auth: Ory Stack (Kratos + Hydra)
  • Storage: Cloudflare R2 / MinIO

Next Steps