the open-source Context/Knowledge Layer Database
HawDB is an AI-native embedded database for agents. It keeps the facts an agent reasons over — entities, relationships, documents, and events — in one crash-safe process, returns them as bounded context, and gives each agent its own durable branch to work in.
main or other agents. See Branches for agents.HawDB is written in Rust and licensed under Apache-2.0. It is built for Nowledge Mem, currently in nightly integration. The library is the product: any host that needs a durable context layer opens it the same way.
The site and in-browser playground are at hawdb.ai. Their source is nowledge-co/hawdb-website.
For synchronous SQL materialized views, see the materialized view guide. For BM25 full-text search over SQL rows, see the SQL search index guide.
Embed HawDB from Rust, Python, Go, JavaScript/TypeScript, Swift, C/C++, or MoonBit. See Language bindings for packages, source builds, and the experimental browser runtime.
The Rust library is published as hawdb on crates.io.
The repository pins Rust 1.99.1. Other languages have their own installation
paths in Language bindings.
[dependencies]
hawdb = "0.43.1"
To follow the repository tip instead of a release:
hawdb = { git = "https://github.com/nowledge-co/hawdb" }
Or build the default library from a checkout:
cargo build --locked -p hawdb
The default build includes full-text search, vector search, graph analytics, background maintenance, and the Tokio adapter. A capability left out of the build cannot be turned back on at runtime. See Build.
All bindings embed the engine in the host process. Choose the package or source integration for your runtime; API coverage and platform requirements are documented in each guide.
| Language / runtime | Package or installation path | Guide |
|---|---|---|
| Rust | hawdb on crates.io: cargo add hawdb | Install · API reference |
| Python | hawdb on PyPI: python -m pip install hawdb (CPython 3.11+) | Python binding |
| JavaScript / TypeScript — Bun | @nowledge/hawdb-bun on npm: bun add @nowledge/hawdb-bun; includes the matching platform library | Bun binding |
| JavaScript / TypeScript — Node.js / Electron | Source build of @nowledge/hawdb-node (Node-API 8, Node.js 22.16+); not yet published on npm | Node.js / Electron binding |
| Go | Module github.com/nowledge-co/hawdb/bindings/go; load a matching C ABI library with LoadLibrary(path), with cgo disabled | Go binding · Native libraries |
| Swift | SwiftPM HawDB product plus a matching C ABI library; build the static XCFramework package for iOS/iPadOS | Swift binding |
| C / C++ | Release archives with hawdb_ffi.h and native libraries, or build from source | C ABI · Platforms and linking |
| MoonBit | In-tree native binding built from the checkout; no separately published SDK | MoonBit binding |
| WebAssembly / browser | Experimental in-memory Rust/WASM runtime with a wasm-bindgen example; no persistent browser storage or published browser SDK | Browser runtime · Playground |
Native C ABI release archives cover macOS arm64/x86-64, Linux glibc arm64/x86-64, and Windows x86-64. Go and Swift hosts supply a matching native library; the Bun package selects it automatically. iOS XCFrameworks are built from source or obtained from the Swift Apple workflow's CI artifacts, rather than the desktop release archives. See the [platform matrix](docs/PREBUILT_L
storage: refused data admission deletes legacy bootstrap artifacts
https://github.com/nowledge-co/hawdb/issues/2227
Labels: bug, P1, rust
Windows: full (unbounded) rename cut sweep in checkpoint_leftovers
https://github.com/nowledge-co/hawdb/issues/2216
Labels: None
perf: track codebase optimization audit findings (HawDB 0.43.0)
https://github.com/nowledge-co/hawdb/issues/2215
Labels: enhancement
build(architecture): replace sysinfo with native memory queries, reduce EmbeddedOwner mutex contention, and feature-gate Mem integration crates and CLI
https://github.com/nowledge-co/hawdb/issues/2214
Labels: enhancement
perf(bindings): eliminate Node-API double JSON round-trip, C ABI intermediate DOM, and Python parameter/iteration hot-path overhead
https://github.com/nowledge-co/hawdb/issues/2213
Labels: enhancement
perf(runtime): consolidate per-worker-count Rayon pools, remove Condvar blocking in morsel workers, and fix scheduler idle wakeup storm
https://github.com/nowledge-co/hawdb/issues/2212
Labels: enhancement
perf(vector): accumulate RaBitQ SIMD products in vector lanes, enable NEON in Auto, and buffer DiskANN/RaBitQ artifact writes
https://github.com/nowledge-co/hawdb/issues/2211
Labels: enhancement
HawDB is an embedded Rust database. Contributions should improve a concrete host workload while preserving query correctness, bounded resource use, and recoverable storage. Start with the architecture, development plan, and open work. AGENTS.md records the repository's architecture and integration constraints and also applies to code produced with an assistant.
The public site and browser playground are hawdb.ai. Landing
page copy, the deployed playground, and the wasm-bindgen bridge that consumes
this engine live in
nowledge-co/hawdb-website.
Change those there. This repository keeps the engine and the in-tree
development playground under examples/wasm-playground/.
That website pins a specific HawDB git revision. A pull request that changes
the facade it binds — Database::new, query, query_with_params,
query_sql, and Value — should say so in the description, so the website
repository can bump the pin and re-check the playground. The in-tree WASM
contract is docs/WASM.md.
Search open and closed issues before filing a new one. Choose the closest form:
| Form | Evidence that makes it actionable |
|---|---|
| Bug report | Minimal reproduction, expected and actual behavior, version/commit, environment, and relevant configuration. |
| Performance issue | Reproducible workload and data shape, baseline or observed limitation, exact commands, measurements, and resource configuration. |
| Feature request | A concrete host use case, desired behavior, acceptance criteria, and alternatives. |
| Enhancement or maintenance | Current limitation, bounded scope, preserved invariants, and completion criteria. |
Use an issue title such as storage: duplicate key survives a rejected batch.
Include the crate version or commit, OS/architecture, toolchain, build profile,
Cargo features, and relevant DatabaseConfig values when reporting behavior.
Distinguish an in-memory database from persistent storage and state the
configured residency mode (Auto, Materialized, or OutOfCore). Include the
observed mode when available. Unknown details can be marked as unknown.
For query issues, include schema/index setup, a small fixture, query parameters, and expected rows or errors. For persistence issues, include transaction, checkpoint, crash/cancellation, and reopen order, plus whether a write was acknowledged. A suspected root cause is helpful but is not required to report a bug. Use synthetic fixtures and sanitize logs; do not upload real user databases or credentials. Preserve minimized fuzz inputs, seeds, and replay commands.
Use the same sections when filing through gh or an API; the web forms cannot
enforce the content of those submissions. Maintainers assign severity from
observed impact rather than from the amount of code involved.
Fork the repository if needed and create a branch from current main.
Every PR targets main directly. Keep sequential work in one coherent PR,
or land each independent piece before starting its dependent PR.
Every PR must link at least one existing issue that describes the problem
or requested change, including documentation-only and mechanical maintenance
PRs. Search existing issues and create one before opening the PR if none fits.
The PR description must include an Issue Number: line:
Issue Number: close #123 only when the PR fully resolves the issue
and completes all of its acceptance criteria.Issue Number: ref #123 for partial or related work that leaves the
issue open. Explain the remaining work in the PR description.Issue Number: close #123, ref #456.None, missing references, and unreplaced placeholders are not accepted.
Keep changes focused. Before creating or updating a PR body, read and fill in the current PR template directly. It is the source of truth for the body structure, including assistant-generated bodies and explicit CLI/API submissions. Preserve its headings and order, replace placeholders, and follow its inline guidance. PR-body prompts should reference this file rather than duplicate its sections or define another format. Explain the problem, mechanism, important tradeoffs, tests, and compatibility impact. Large public API or persistent-format proposals should be discussed in the issue before implementation.
Use type(scope): concise change for PR titles and commit subjects, for
example fix(storage): reject duplicate keys before WAL append or
docs(contributing): describe recovery test evidence. Common types are
feat, fix, perf, refactor, test, docs, build, ci, and chore.
Use the affected component as the scope, such as api, cypher, sql,
optimizer, storage, or search. Write repository content and PR/commit
text in English.
Keep the PR description current when the implementation changes. Explain unresolved risks and link any agreed follow-up; do not mark work complete merely because one test suite passes.
Dependabot checks Cargo, Python, Bazel and GitHub Actions dependencies weekly on Monday at 09:00 Asia/Shanghai. Minor and patch updates are grouped by ecosystem; major updates remain separate. Each update configuration allows at most five open version-update PRs. The independent Python and Cypher experiment Cargo workspaces have their own manifests; the root entry covers all workspace crates. The consumer-profile fixture has only a local path dependency and needs no separate registry update entry.
The metadata workflow adds Issue Number: ref #845