https://github.com/rivet-gg/actor-core
🎠Stateful Serverless That Runs Anywhere. The easiest way to build stateful, AI agent, collaborative, or local-first applications. Deploy to Rivet, Cloudflare, Bun, Node.js, and more.
https://github.com/rivet-gg/actor-core
actor actors agents ai ai-agents bun bunjs cloudflare-durable-objects cloudflare-workers durable-objects nodejs rivet supabase typescript vercel
Last synced: 2 days ago
JSON representation
🎠Stateful Serverless That Runs Anywhere. The easiest way to build stateful, AI agent, collaborative, or local-first applications. Deploy to Rivet, Cloudflare, Bun, Node.js, and more.
- Host: GitHub
- URL: https://github.com/rivet-gg/actor-core
- Owner: rivet-gg
- License: apache-2.0
- Created: 2024-02-07T01:06:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-27T05:25:29.000Z (20 days ago)
- Last Synced: 2025-05-08T10:53:03.883Z (9 days ago)
- Topics: actor, actors, agents, ai, ai-agents, bun, bunjs, cloudflare-durable-objects, cloudflare-workers, durable-objects, nodejs, rivet, supabase, typescript, vercel
- Language: TypeScript
- Homepage: https://actorcore.org
- Size: 31.4 MB
- Stars: 891
- Watchers: 4
- Forks: 25
- Open Issues: 51
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Support: docs/support/enterprise.mdx
Awesome Lists containing this project
README
![]()
Stateful Serverless That Runs Anywhere
The easiest way to build stateful, AI agent, collaborative, or local-first applications.
Deploy to Rivet, Cloudflare, Bun, Node.js, and more.
Documentation •
Discord •
X •
Bluesky
## Quickstart
**Start By Framework**
-
  [React](https://actorcore.org/frameworks/react)
-Â Â [Node.js & Bun](https://actorcore.org/clients/javascript)
-Â Â [Rust](https://actorcore.org/clients/rust)
**Start With Studio**
  [Open Studio](https://studio.rivet.gg)
**Start With Template**
```bash
npx create-actor@latest
```## What is Stateful Serverless?
**
  Long-Lived, Stateful Compute**
Each unit of compute is like a tiny server that remembers things between requests – no need to reload data or worry about timeouts. Like AWS Lambda, but with memory and no timeouts.
  **Durable State Without a Database**
Your code's state is saved automatically—no database, ORM, or config needed. Just use regular JavaScript objects or SQLite (available in April).
  **Blazing-Fast Reads & Writes**
State is stored on the same machine as your compute, so reads and writes are ultra-fast. No database round trips, no latency spikes.
  **Realtime, Made Simple**
Update state and broadcast changes in realtime. No external pub/sub systems, no polling – just built-in low-latency events.
  **Store Data Near Your Users**
Your state lives close to your users on the edge – not in a faraway data center – so every interaction feels instant.
  **Serverless & Scalable**
No servers to manage. Your code runs on-demand and scales automatically with usage.
*[Have more questions? Jump to our FAQ →](#frequently-asked-questions)*
## Examples
Browse snippets for how to use ActorCore with different use cases.
| Example | Actor (JavaScript) | Actor (SQLite) | Frontend (React) |
|---------|------------|--------|-------|
| Chat Room | [actor.ts](/examples/snippets/chat-room/actor-json.ts) | [actor.ts](/examples/snippets/chat-room/actor-sqlite.ts) | [App.tsx](/examples/snippets/chat-room/App.tsx) |
| AI Agent | [actor.ts](/examples/snippets/ai-agent/actor-json.ts) | [actor.ts](/examples/snippets/ai-agent/actor-sqlite.ts) | [App.tsx](/examples/snippets/ai-agent/App.tsx) |
| Local-First Sync | [actor.ts](/examples/snippets/sync/actor-json.ts) | [actor.ts](/examples/snippets/sync/actor-sqlite.ts) | [App.tsx](/examples/snippets/sync/App.tsx) |
| Per-Tenant SaaS | [actor.ts](/examples/snippets/tenant/actor-json.ts) | [actor.ts](/examples/snippets/tenant/actor-sqlite.ts) | [App.tsx](/examples/snippets/tenant/App.tsx) |
| Per-User Databases | [actor.ts](/examples/snippets/database/actor-json.ts) | [actor.ts](/examples/snippets/database/actor-sqlite.ts) | [App.tsx](/examples/snippets/database/App.tsx) |
| Yjs CRDT | [actor.ts](/examples/snippets/crdt/actor-json.ts) | [actor.ts](/examples/snippets/crdt/actor-sqlite.ts) | [App.tsx](/examples/snippets/crdt/App.tsx) |
| Collaborative Document | [actor.ts](/examples/snippets/document/actor-json.ts) | [actor.ts](/examples/snippets/document/actor-sqlite.ts) | [App.tsx](/examples/snippets/document/App.tsx) |
| Stream Processing | [actor.ts](/examples/snippets/stream/actor-json.ts) | [actor.ts](/examples/snippets/stream/actor-sqlite.ts) | [App.tsx](/examples/snippets/stream/App.tsx) |
| Multiplayer Game | [actor.ts](/examples/snippets/game/actor-json.ts) | [actor.ts](/examples/snippets/game/actor-sqlite.ts) | [App.tsx](/examples/snippets/game/App.tsx) |
| Rate Limiter | [actor.ts](/examples/snippets/rate/actor-json.ts) | [actor.ts](/examples/snippets/rate/actor-sqlite.ts) | [App.tsx](/examples/snippets/rate/App.tsx) |_SQLite will be available in late April. We’re working on publishing full examples related to these snippets. If you find an error, please create an issue._
## Runs On Your Stack
Deploy ActorCore anywhere - from serverless platforms to your own infrastructure. Don't see the runtime you want? [Add your own](http://localhost:3000/drivers/build).
### All-In-One
-Â Â [Rivet](/platforms/rivet)
-Â Â [Cloudflare Workers](/platforms/cloudflare-workers)
### Compute
-Â Â [Vercel](https://github.com/rivet-gg/actor-core/issues/897) *(On The Roadmap)*
-Â Â [AWS Lambda](https://github.com/rivet-gg/actor-core/issues/898) *(On The Roadmap)*
-Â Â [Supabase](https://github.com/rivet-gg/actor-core/issues/905) *(Help Wanted)*
-Â Â [Bun](/platforms/bun)
-Â Â [Node.js](/platforms/nodejs)
### Storage
-Â Â [Redis](/drivers/redis)
-Â Â [Postgres](https://github.com/rivet-gg/actor-core/issues/899) *(Help Wanted)*
-Â Â [File System](/drivers/file-system)
-Â Â [Memory](/drivers/memory)
## Works With Your Tools
Seamlessly integrate ActorCore with your favorite frameworks, languages, and tools. Don't see what you need? [Request an integration](https://github.com/rivet-gg/actor-core/issues/new).
### Frameworks
-Â Â [React](/frameworks/react)
-Â Â [Next.js](https://github.com/rivet-gg/actor-core/issues/904) *(Help Wanted)*
-Â Â [Vue](https://github.com/rivet-gg/actor-core/issues/903) *(Help Wanted)*
### Clients
-Â Â [JavaScript](/clients/javascript)
-Â Â [TypeScript](/clients/javascript)
-Â Â [Python](/clients/python)
-Â Â [Rust](/clients/rust)
### Integrations
-Â Â [Hono](/integrations/hono)
-Â Â [Vitest](/concepts/testing)
-Â Â [Resend](/integrations/resend)
-Â Â [Better Auth](https://github.com/rivet-gg/actor-core/issues/906) *(On The Roadmap)*
-Â Â [AI SDK](https://github.com/rivet-gg/actor-core/issues/907) *(On The Roadmap)*
### Local-First Sync
-Â Â [LiveStore](https://github.com/rivet-gg/actor-core/issues/908) *(Available In May)*
-Â Â [ZeroSync](https://github.com/rivet-gg/actor-core/issues/909) *(Help Wanted)*
-Â Â [TinyBase](https://github.com/rivet-gg/actor-core/issues/910) *(Help Wanted)*
-Â Â [Yjs](https://github.com/rivet-gg/actor-core/issues/911) *(Help Wanted)*
## Local Development with the Studio
Like Postman, but for all of your stateful serverless needs.
## Join the Community
Help make ActorCore the universal way to build & scale stateful serverless applications.
- [Discord](https://rivet.gg/discord)
- [X](https://x.com/ActorCore_org)
- [Bluesky](https://bsky.app/profile/rivet.gg)
- [Discussions](https://github.com/rivet-gg/actor-core/discussions)
- [Issues](https://github.com/rivet-gg/actor-core/issues)## Frequently Asked Questions
How is ActorCore different than Rivet Actors?
ActorCore is a framework written in TypeScript that provides high-level functionality. Rivet is an open-source serverless platform written in Rust with features tailored for stateful serverless.
You can think of it as ActorCore is to Rivet as Next.js is to Vercel.
While Rivet is the primary maintainer of ActorCore, we intend for this to be community driven.
How does stateful serverless compare to the traditional actor model?
Stateful serverless is very similar to actors: it's essentially actors with persistence, and usually doesn't have as rigid constraints on message handling. This makes it more flexible while maintaining the core benefits of the actor model.
How do stateful and stateless serverless work together?
Stateless serverless works well when you have an external resource that maintains state. Stateful serverless, on the other hand, is almost like a mini-database.
Sometimes it makes sense to use stateless serverless to make requests to multiple stateful serverless instances, orchestrating complex operations across multiple state boundaries.
How does ActorCore achieve huge performance gains?
By storing state in memory and flushing to a persistence layer, we can serve requests instantly instead of waiting for a round trip to the database. There are additional optimizations that can be made around your state to tune the durability of it.
Additionally, data is stored near your users at the edge, ensuring round-trip times of less than 50ms when they request it. This edge-first approach eliminates the latency typically associated with centralized databases.
Isn't well-designed software supposed to separate compute and storage?
Some software makes sense to separate – e.g., for data lakes or highly relational data. But at the end of the day, data has to be partitioned somewhere at some point.
Usually "faster" databases like Cassandra, DynamoDB, or Vitess make consistency tradeoffs to get better performance. Stateful serverless forces you to think about how your data is sharded for better performance, better scalability, and less consistency footguns.
What is stateful serverless not good for?
OLAP, data lakes, graph databases, and highly relational data are currently not ideal use cases for stateful serverless, though it will get better at handling these use cases over time.
Can this create a single bottleneck?
Yes, but only as much as storing data in a single database row does. We're working on building out read replicas to allow you to perform read-only actions on actors.
Stateless serverless is standardized under WinterTC. Is there any intention to standardize stateful serverless?
Things are cooking! Check out our [blog post](https://rivet.gg/blog/2025-03-23-what-would-a-w3c-standard-look-like-for-stateful-serverless-) about what a W3C standard for stateful serverless might look like and [the awesome people who are collaborating on this](https://x.com/threepointone/status/1903579571028390038).
Have more questions? Join our [Discord](https://discord.gg/rivet) or go to [GitHub Discussions](https://github.com/rivet-gg/actor-core/discussions).
## Roadmap For 2025
We ship fast, so we want to share what you can expect to see before the end of the year.
Help shape our roadmap by [creating issues](https://github.com/rivet-gg/actor-core/issues) and [joining our Discord](https://rivet.gg/discord).- [ ] SQLite Support
- [ ] SQLite in Studio
- [ ] Local-First Extensions
- [ ] Auth Extensions
- [ ] Workflows
- [ ] Queues
- [ ] MCP
- [ ] Actor-Actor Actions
- [ ] Cancellable Schedules
- [ ] Cron Jobs
- [ ] Drizzle Support
- [ ] Prisma v7 Support
- [ ] Read Replicas
- [ ] Middleware
- [ ] Schema Validation
- [ ] Vite Integration
- [ ] OpenTelemetry
- [ ] More Examples
- [X] Studio
- [X] File system driver
- [X] Redis driver
- [X] Bun support
- [X] P2P topology
- [X] React client
- [X] Rust client
- [X] Resend Integration
- [X] Vitest Integration
- [X] Non-serialized state
- [X] `create-actor`
- [X] `actor-core dev`
- [X] Hono Integration## License
Apache 2.0
_Scale without drama – only with ActorCore._