# Electric > Electric provides the data primitives and infra to build collaborative, multi-agent systems. Including Postgres Sync, Durable Streams, TanStack DB and PGlite. > [!IMPORTANT] Instructions for coding agents > Coding agents should read [AGENTS.md](/AGENTS.md) for instructions and guidance. ## Table of Contents ### Hosted products - [Electric Streams](/streams.md): The data primitive for the agent loop. Persistent, addressable, real-time streams over plain HTTP. - [Electric Sync](/sync.md): Composable sync primitives for multi-agent systems — Postgres Sync, TanStack DB and PGlite. ### Sync primitives - [Postgres Sync](/sync/postgres-sync.md): Read-path sync engine for Postgres that handles partial replication, data delivery and fan-out. - [TanStack DB](/sync/tanstack-db.md): Reactive client store for building super-fast apps. With sub-millisecond reactivity and instant local writes. - [PGlite](/sync/pglite.md): Embeddable Postgres with reactivity and sync. For a full database inside your client or runtime. ### Guides - [Auth - Guide](/docs/sync/guides/auth.md): How to do authentication and authorization with Electric. - [Shapes - Guide](/docs/sync/guides/shapes.md): Shapes are the core primitive for controlling sync in the ElectricSQL system. - [Writes - Guide](/docs/sync/guides/writes.md): How to do local writes and write-path sync with Electric. - [Installation - Guide](/docs/sync/guides/installation.md): How to install and run Electric. - [PostgreSQL Permissions - Guide](/docs/sync/guides/postgres-permissions.md): How to create and configure PostgreSQL users with the necessary permissions for Electric. - [Deployment - Guide](/docs/sync/guides/deployment.md): How to deploy the Electric sync engine. - [Upgrading - Guide](/docs/sync/guides/upgrading.md): How to upgrade the Electric sync service with minimal disruption. - [Sharding - Guide](/docs/sync/guides/sharding.md): How to use Electric with sharded PostgreSQL databases. - [Security - Guide](/docs/sync/guides/security.md): How to secure data access and encrypt data with Electric. - [Troubleshooting - Guide](/docs/sync/guides/troubleshooting.md): Tips and FAQs on how to run Electric successfully. - [Client development - Guide](/docs/sync/guides/client-development.md): How to write an Electric client for any language that speaks HTTP and JSON. ### API - [HTTP API](/docs/sync/api/http.md): The HTTP API is the primary, low level API for syncing data with Electric. - [Sync service](/docs/sync/api/config.md): Configuration options for the Electric sync engine. #### Clients - [Typescript Client](/docs/sync/api/clients/typescript.md): Electric provides an Typescript client for streaming Shapes from Postgres into the web browser and other Javascript environments. - [Elixir Client](/docs/sync/api/clients/elixir.md): Electric provides an Elixir client and a Phoenix integration. ### Integrations #### Frameworks - [LiveStore - Integrations](/docs/sync/integrations/livestore.md): How to use Electric with LiveStore. - [MobX - Integrations](/docs/sync/integrations/mobx.md): How to use Electric with MobX. - [Next.js - Integrations](/docs/sync/integrations/next.md): How to use Electric with Next.js. - [Phoenix - Integrations](/docs/sync/integrations/phoenix.md): How to use Electric with Phoenix. - [React - Integrations](/docs/sync/integrations/react.md): How to use Electric with React. - [Redis - Integrations](/docs/sync/integrations/redis.md): How to use Electric to sync data into Redis. - [TanStack - Integrations](/docs/sync/integrations/tanstack.md): How to use Electric with TanStack. Including using Electric for read-path sync and TanStack Query for optimistic writes. - [Yjs - Integrations](/docs/sync/integrations/yjs.md): How to use Electric with Yjs. #### Platforms - [Amazon Web Services (AWS) - Integrations](/docs/sync/integrations/aws.md): How to deploy Electric on Amazon Web Services (AWS). - [Cloudflare - Integrations](/docs/sync/integrations/cloudflare.md): How to use Electric with Cloudflare. - [Crunchy Data - Integrations](/docs/sync/integrations/crunchy.md): How to use Electric with Crunchy Bridge managed Postgres. - [Digital Ocean - Integrations](/docs/sync/integrations/digital-ocean.md): How to deploy Electric on Digital Ocean. - [Expo - Integrations](/docs/sync/integrations/expo.md): How to use Electric to sync data into Expo apps. - [Fly.io - Integrations](/docs/sync/integrations/fly.md): How to deploy Electric on Fly. - [Google Cloud Platform (GCP) - Integrations](/docs/sync/integrations/gcp.md): How to deploy Electric on Google Cloud Platform (GCP). - [Neon - Integrations](/docs/sync/integrations/neon.md): How to use Electric with Neon's serverless Postgres. - [Netlify - Integrations](/docs/sync/integrations/netlify.md): How to deploy Electric apps on Netlify. - [PlanetScale - Integrations](/docs/sync/integrations/planetscale.md): How to use Electric with PlanetScale Postgres. - [Render - Integrations](/docs/sync/integrations/render.md): How to deploy Electric on Render. - [Supabase - Integrations](/docs/sync/integrations/supabase.md): How to use Electric with Supabase. Including syncing data out of Supabase Postgres and into Supabase Edge Functions. ### Reference - [Alternatives](/docs/sync/reference/alternatives.md): Alternative projects and systems for syncing data and building local-first applications. - [Benchmarks - Reference](/docs/sync/reference/benchmarks.md): We run benchmarks for the Electric sync engine and the Electric Cloud, which hosts the sync engine behind a CDN. - [Literature](/docs/sync/reference/literature.md): A selection of research papers that relate to local-first software and distributed databases. - [Telemetry](/docs/sync/reference/telemetry.md): Electric provides telemetry data for real-time system monitoring. ### Sync primitives - [Postgres Sync](/sync/postgres-sync.md): Read-path sync engine for Postgres that handles partial replication, data delivery and fan-out. - [TanStack DB](/sync/tanstack-db.md): Reactive client store for building super-fast apps. With sub-millisecond reactivity and instant local writes. - [PGlite](/sync/pglite.md): Embeddable Postgres with reactivity and sync. For a full database inside your client or runtime. ### Guides - [Auth - Guide](/docs/sync/guides/auth.md): How to do authentication and authorization with Electric. - [Shapes - Guide](/docs/sync/guides/shapes.md): Shapes are the core primitive for controlling sync in the ElectricSQL system. - [Writes - Guide](/docs/sync/guides/writes.md): How to do local writes and write-path sync with Electric. - [Installation - Guide](/docs/sync/guides/installation.md): How to install and run Electric. - [PostgreSQL Permissions - Guide](/docs/sync/guides/postgres-permissions.md): How to create and configure PostgreSQL users with the necessary permissions for Electric. - [Deployment - Guide](/docs/sync/guides/deployment.md): How to deploy the Electric sync engine. - [Upgrading - Guide](/docs/sync/guides/upgrading.md): How to upgrade the Electric sync service with minimal disruption. - [Sharding - Guide](/docs/sync/guides/sharding.md): How to use Electric with sharded PostgreSQL databases. - [Security - Guide](/docs/sync/guides/security.md): How to secure data access and encrypt data with Electric. - [Troubleshooting - Guide](/docs/sync/guides/troubleshooting.md): Tips and FAQs on how to run Electric successfully. - [Client development - Guide](/docs/sync/guides/client-development.md): How to write an Electric client for any language that speaks HTTP and JSON. ### API - [HTTP API](/docs/sync/api/http.md): The HTTP API is the primary, low level API for syncing data with Electric. - [Sync service](/docs/sync/api/config.md): Configuration options for the Electric sync engine. #### Clients - [Typescript Client](/docs/sync/api/clients/typescript.md): Electric provides an Typescript client for streaming Shapes from Postgres into the web browser and other Javascript environments. - [Elixir Client](/docs/sync/api/clients/elixir.md): Electric provides an Elixir client and a Phoenix integration. ### Integrations #### Frameworks - [LiveStore - Integrations](/docs/sync/integrations/livestore.md): How to use Electric with LiveStore. - [MobX - Integrations](/docs/sync/integrations/mobx.md): How to use Electric with MobX. - [Next.js - Integrations](/docs/sync/integrations/next.md): How to use Electric with Next.js. - [Phoenix - Integrations](/docs/sync/integrations/phoenix.md): How to use Electric with Phoenix. - [React - Integrations](/docs/sync/integrations/react.md): How to use Electric with React. - [Redis - Integrations](/docs/sync/integrations/redis.md): How to use Electric to sync data into Redis. - [TanStack - Integrations](/docs/sync/integrations/tanstack.md): How to use Electric with TanStack. Including using Electric for read-path sync and TanStack Query for optimistic writes. - [Yjs - Integrations](/docs/sync/integrations/yjs.md): How to use Electric with Yjs. #### Platforms - [Amazon Web Services (AWS) - Integrations](/docs/sync/integrations/aws.md): How to deploy Electric on Amazon Web Services (AWS). - [Cloudflare - Integrations](/docs/sync/integrations/cloudflare.md): How to use Electric with Cloudflare. - [Crunchy Data - Integrations](/docs/sync/integrations/crunchy.md): How to use Electric with Crunchy Bridge managed Postgres. - [Digital Ocean - Integrations](/docs/sync/integrations/digital-ocean.md): How to deploy Electric on Digital Ocean. - [Expo - Integrations](/docs/sync/integrations/expo.md): How to use Electric to sync data into Expo apps. - [Fly.io - Integrations](/docs/sync/integrations/fly.md): How to deploy Electric on Fly. - [Google Cloud Platform (GCP) - Integrations](/docs/sync/integrations/gcp.md): How to deploy Electric on Google Cloud Platform (GCP). - [Neon - Integrations](/docs/sync/integrations/neon.md): How to use Electric with Neon's serverless Postgres. - [Netlify - Integrations](/docs/sync/integrations/netlify.md): How to deploy Electric apps on Netlify. - [PlanetScale - Integrations](/docs/sync/integrations/planetscale.md): How to use Electric with PlanetScale Postgres. - [Render - Integrations](/docs/sync/integrations/render.md): How to deploy Electric on Render. - [Supabase - Integrations](/docs/sync/integrations/supabase.md): How to use Electric with Supabase. Including syncing data out of Supabase Postgres and into Supabase Edge Functions. ### Reference - [Alternatives](/docs/sync/reference/alternatives.md): Alternative projects and systems for syncing data and building local-first applications. - [Benchmarks - Reference](/docs/sync/reference/benchmarks.md): We run benchmarks for the Electric sync engine and the Electric Cloud, which hosts the sync engine behind a CDN. - [Literature](/docs/sync/reference/literature.md): A selection of research papers that relate to local-first software and distributed databases. - [Telemetry](/docs/sync/reference/telemetry.md): Electric provides telemetry data for real-time system monitoring. ### Sync primitives - [Postgres Sync](/sync/postgres-sync.md): Read-path sync engine for Postgres that handles partial replication, data delivery and fan-out. - [TanStack DB](/sync/tanstack-db.md): Reactive client store for building super-fast apps. With sub-millisecond reactivity and instant local writes. - [PGlite](/sync/pglite.md): Embeddable Postgres with reactivity and sync. For a full database inside your client or runtime. ### Guides - [Auth - Guide](/docs/sync/guides/auth.md): How to do authentication and authorization with Electric. - [Shapes - Guide](/docs/sync/guides/shapes.md): Shapes are the core primitive for controlling sync in the ElectricSQL system. - [Writes - Guide](/docs/sync/guides/writes.md): How to do local writes and write-path sync with Electric. - [Installation - Guide](/docs/sync/guides/installation.md): How to install and run Electric. - [PostgreSQL Permissions - Guide](/docs/sync/guides/postgres-permissions.md): How to create and configure PostgreSQL users with the necessary permissions for Electric. - [Deployment - Guide](/docs/sync/guides/deployment.md): How to deploy the Electric sync engine. - [Upgrading - Guide](/docs/sync/guides/upgrading.md): How to upgrade the Electric sync service with minimal disruption. - [Sharding - Guide](/docs/sync/guides/sharding.md): How to use Electric with sharded PostgreSQL databases. - [Security - Guide](/docs/sync/guides/security.md): How to secure data access and encrypt data with Electric. - [Troubleshooting - Guide](/docs/sync/guides/troubleshooting.md): Tips and FAQs on how to run Electric successfully. - [Client development - Guide](/docs/sync/guides/client-development.md): How to write an Electric client for any language that speaks HTTP and JSON. ### API - [HTTP API](/docs/sync/api/http.md): The HTTP API is the primary, low level API for syncing data with Electric. - [Sync service](/docs/sync/api/config.md): Configuration options for the Electric sync engine. #### Clients - [Typescript Client](/docs/sync/api/clients/typescript.md): Electric provides an Typescript client for streaming Shapes from Postgres into the web browser and other Javascript environments. - [Elixir Client](/docs/sync/api/clients/elixir.md): Electric provides an Elixir client and a Phoenix integration. ### Integrations #### Frameworks - [LiveStore - Integrations](/docs/sync/integrations/livestore.md): How to use Electric with LiveStore. - [MobX - Integrations](/docs/sync/integrations/mobx.md): How to use Electric with MobX. - [Next.js - Integrations](/docs/sync/integrations/next.md): How to use Electric with Next.js. - [Phoenix - Integrations](/docs/sync/integrations/phoenix.md): How to use Electric with Phoenix. - [React - Integrations](/docs/sync/integrations/react.md): How to use Electric with React. - [Redis - Integrations](/docs/sync/integrations/redis.md): How to use Electric to sync data into Redis. - [TanStack - Integrations](/docs/sync/integrations/tanstack.md): How to use Electric with TanStack. Including using Electric for read-path sync and TanStack Query for optimistic writes. - [Yjs - Integrations](/docs/sync/integrations/yjs.md): How to use Electric with Yjs. #### Platforms - [Amazon Web Services (AWS) - Integrations](/docs/sync/integrations/aws.md): How to deploy Electric on Amazon Web Services (AWS). - [Cloudflare - Integrations](/docs/sync/integrations/cloudflare.md): How to use Electric with Cloudflare. - [Crunchy Data - Integrations](/docs/sync/integrations/crunchy.md): How to use Electric with Crunchy Bridge managed Postgres. - [Digital Ocean - Integrations](/docs/sync/integrations/digital-ocean.md): How to deploy Electric on Digital Ocean. - [Expo - Integrations](/docs/sync/integrations/expo.md): How to use Electric to sync data into Expo apps. - [Fly.io - Integrations](/docs/sync/integrations/fly.md): How to deploy Electric on Fly. - [Google Cloud Platform (GCP) - Integrations](/docs/sync/integrations/gcp.md): How to deploy Electric on Google Cloud Platform (GCP). - [Neon - Integrations](/docs/sync/integrations/neon.md): How to use Electric with Neon's serverless Postgres. - [Netlify - Integrations](/docs/sync/integrations/netlify.md): How to deploy Electric apps on Netlify. - [PlanetScale - Integrations](/docs/sync/integrations/planetscale.md): How to use Electric with PlanetScale Postgres. - [Render - Integrations](/docs/sync/integrations/render.md): How to deploy Electric on Render. - [Supabase - Integrations](/docs/sync/integrations/supabase.md): How to use Electric with Supabase. Including syncing data out of Supabase Postgres and into Supabase Edge Functions. ### Reference - [Alternatives](/docs/sync/reference/alternatives.md): Alternative projects and systems for syncing data and building local-first applications. - [Benchmarks - Reference](/docs/sync/reference/benchmarks.md): We run benchmarks for the Electric sync engine and the Electric Cloud, which hosts the sync engine behind a CDN. - [Literature](/docs/sync/reference/literature.md): A selection of research papers that relate to local-first software and distributed databases. - [Telemetry](/docs/sync/reference/telemetry.md): Electric provides telemetry data for real-time system monitoring. ### Demo apps - [Burn](/sync/demos/burn.md): Agentic system built on Postgres and a real-time sync stack. - [AI Chat](/sync/demos/ai-chat.md): Resilient, multi-user, multi-agent AI chat app powered by Electric. - [Linearlite](/sync/demos/linearlite.md): Local-first project management app built with Electric and PGlite. - [Notes](/sync/demos/notes.md): Collaborative note-taking app with sync powered by Electric and Yjs. - [Pixel art](/sync/demos/pixel-art.md): Collaborative pixel art editor with real-time multiplayer editing. ### Technical examples - [Bash](/sync/demos/bash.md): Example using Electric from a bash script. - [Encryption](/sync/demos/encryption.md): Example of how to implement encryption with Electric. - [Gatekeeper auth](/sync/demos/gatekeeper-auth.md): Example of the gatekeeper pattern for API-based auth with Electric. - [Next.js](/sync/demos/nextjs.md): Example of an Electric app using Next.js. - [Phoenix LiveView](/sync/demos/phoenix-liveview.md): Example of a Phoenix LiveView app using Electric. - [Proxy auth](/sync/demos/proxy-auth.md): Example showing how to authorize access to Electric using a proxy. - [React](/sync/demos/react.md): Basic example of an Electric app using React. - [Redis](/sync/demos/redis.md): Example showing how to sync into Redis from Electric. - [Remix](/sync/demos/remix.md): Example of an Electric app using Remix. - [Tanstack](/sync/demos/tanstack.md): Example of an Electric app using Tanstack Query for optimistic state. - [Todo app](/sync/demos/todo-app.md): This is a classic TodoMVC example app, developed using Electric. - [Write patterns](/sync/demos/write-patterns.md): Four different patterns for handling writes in an Electric application. - [Yjs](/sync/demos/yjs.md): This is an example application using Electric with Yjs. ### Electric Sync - [Electric Sync](/sync.md): Composable sync primitives for multi-agent systems — Postgres Sync, TanStack DB and PGlite. ### Sync primitives - [Postgres Sync](/sync/postgres-sync.md): Read-path sync engine for Postgres that handles partial replication, data delivery and fan-out. - [TanStack DB](/sync/tanstack-db.md): Reactive client store for building super-fast apps. With sub-millisecond reactivity and instant local writes. - [PGlite](/sync/pglite.md): Embeddable Postgres with reactivity and sync. For a full database inside your client or runtime. ### Demo apps - [Chat Starter](/agents/demos/chat-starter.md): Multi-agent chatroom where philosopher agents debate, answer questions, and react to messages in real time. - [Deep Survey](/agents/demos/deep-survey.md): Multi-agent research app where an orchestrator coordinates a swarm of explorer agents to build a live knowledge base. ### Technical examples - [Playground](/docs/agents/examples/playground.md): Technical examples for experimenting with Electric Agents coordination patterns. ### Demo apps - [Durable Doom](/streams/demos/durable-doom.md): Doom on Durable Streams. Live spectating, time-travel, and fork-to-continue — all client-side, no backend. - [Collaborative AI Editor](/streams/demos/collaborative-ai-editor.md): Collaborative rich text editor where an AI agent is a server-side CRDT peer. - [Territory Wars](/streams/demos/territory-wars.md): Multiplayer territory capture game built with Yjs CRDTs on Durable Streams. ### Sync primitives - [Postgres Sync](/sync/postgres-sync.md): Read-path sync engine for Postgres that handles partial replication, data delivery and fan-out. - [TanStack DB](/sync/tanstack-db.md): Reactive client store for building super-fast apps. With sub-millisecond reactivity and instant local writes. - [PGlite](/sync/pglite.md): Embeddable Postgres with reactivity and sync. For a full database inside your client or runtime. ### Guides - [Auth - Guide](/docs/sync/guides/auth.md): How to do authentication and authorization with Electric. - [Shapes - Guide](/docs/sync/guides/shapes.md): Shapes are the core primitive for controlling sync in the ElectricSQL system. - [Writes - Guide](/docs/sync/guides/writes.md): How to do local writes and write-path sync with Electric. - [Installation - Guide](/docs/sync/guides/installation.md): How to install and run Electric. - [PostgreSQL Permissions - Guide](/docs/sync/guides/postgres-permissions.md): How to create and configure PostgreSQL users with the necessary permissions for Electric. - [Deployment - Guide](/docs/sync/guides/deployment.md): How to deploy the Electric sync engine. - [Upgrading - Guide](/docs/sync/guides/upgrading.md): How to upgrade the Electric sync service with minimal disruption. - [Sharding - Guide](/docs/sync/guides/sharding.md): How to use Electric with sharded PostgreSQL databases. - [Security - Guide](/docs/sync/guides/security.md): How to secure data access and encrypt data with Electric. - [Troubleshooting - Guide](/docs/sync/guides/troubleshooting.md): Tips and FAQs on how to run Electric successfully. - [Client development - Guide](/docs/sync/guides/client-development.md): How to write an Electric client for any language that speaks HTTP and JSON. ### API - [HTTP API](/docs/sync/api/http.md): The HTTP API is the primary, low level API for syncing data with Electric. - [Sync service](/docs/sync/api/config.md): Configuration options for the Electric sync engine. #### Clients - [Typescript Client](/docs/sync/api/clients/typescript.md): Electric provides an Typescript client for streaming Shapes from Postgres into the web browser and other Javascript environments. - [Elixir Client](/docs/sync/api/clients/elixir.md): Electric provides an Elixir client and a Phoenix integration. ### Integrations #### Frameworks - [LiveStore - Integrations](/docs/sync/integrations/livestore.md): How to use Electric with LiveStore. - [MobX - Integrations](/docs/sync/integrations/mobx.md): How to use Electric with MobX. - [Next.js - Integrations](/docs/sync/integrations/next.md): How to use Electric with Next.js. - [Phoenix - Integrations](/docs/sync/integrations/phoenix.md): How to use Electric with Phoenix. - [React - Integrations](/docs/sync/integrations/react.md): How to use Electric with React. - [Redis - Integrations](/docs/sync/integrations/redis.md): How to use Electric to sync data into Redis. - [TanStack - Integrations](/docs/sync/integrations/tanstack.md): How to use Electric with TanStack. Including using Electric for read-path sync and TanStack Query for optimistic writes. - [Yjs - Integrations](/docs/sync/integrations/yjs.md): How to use Electric with Yjs. #### Platforms - [Amazon Web Services (AWS) - Integrations](/docs/sync/integrations/aws.md): How to deploy Electric on Amazon Web Services (AWS). - [Cloudflare - Integrations](/docs/sync/integrations/cloudflare.md): How to use Electric with Cloudflare. - [Crunchy Data - Integrations](/docs/sync/integrations/crunchy.md): How to use Electric with Crunchy Bridge managed Postgres. - [Digital Ocean - Integrations](/docs/sync/integrations/digital-ocean.md): How to deploy Electric on Digital Ocean. - [Expo - Integrations](/docs/sync/integrations/expo.md): How to use Electric to sync data into Expo apps. - [Fly.io - Integrations](/docs/sync/integrations/fly.md): How to deploy Electric on Fly. - [Google Cloud Platform (GCP) - Integrations](/docs/sync/integrations/gcp.md): How to deploy Electric on Google Cloud Platform (GCP). - [Neon - Integrations](/docs/sync/integrations/neon.md): How to use Electric with Neon's serverless Postgres. - [Netlify - Integrations](/docs/sync/integrations/netlify.md): How to deploy Electric apps on Netlify. - [PlanetScale - Integrations](/docs/sync/integrations/planetscale.md): How to use Electric with PlanetScale Postgres. - [Render - Integrations](/docs/sync/integrations/render.md): How to deploy Electric on Render. - [Supabase - Integrations](/docs/sync/integrations/supabase.md): How to use Electric with Supabase. Including syncing data out of Supabase Postgres and into Supabase Edge Functions. ### Reference - [Alternatives](/docs/sync/reference/alternatives.md): Alternative projects and systems for syncing data and building local-first applications. - [Benchmarks - Reference](/docs/sync/reference/benchmarks.md): We run benchmarks for the Electric sync engine and the Electric Cloud, which hosts the sync engine behind a CDN. - [Literature](/docs/sync/reference/literature.md): A selection of research papers that relate to local-first software and distributed databases. - [Telemetry](/docs/sync/reference/telemetry.md): Electric provides telemetry data for real-time system monitoring. ### Demo apps - [Chat Starter](/agents/demos/chat-starter.md): Multi-agent chatroom where philosopher agents debate, answer questions, and react to messages in real time. - [Deep Survey](/agents/demos/deep-survey.md): Multi-agent research app where an orchestrator coordinates a swarm of explorer agents to build a live knowledge base. ### Technical examples - [Playground](/docs/agents/examples/playground.md): Technical examples for experimenting with Electric Agents coordination patterns. ### Usage - [Overview](/docs/agents/usage/overview.md): High level overview of the Electric Agents system and developer APIs. - [Defining entities](/docs/agents/usage/defining-entities.md): Register entity types with the EntityRegistry, define custom state collections, typed schemas, and handler functions. - [Writing handlers](/docs/agents/usage/writing-handlers.md): Implement entity handlers using HandlerContext and WakeEvent, with patterns for first wake, messaging, and tool use. - [Configuring the agent](/docs/agents/usage/configuring-the-agent.md): Set up LLM agents with ctx.useAgent(), including model selection, system prompts, tools, and test responses. - [Context composition](/docs/agents/usage/context-composition.md): Control what goes into the agent's context window using ctx.useContext() with token-budgeted sources, cache tiers, and imperative context entries. - [Defining tools](/docs/agents/usage/defining-tools.md): Create stateless, stateful, and handler-scoped tools for the LLM agent loop. - [Managing state](/docs/agents/usage/managing-state.md): Declare and manage persistent entity state using custom collections with typed CRUD operations. - [Spawning & coordinating](/docs/agents/usage/spawning-and-coordinating.md): Spawn child entities, observe existing ones, send messages, and use EntityHandle for coordination. - [Waking entities](/docs/agents/usage/waking-entities.md): How entity handlers get invoked - the triggers that produce wakes, how wake config threads through spawn/observe/observe(db(...)), and how to read a WakeEvent in a handler. - [Shared state](/docs/agents/usage/shared-state.md): Coordinate across entities with shared state streams, schema definition, and cross-entity reads and writes. - [Clients & React](/docs/agents/usage/clients-and-react.md): Observe Electric Agents entities from app code, build reactive StreamDB handles, and render chat timelines with the React useChat hook. - [Programmatic runtime client](/docs/agents/usage/programmatic-runtime-client.md): Use createRuntimeServerClient to spawn entities, send messages, register wakes, manage schedules, and connect shared state from application code. - [App setup](/docs/agents/usage/app-setup.md): Connect your app to the Electric Agents runtime with createRuntimeHandler, webhooks, and type registration. - [Embedded built-ins](/docs/agents/usage/embedded-builtins.md): Embed the built-in Horton, worker, and coder runtime in your own process using @electric-ax/agents, BuiltinAgentsServer, or the entrypoint helpers. - [Testing](/docs/agents/usage/testing.md): Test entity handlers with testResponses for LLM mocking, plus unit and integration testing patterns. ### Reference - [CLI](/docs/agents/reference/cli.md): Command reference for the Electric Agents CLI: spawn, send, observe, inspect, list, and manage entities. - [HandlerContext](/docs/agents/reference/handler-context.md): API reference for HandlerContext: state, coordination, agent configuration, and execution control. - [EntityDefinition](/docs/agents/reference/entity-definition.md): Type reference for EntityDefinition: description, state, schemas, and handler function signature. - [AgentConfig](/docs/agents/reference/agent-config.md): API reference for AgentConfig: system prompt, model, tools, streaming, and test responses. - [AgentTool](/docs/agents/reference/agent-tool.md): Interface reference for AgentTool: name, description, TypeBox parameters schema, and execute function. - [StateCollectionProxy](/docs/agents/reference/state-collection-proxy.md): API reference for StateCollectionProxy: insert, update, delete, get, and toArray operations. - [EntityHandle](/docs/agents/reference/entity-handle.md): API reference for EntityHandle returned by spawn and observe: streams, status, text retrieval, and messaging. - [SharedStateHandle](/docs/agents/reference/shared-state-handle.md): Type reference for SharedStateHandle: collection proxies and SharedStateSchemaMap interface. - [WakeEvent](/docs/agents/reference/wake-event.md): Type reference for WakeEvent and Wake configuration: runFinished and change-based wake conditions. - [Built-in collections](/docs/agents/reference/built-in-collections.md): Reference for the 17 runtime-managed collections: runs, steps, texts, toolCalls, inbox, errors, and more. - [EntityRegistry](/docs/agents/reference/entity-registry.md): API reference for EntityRegistry: define, get, list, and clear entity type registrations. - [RuntimeHandler](/docs/agents/reference/runtime-handler.md): API reference for RuntimeHandler: webhook handling, type registration, and deployment configuration. ### Entities #### Agents - [Horton agent](/docs/agents/entities/agents/horton.md): The built-in Horton assistant - chat, research, code, and dispatch subagents in one entity type. - [Worker](/docs/agents/entities/agents/worker.md): Generic sandboxed subagent type. Spawned by Horton (or any agent) via the spawn_worker tool with a system prompt and a chosen tool subset. - [Coder](/docs/agents/entities/agents/coder.md): Built-in coding-session entity backed by Claude Code or Codex CLI. #### Patterns - [Manager-Worker](/docs/agents/entities/patterns/manager-worker.md): Coordination pattern where a parent spawns specialist children, waits for completion, and synthesizes results. - [Pipeline](/docs/agents/entities/patterns/pipeline.md): Sequential processing pattern where each stage's output feeds into the next via state transitions. - [Map-Reduce](/docs/agents/entities/patterns/map-reduce.md): Parallel processing pattern that splits work into chunks, processes simultaneously, and reduces results. - [Dispatcher](/docs/agents/entities/patterns/dispatcher.md): Message routing pattern that classifies incoming messages and dispatches to specialist agents. - [Blackboard (shared state)](/docs/agents/entities/patterns/blackboard.md): Multi-agent coordination using shared state as a common data structure for reads and writes. - [Reactive observers](/docs/agents/entities/patterns/reactive-observers.md): Pattern for entities that watch others and react to changes using ctx.observe() with wake conditions. ### Usage - [CLI](/docs/streams/cli.md): Command-line tool for creating, writing to, reading from, and managing Durable Streams. Supports piped input, JSON mode, batch writes, and token authentication. - [JSON mode](/docs/streams/json-mode.md): Stream structured data using JSON messages over a Durable Stream. - [Durable Proxy](/docs/streams/durable-proxy.md): Put durable, resumable streaming in front of existing AI streaming APIs. Persists upstream responses into Durable Streams so clients can reconnect and resume reads. - [Durable State](/docs/streams/durable-state.md): Structured state changes on top of Durable Streams. Work with typed insert, update, and delete events using MaterializedState, StreamDB, and Durable Sessions. - [StreamDB](/docs/streams/stream-db.md): Type-safe reactive database in a durable stream. Define schemas with StandardSchema, query with TanStack DB, and use optimistic actions on top of Durable State. - [StreamFS](/docs/streams/stream-fs.md): Shared filesystem for AI agents built on Durable Streams. Provides files, directories, metadata, content streams, and watch-based synchronization across agents. #### Clients - [TypeScript client](/docs/streams/clients/typescript.md): TypeScript client for Durable Streams. Fetch-like stream() for reads and IdempotentProducer for exactly-once writes with batching and retries. - [Python client](/docs/streams/clients/python.md): Python client for Durable Streams with sync and async APIs. Generator-based stream consumption and IdempotentProducer for exactly-once writes. - [Clients](/docs/streams/clients/other.md): Durable Streams client libraries for a wide range of languages, including TypeScript, Python, Go, Elixir, .NET, Swift, PHP, Java, Rust, and Ruby. ### Integrations - [TanStack AI](/docs/streams/integrations/tanstack-ai.md): TanStack AI connection adapter for Durable Streams. Make chat sessions resumable, resilient, and shareable across tabs, devices, users and agents. - [Vercel AI SDK](/docs/streams/integrations/vercel-ai-sdk.md): Vercel AI SDK Transport that makes chat sessions resumable, resilient, and shareable across tabs, devices, users and agents. - [Yjs](/docs/streams/integrations/yjs.md): Sync Yjs CRDT documents over HTTP with automatic server-side compaction, snapshot management, and optional awareness (presence) support. ### Legal - [Terms of Service](/about/legal/terms.md): Terms of Service for Electric DB Inc. governing access to and use of the Electric Services. - [Privacy Policy](/about/legal/privacy.md): Privacy Policy for Electric DB Inc. describing how we collect, use, and share your personal information. ### Legal - [Terms of Service](/about/legal/terms.md): Terms of Service for Electric DB Inc. governing access to and use of the Electric Services. - [Privacy Policy](/about/legal/privacy.md): Privacy Policy for Electric DB Inc. describing how we collect, use, and share your personal information. ### Other - [@electric-sql/docs](/CHANGELOG.md) - [120 days of hardening – the post‑1.0 reliability sprint](/blog/2025/08/04/reliability-sprint.md): Our last quarter was a reliability sprint. We set one goal: make ElectricSQL so boring‑reliable that you stop thinking about it and just build. - [A new approach to building Electric](/blog/2024/07/17/electric-next.md): Electric Next is a new approach to building the ElectricSQL sync engine. - [Agent skills now shipping in our npm packages](/blog/2026/03/06/agent-skills-now-shipping.md): Electric, TanStack DB, and Durable Streams now ship agent skills — versioned knowledge that travels with your packages so coding agents actually understand how to use them. - [Agents demos](/agents/demos.md): Demos and example applications built with Electric Agents. - [AI agents as CRDT peers — building collaborative AI with Yjs](/blog/2026/04/08/ai-agents-as-crdt-peers-with-yjs.md): How to build a collaborative AI editor where the AI agent is a server-side CRDT peer, using Durable Streams for both Yjs document sync and TanStack AI chat sessions. - [Amdahl's law for AI agents](/blog/2026/02/19/amdahls-law-for-ai-agents.md): The maximum speedup from AI agents is bounded by the fraction of the workflow that requires human judgment. The highest-leverage investment isn't making agents faster — it's making every human intervention self-liquidating. - [Announcing Durable Streams](/blog/2025/12/09/announcing-durable-streams.md): A persistent stream primitive and HTTP protocol for reliable, resumable, real-time data streaming into client applications - [Announcing Hosted Durable Streams](/blog/2026/01/22/announcing-hosted-durable-streams.md): Hosted durable streams are now live on Electric Cloud. Persistent, resumable event streams over HTTP with unlimited streams, reads, and writes. - [Announcing PGlite v0.4: PostGIS, connection multiplexing, and a new architecture](/blog/2026/03/25/announcing-pglite-v04.md): PGlite v0.4 adds PostGIS, connection multiplexing, and a refactored architecture that decouples initdb from the main WASM binary. - [Bringing agents back down to earth](/blog/2025/08/12/bringing-agents-back-down-to-earth.md): Agentic AI, beneath all the hype, is actually just normal software. You can build agentic systems with a database, standard web tooling and real-time sync. - [Building AI apps? You need sync](/blog/2025/04/09/building-ai-apps-on-sync.md): AI apps are collaborative. Building them requires solving resumability, interruptibility, multi‑tab, multi‑device and multi‑user. - [CLI](/cloud/cli.md): Command-line interface for managing Electric Cloud resources — Electric Sync sources and Electric Streams services. - [Cloud Pricing](/pricing.md): Electric Cloud has usage-based pricing with unlimited data delivery. Pay for writes and retention, not egress. - [Configurancy: keeping systems intelligible when agents write all the code](/blog/2026/02/02/configurancy.md): Configurancy is the layer that lets agents coherently co-evolve a system. - [Data Processing Addendum](/about/legal/dpa.md): Data Processing Addendum for Electric DB Inc. describing how we process personal data on behalf of our customers. - [Doom on Durable Streams](/blog/2026/04/20/doom-on-durable-streams.md): Can Doom run on Durable Streams? Absolutely! Live streaming, rewinding, and fork — branch any session at any point and you're instantly back in the game. - [Durable Sessions — the key pattern for collaborative AI](/blog/2026/01/12/durable-sessions-for-collaborative-ai.md): This post introduces the Durable Session pattern for building collaborative AI apps with Durable Streams and TanStack DB. - [Durable Streams — the data primitive for the agent loop](/blog/2026/04/08/data-primitive-agent-loop.md): Agents are stateful. The agent loop accumulates a new kind of data that needs a new kind of primitive. Durable Streams is that primitive. - [Durable Streams 0.1.0 and State Protocol](/blog/2025/12/23/durable-streams-0.1.0.md): The first official npm release of Durable Streams, introducing the State Protocol for database-style sync semantics and early community experiments - [Durable Transports for your AI SDK](/blog/2026/03/24/durable-transport-ai-sdks.md): We've released Durable Streams based transport and session integrations for TanStack AI and the Vercel AI SDK. With turnkey hosting on Electric Cloud. - [Electric 1.0 released](/blog/2025/03/17/electricsql-1.0-released.md): With version 1.0 Electric is now in GA. The APIs are stable and the sync engine is ready for mission critical, production apps. - [Electric 1.1: new storage engine with 100x faster writes](/blog/2025/08/13/electricsql-v1.1-released.md): How we built a new storage engine for Electric, why we did it now, and how it delivers lower latency, higher throughput, and zero‑downtime deploys. - [Electric Agents](/agents.md): Durable, composable, serverless agents — built on append-only streams, using your existing stack. - [Electric Agents](/docs/agents.md): The durable runtime for long-lived agents — entities, handlers, wakes, agent loops, and coordination, built on Electric Streams, TanStack DB, and pi. - [Electric apps get persistence and includes with TanStack DB 0.6](/blog/2026/03/25/tanstack-db-0.6-app-ready-with-persistence-and-includes.md): TanStack DB 0.6 adds persistence and includes. For Electric users, that means a more complete app data stack with persistence and nested query results, adopted incrementally. - [Electric BETA release](/blog/2024/12/10/electric-beta-release.md): The Electric sync engine is now in BETA. If you haven't checked out Electric recently, it's a great time to take another look. - [Electric Cloud](/cloud.md): Scalable data infrastructure platform for building fast, modern apps and collaborative multi-agent, multi-user AI apps and agentic systems. - [Electric Cloud pricing is live](/blog/2026/04/02/electric-cloud-pricing.md): Electric Cloud has self-serve pricing. Usage-based — pay for writes and retention. Reads, fan-out, and data delivery are free and unlimited. - [Electric Cloud public BETA: Sync in 30 seconds](/blog/2025/04/07/electric-cloud-public-beta-release.md): Electric Cloud is now in public BETA! This means it's open to everyone for immediate access. - [Electric Streams](/docs/streams.md): An overview of Electric Streams and the Durable Streams protocol: streams, offsets, content types, producers, consumers, live modes, stream lifecycle, and CDN caching. - [Electric Sync](/docs/sync.md): Documentation for Electric Sync — the read-path sync engine for Postgres, syncing data into local clients over HTTP. - [ElectricSQL](/old-index.md): Sync little subsets of your Postgres data into local apps and services. - [Fork — branching for Durable Streams](/blog/2026/04/15/fork-branching-for-durable-streams.md): Fork is branching for Durable Streams. Branch any stream at any point with a single API call. Rewind history, fan out agents in parallel, or probe without polluting context. Live on Electric Cloud. - [From fiction to reality, you can now build difficult things](/blog/2026/01/20/from-science-fiction-to-reality-you-can-build-difficult-things-now.md): Four years ago I dreamed of building a browser-based collaborative CAD editor. In late 2025, LLMs made it possible — here's how I built SolidType in two weeks, and what it reveals about the shift in what's now feasible for a solo developer. - [Introducing Electric Agents — the agent platfom built on sync](/blog/2026/04/29/introducing-electric-agents.md): Introducing Electric Agents, the agent platform built on sync. Use it to build scalable, collaborative multi-agent systems that integrate into your online systems. - [Local-first with your existing API](/blog/2024/11/21/local-first-with-your-existing-api.md): How to develop local-first apps incrementally, using your existing API. - [Quickstart](/docs/agents/quickstart.md): Run the Electric Agents runtime and the built-in Horton assistant with a single CLI command, then connect from the web UI or define your own entities. - [Quickstart](/docs/streams/quickstart.md): Get started with Durable Streams by following the Quickstart guide. - [Quickstart](/docs/sync/quickstart.md): Get up-and-running with Electric and TanStack DB. Install, develop and deploy a super-fast, reactive web app, based on real-time sync of your Postgres data. - [StreamDB — a reactive database in a Durable Stream](/blog/2026/03/26/stream-db.md): StreamDB turns a Durable Stream into a reactive database. You provide a Standard Schema, StreamDB gives you type-safe, durable state with sync. - [Streams demos](/streams/demos.md): Demos and example applications built with Electric Streams. - [Subprocessor List](/about/legal/subprocessors.md): List of third-party subprocessors used by Electric DB Inc. to provide the Electric Services. - [Super-fast apps on sync with Electric and TanStack DB](/blog/2025/07/29/super-fast-apps-on-sync-with-tanstack-db.md): Tanstack DB is a reactive client store for building super fast apps on sync. Paired with Electric, it provides an optimal end-to-end sync stack for app development. - [Sync demos](/sync/demos.md): Demos and example applications build with Electric Sync. - [Sync stacks](/docs/sync/stacks.md): Electric provides composable sync primitives that allow you to add real-time sync to your existing stack, without imposing technology choices, code changes or data silos. - [Untangling the LLM spaghetti](/blog/2025/04/22/untangling-llm-spaghetti.md): LLMs are generating code. That code is imperatively fetching data. That leads to a big ball of spaghetti. - [Untitled](/docs/sync/llms/_intro_redux.md) - [Untitled](/docs/sync/llms/_quickstart_redux.md) - [Untitled](/docs/sync/llms/_tutorial.md) - [Untitled](/src/partials/home-cta.md) - [Untitled](/src/partials/home-features-after.md) - [Untitled](/src/partials/home-features-before.md) - [Untitled](/src/partials/home-your-stack-simplified.md) - [Usage](/cloud/usage.md): How to use Electric Cloud — the hosted, managed platform for Electric Streams and Electric Sync. - [Vercel - Integrations](/docs/sync/integrations/vercel.md): How to use Electric with Vercel, including Durable Transport for the Vercel AI SDK. - [Vibe coding with a database in the sandbox](/blog/2025/06/05/database-in-the-sandbox.md): More play less infra. With PGlite you can vibe code with a database built into the sandbox. - [Yjs over HTTP on Durable Streams](/blog/2026/04/07/yjs-durable-streams-on-electric-cloud.md): We've released a new Yjs provider built on Durable Streams — sync fan-out and fast catch-up from the edge for collaborative and agentic systems. Now live on Electric Cloud.