BeaverDB - Your Local-First Database

## Multi-Modal Power in a Single File

Everything you need for modern AI and data applications.

search

### Document & Vector Search

Store documents with vector embeddings. Perform fast vector search, full-text search (FTS), and typo-tolerant fuzzy search.

data_object

### Pythonic Data Structures

Use persistent data structures that feel just like native Python: Dictionaries (`db.dict`), Lists (`db.list`), and Priority Queues (`db.queue`).

hub

### Knowledge Graph

Create directed, labeled relationships between documents. Traverse your data with `.neighbors()` or multi-hop `.walk()` queries.

rss_feed

### Real-time Pub/Sub

Use `db.channel` for high-efficiency, multi-process messaging. Publish events and subscribe to them in real-time from other processes.

lock

### Inter-Process Locking

Safely coordinate multiple processes. Use `db.lock()` to prevent race conditions or `with db.list(...)` for atomic batch operations.

verified

### Type-Safe with Pydantic

Pass a `model=...` parameter to any data structure for automatic, recursive data validation and (de)serialization with Pydantic.

## Ideal Use Cases

BeaverDB shines where simplicity and local performance matter most.

psychology

### Local AI & RAG

- Build RAG apps that run on-device.
- Store vector embeddings and text together.
- Use hybrid search (vector + FTS).

construction

### Desktop & CLI Tools

- Remember user preferences.
- Manage task history.
- Cache results from slow APIs.

bolt

### Rapid Prototyping

- Get started in seconds with zero config.
- Use a single `.db` file for all data.
- Scale to a server with `beaver serve`.

chat

### Chatbots & Agents

- Store conversation history in a `db.list`.
- Manage agent tasks with a `db.queue`.
- Use `db.channel` for real-time UI updates.

## A Simple, Robust Philosophy

Designed for a great developer experience.

save

### Local-First & Embedded

The default mode is a single SQLite file. It's fast, portable, and requires zero configuration.

build_circle

### Standard SQLite

The `.db` file is 100% compatible with any standard SQLite tool. No magic, no proprietary formats.

extension

### Minimal Dependencies

The core library is small. Advanced features like the REST server are optional extras, so you only install what you need.

sync_lock

### Safe Concurrency

Thread-safe and multi-process-safe by default, with robust inter-process locking for complex operations.

## Use Locally, Deploy as a Server

Run BeaverDB where you need it most.

computer

### Embedded (Local-First)

The default mode. Your data lives in a single `.db` file in your project directory. Perfect for local apps, utilities, and prototypes.

dns

### REST API Server

Instantly expose your database over HTTP. Run `beaver serve` to start a FastAPI server for remote access from any client.

deployed_code

### Docker Container

Pull the official Docker image for a stable, containerized deployment. Mount a volume to persist your data and run as a service.

## Ready to get started?

Check out the Quickstart guide or browse the full documentation.

rocket_launch Read the Documentation

## Frequently Asked Questions

Have questions? We have answers.

`sqlite3` is a low-level driver. BeaverDB is a high-level, "Pythonic" API on top of it. It provides out-of-the-box solutions for modern data (vectors, graphs, full-text search, pub/sub), robust multi-process and thread-safe access (including `db.lock`), and a `pydantic` integration for type-safe (de)serialization.

BeaverDB is extremely fast for local, embedded use cases (zero network latency). It's designed for projects in the "small to medium" range (e.g., thousands to tens-of-thousands of documents). It is *not* designed to replace web-scale databases like PostgreSQL or distributed systems for handling millions of simultaneous users.

This keeps the core library minimal. The core `beaver-db` package has minimal dependencies (like `numpy` and `pydantic`). Features that require heavy libraries are "opt-in." For example, to run the REST API server (`beaver serve`), you must install `fastapi` by running `pip install "beaver-db[remote]"`.