# PocketBase — Backend in One File for AI Apps > Open-source backend with database, auth, file storage, and admin UI in a single executable. Perfect for AI app backends. 57K+ stars. ## Install Merge the JSON below into your `.mcp.json`: # PocketBase — Backend in One File for AI Apps ## Quick Use Download the binary for your platform from [GitHub Releases](https://github.com/pocketbase/pocketbase/releases): ```bash # macOS / Linux wget https://github.com/pocketbase/pocketbase/releases/latest/download/pocketbase_0.25_linux_amd64.zip unzip pocketbase_*.zip ./pocketbase serve ``` Open `http://localhost:8090/_/` — admin dashboard is ready. Create a collection, add fields, and you have a full REST API: ```bash # Create a record curl -X POST http://localhost:8090/api/collections/posts/records \ -H 'Content-Type: application/json' \ -d '{"title": "Hello AI", "content": "First post from my AI app"}' # List records curl http://localhost:8090/api/collections/posts/records # Real-time subscriptions (SSE) curl http://localhost:8090/api/realtime ``` --- ## Intro PocketBase is an open-source backend with 57,300+ GitHub stars that packages a real-time database, authentication, file storage, and admin dashboard into a single executable file — zero external dependencies. Written in Go with an embedded SQLite database, it's the fastest way to build a backend for AI applications, chatbots, agent dashboards, or any project that needs a quick, reliable API. Create collections in the admin UI, and PocketBase auto-generates REST and real-time APIs. Used as the backend for countless AI projects, RAG apps, and LLM-powered tools. Works with: Any frontend (React, Vue, Svelte, Next.js), any AI framework, Go (as a library). Best for developers who need a production backend in minutes, not weeks. Setup time: under 1 minute. --- ## PocketBase Architecture ### Single File = Complete Backend ``` pocketbase (single binary, ~40MB) ├── SQLite Database (embedded) ├── REST API (auto-generated) ├── Real-time Subscriptions (SSE) ├── Authentication (email, OAuth2) ├── File Storage (local or S3) └── Admin Dashboard (built-in web UI) ``` ### Auto-Generated REST API Create a collection in the admin UI → API endpoints are instantly available: | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/api/collections/{name}/records` | List records | | POST | `/api/collections/{name}/records` | Create record | | GET | `/api/collections/{name}/records/{id}` | Get record | | PATCH | `/api/collections/{name}/records/{id}` | Update record | | DELETE | `/api/collections/{name}/records/{id}` | Delete record | ### Authentication Built-in auth with zero configuration: ```bash # Register a user curl -X POST http://localhost:8090/api/collections/users/records \ -d '{"email": "user@example.com", "password": "12345678", "passwordConfirm": "12345678"}' # Login curl -X POST http://localhost:8090/api/collections/users/auth-with-password \ -d '{"identity": "user@example.com", "password": "12345678"}' # Returns JWT token ``` OAuth2 providers: Google, GitHub, Facebook, Apple, Discord, Microsoft, and more. ### Real-Time Subscriptions ```javascript import PocketBase from 'pocketbase'; const pb = new PocketBase('http://localhost:8090'); // Subscribe to changes pb.collection('messages').subscribe('*', (e) => { console.log('New message:', e.record); }); ``` ### Use Cases for AI Apps | Use Case | How PocketBase Helps | |----------|---------------------| | **AI Chat App** | Store conversations, user accounts, file attachments | | **RAG Dashboard** | Store documents, embeddings metadata, query logs | | **Agent Platform** | Store agent configs, execution logs, user sessions | | **LLM Playground** | Store prompts, responses, model configs | | **API Backend** | REST API for any AI frontend in seconds | ### Extend with Go ```go package main import ( "github.com/pocketbase/pocketbase" "github.com/pocketbase/pocketbase/core" ) func main() { app := pocketbase.New() app.OnServe().BindFunc(func(se *core.ServeEvent) error { se.Router.GET("/api/custom/ai-status", func(e *core.RequestEvent) error { return e.JSON(200, map[string]string{"status": "running"}) }) return se.Next() }) app.Start() } ``` --- ## FAQ **Q: What is PocketBase?** A: PocketBase is an open-source backend with 57,300+ GitHub stars that packages database, auth, file storage, and admin UI into a single executable. Zero dependencies, instant REST APIs. **Q: Why use PocketBase for AI projects?** A: AI apps need user auth, data storage, file handling, and real-time updates. PocketBase provides all of these in a single binary you can deploy anywhere — no Docker, no database setup, no infrastructure. **Q: Is PocketBase free?** A: Yes, fully open-source under MIT license. --- ## Source & Thanks > Created by [Gani Georgiev](https://github.com/pocketbase). Licensed under MIT. > > [pocketbase](https://github.com/pocketbase/pocketbase) — ⭐ 57,300+ Thanks to Gani Georgiev for building the simplest path from zero to production backend. --- ## 快速使用 下载二进制文件并运行: ```bash ./pocketbase serve ``` 打开 `http://localhost:8090/_/` — 管理面板就绑定了。 --- ## 简介 PocketBase 是一个拥有 57,300+ GitHub stars 的开源后端,将实时数据库、认证、文件存储和管理面板打包在一个可执行文件中。用 Go 编写,内嵌 SQLite,是为 AI 应用构建后端的最快方式。创建集合后自动生成 REST 和实时 API。 适用于:任何前端框架、任何 AI 框架、Go 扩展。适合需要快速构建生产后端的开发者。 --- ## 来源与感谢 > Created by [Gani Georgiev](https://github.com/pocketbase). Licensed under MIT. > > [pocketbase](https://github.com/pocketbase/pocketbase) — ⭐ 57,300+ --- Source: https://tokrepo.com/en/workflows/6a4265b8-1b20-459a-948c-1670c57f5912 Author: TokRepo精选