{"_id":"@elizaos/plugin-localdb-root","_rev":"4-e44d144529f5fb2fe4d07cc6a17ac13a","name":"@elizaos/plugin-localdb-root","dist-tags":{"next":"2.0.0-alpha.1","latest":"2.0.0-alpha.1"},"versions":{"2.0.0-alpha.1":{"name":"@elizaos/plugin-localdb-root","version":"2.0.0-alpha.1","keywords":[],"author":{"name":"elizaOS"},"license":"MIT","_id":"@elizaos/plugin-localdb-root@2.0.0-alpha.1","maintainers":[{"name":"shawticus","email":"shawmakesmagic@gmail.com"},{"name":"shakkernerd","email":"shakkerdroid@gmail.com"},{"name":"wtfsayo","email":"hi@sayo.wtf"},{"name":"odilitime","email":"janesmith@airmail.cc"},{"name":"cjft","email":"cjft@trimboli.io"}],"homepage":"https://github.com/elizaos-plugins/plugin-localdb#readme","bugs":{"url":"https://github.com/elizaos-plugins/plugin-localdb/issues"},"dist":{"shasum":"c3efaa1a6cb253d314edfae63eeb9c7ff0031527","tarball":"https://registry.npmjs.org/@elizaos/plugin-localdb-root/-/plugin-localdb-root-2.0.0-alpha.1.tgz","fileCount":139,"integrity":"sha512-Ai1RDfHp7NPD838mCOwItmkCqne0ksRFFlDdn5X02Wdt7D7YBHBy1SJMQKggGC5n3cD9f4EPPmFMgVOOfY6CUg==","signatures":[{"sig":"MEUCIA+H7NcXs7ueTu/ZLWjmRGkkvHCOAeo6Ufd7hkapytiRAiEAt7Xo4b1ZTDn03M9yyo+HkqfK4dsDWELFl8Crj8FdvLQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":750857},"main":"typescript/dist/index.js","type":"module","types":"typescript/dist/index.d.ts","exports":{".":{"types":"./typescript/dist/index.d.ts","import":"./typescript/dist/index.js","default":"./typescript/dist/index.js"},"./rust":{"import":"./rust/pkg/node/elizaos_plugin_plugin_localdb.js"},"./package.json":"./package.json"},"gitHead":"05d4ca11d769db8c7f54a722ee24b2ce2b951543","scripts":{"dev":"cd typescript && bun --hot build.ts","lint":"bunx @biomejs/biome check --write ./typescript","test":"bun run test:ts && bun run test:rust && bun run test:python","build":"bun run build:ts && bun run build:rust && bun run build:python","clean":"rm -rf typescript/dist python/dist rust/target .turbo node_modules","test:ts":"cd typescript && vitest run || echo 'TypeScript tests skipped - no tests found'","build:ts":"cd typescript && bun run build.ts","lint:rust":"test -d rust && cd rust && cargo clippy --all-targets --fix --allow-dirty --allow-staged -- -D warnings && cargo fmt || echo 'Rust lint skipped'","test:rust":"test -d rust && cd rust && cargo test || echo 'Rust tests skipped'","typecheck":"tsc --noEmit -p typescript/tsconfig.json","build:rust":"test -d rust && cd rust && cargo build --release || echo 'Rust build skipped - no rust directory'","lint:check":"bunx @biomejs/biome check ./typescript","lint:python":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint skipped'","test:python":"test -d python && cd python && pip install pytest-asyncio pytest-cov --quiet && pytest -p no:anchorpy --asyncio-mode=auto --asyncio-mode=auto || echo 'Python tests skipped'","build:python":"test -d python && cd python && (python3 -m build 2>/dev/null || pyproject-build) || echo 'Python build skipped - no python directory'","lint:python:fix":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint fix skipped'"},"_npmUser":{"name":"shawticus","email":"shawmakesmagic@gmail.com"},"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-localdb.git","type":"git"},"_npmVersion":"lerna/9.0.3/node@v22.20.0+arm64 (darwin)","description":"Simple JSON-based local database storage for elizaOS - no SQL, no migrations","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.5","typescript":"^5.9.3","@types/node":"^25.0.3","@biomejs/biome":"^2.3.11"},"peerDependencies":{"@elizaos/core":"2.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/plugin-localdb-root_2.0.0-alpha.1_1769034021495_0.3591234042226399","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-01-21T22:20:21.405Z","modified":"2026-06-16T05:14:42.513Z","2.0.0-alpha.1":"2026-01-21T22:20:21.655Z"},"bugs":{"url":"https://github.com/elizaos-plugins/plugin-localdb/issues"},"author":{"name":"elizaOS"},"license":"MIT","homepage":"https://github.com/elizaos-plugins/plugin-localdb#readme","keywords":[],"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-localdb.git","type":"git"},"description":"Simple JSON-based local database storage for elizaOS - no SQL, no migrations","maintainers":[{"email":"shawmakesmagic@gmail.com","name":"shawticus"},{"email":"janesmith@airmail.cc","name":"odilitime"}],"readme":"# @elizaos/plugin-localdb\n\nA simple, JSON-based local database adapter for elizaOS. Perfect for local development, testing, and lightweight deployments.\n\n## Features\n\n- **Zero Configuration**: No database setup required - just works out of the box\n- **No Migrations**: Data is stored as plain JSON files - no schema migrations needed\n- **Cross-Platform**: Works in both Node.js (file system) and browsers (localStorage)\n- **Vector Search**: Built-in HNSW index for semantic similarity search\n- **Same Interface**: Implements the standard `IDatabaseAdapter` interface\n\n## Installation\n\n```bash\nbun add @elizaos/plugin-localdb\n```\n\n## Quick Start\n\n### Node.js\n\n```typescript\nimport { plugin } from \"@elizaos/plugin-localdb\";\n\n// Add to your agent configuration\nconst agent = {\n  plugins: [plugin],\n  // ...\n};\n```\n\n### Browser\n\n```typescript\nimport { plugin } from \"@elizaos/plugin-localdb\";\n\n// Add to your agent configuration\nconst agent = {\n  plugins: [plugin],\n  // ...\n};\n```\n\n## Configuration\n\n### Environment Variables\n\n| Variable           | Description                             | Default   |\n| ------------------ | --------------------------------------- | --------- |\n| `LOCALDB_DATA_DIR` | Directory for data files (Node.js only) | `./data`  |\n| `LOCALDB_PREFIX`   | localStorage key prefix (Browser only)  | `elizaos` |\n\n## Data Storage\n\n### Node.js (File System)\n\nData is stored as JSON files in a hierarchical directory structure:\n\n```\ndata/\n├── agents/\n│   └── {uuid}.json\n├── memories/\n│   └── {uuid}.json\n├── rooms/\n│   └── {uuid}.json\n├── entities/\n│   └── {uuid}.json\n├── worlds/\n│   └── {uuid}.json\n├── components/\n│   └── {uuid}.json\n├── relationships/\n│   └── {uuid}.json\n├── participants/\n│   └── {uuid}.json\n├── tasks/\n│   └── {uuid}.json\n├── cache/\n│   └── {key}.json\n├── logs/\n│   └── {uuid}.json\n└── vectors/\n    └── hnsw_index.json\n```\n\n### Browser (localStorage)\n\nData is stored in localStorage with a key prefix:\n\n```\nelizaos:agents:{uuid}\nelizaos:memories:{uuid}\nelizaos:rooms:{uuid}\n...\n```\n\n## Vector Search\n\nThe plugin includes a simple HNSW (Hierarchical Navigable Small World) implementation for vector similarity search. This enables:\n\n- Semantic memory search\n- Similar content retrieval\n- Embedding-based queries\n\nThe HNSW index is automatically persisted and loaded with the database.\n\n## API\n\n### Creating an Adapter Manually\n\n```typescript\nimport { LocalDatabaseAdapter, NodeStorage } from \"@elizaos/plugin-localdb\";\n\nconst storage = new NodeStorage(\"./my-data\");\nconst adapter = new LocalDatabaseAdapter(storage, agentId);\nawait adapter.init();\n```\n\n### Browser Usage\n\n```typescript\nimport { LocalDatabaseAdapter, BrowserStorage } from \"@elizaos/plugin-localdb\";\n\nconst storage = new BrowserStorage(\"my-prefix\");\nconst adapter = new LocalDatabaseAdapter(storage, agentId);\nawait adapter.init();\n```\n\n## Comparison with plugin-sql\n\n| Feature      | plugin-localdb     | plugin-sql                |\n| ------------ | ------------------ | ------------------------- |\n| Setup        | Zero configuration | Requires PostgreSQL       |\n| Migrations   | Not needed         | Automatic with Drizzle    |\n| Scalability  | Single process     | Multi-process/distributed |\n| Performance  | Good for dev/small | Production-grade          |\n| Dependencies | None               | PostgreSQL, Drizzle       |\n\n## Use Cases\n\n- ✅ Local development\n- ✅ Testing and CI/CD\n- ✅ Single-user applications\n- ✅ Prototyping\n- ✅ Offline-first apps\n- ⚠️ Not recommended for production with heavy load\n- ⚠️ Not recommended for multi-process deployments\n\n## Multi-Language Support\n\nThis plugin is available in multiple languages:\n\n- **TypeScript/JavaScript**: Full implementation (this package)\n- **Python**: See `python/` directory\n- **Rust**: See `rust/` directory\n\n## License\n\nMIT\n","readmeFilename":"README.md"}