v0.4.0 · MIT License · Zero Dependencies

Agents forget.
dpth remembers.

Every agent encounters the same entities — people, companies, products — scattered across APIs, documents, and conversations. dpth gives your agent structured memory that persists, connects, and learns.

$ npm install dpth click to copy

Same person. Ten different places. One record.

Your agent reads a Stripe charge from john@company.com, a GitHub commit by jsmith, and a support ticket from John Smith. Are these the same person?

dpth resolves that automatically — fuzzy name matching, email matching, alias tracking, confidence scoring. One entity, all sources attached.

Works with any entity type: people, companies, products, merchants, legal entities — or define your own. Open type system, not a closed enum.

import { dpth } from 'dpth/dpth'; const db = dpth(); // Stripe customer await db.entity.resolve({ type: 'person', name: 'John Smith', source: 'stripe', externalId: 'cus_123', email: 'john@company.com' }); // GitHub contributor await db.entity.resolve({ type: 'person', name: 'jsmith', source: 'github', externalId: 'jsmith-gh', email: 'john@company.com' }); // → auto-merged. One entity, two sources.

Every value has a timeline. Nothing is overwritten.

Most databases give you the current value. dpth gives you every version — when it changed, what it was before, and what's different now.

Automatic diffing, time-travel queries, and change detection built in. Your agent can answer "what changed since last Tuesday?" without you building anything.

Snapshots are immutable and content-addressed (SHA-256). Cache forever, deduplicate automatically.

// Snapshot your data — every version is saved await db.temporal.snapshot('dashboard', { revenue: 50000, users: 200 }); // ... time passes ... await db.temporal.snapshot('dashboard', { revenue: 55000, users: 220 }); // What changed? const history = await db.temporal.history('dashboard'); const diff = db.temporal.diff(history[0], history[1]); // → revenue: 50000 → 55000, users: 200 → 220

Hidden connections your agent would never think to look for.

Revenue went up 20% the same month deploys doubled. Your biggest customer opened 3 support tickets right before churning. A product mention spiked the day after a conference.

dpth tracks metrics from any source and finds correlations automatically — Pearson coefficient, lag detection, trend alignment. Your agent spots patterns across data it's never explicitly connected.

Capped at 10K data points per metric. Automatic memory management — no unbounded growth.

// Track metrics from anywhere await db.correlation.track('mrr', 50000); await db.correlation.track('deploys', 12); await db.correlation.track('support_tickets', 8); // What correlates with revenue? const patterns = await db.correlation.find('mrr'); // → deploys correlates with mrr // (r=0.87, 3-day lag) // Feed data from any source — APIs, PDFs, // emails, conversations — dpth finds the // connections you'd never think to query.

In-memory by default. Persistent when you need it.

Zero config to start — runs in-memory for scripts, testing, and serverless. Add SQLite for persistence that survives restarts. Layer on vector search for semantic similarity. Or write your own adapter.

// Default: in-memory — zero config, zero deps const db = dpth(); // Persistent: add SQLite (npm install better-sqlite3) import { SQLiteAdapter } from 'dpth/adapter-sqlite'; const db = dpth({ adapter: new SQLiteAdapter('./memory.db') }); // Semantic: add vector search on top import { VectorOverlay } from 'dpth/adapter-vector'; const db = dpth({ adapter: new VectorOverlay(new SQLiteAdapter('./memory.db')) }); // Custom: implement StorageAdapter for any backend

Waze, but for agent decisions.

Every dpth instance works locally. With one flag, it also contributes what it learns — anonymized calibration signals — to a shared network. Not just entity resolution. Any domain: tool selection, error recovery, API reliability. Open vocabulary — agents submit whatever they learn.

One flag. Open vocabulary. Zero PII.

When you enable the network, dpth sends statistical signals about which strategies work — not your data. Agents define their own domains. The coordinator aggregates whatever comes in. Statistical convergence determines what's useful.

const db = dpth({ network: true }); // Entity resolution — signals sent automatically await db.entity.resolve({ /* ... */ }); // Report outcomes for ANY domain db.signal.report({ domain: 'tool_selection', context: 'summarize_url', strategy: 'web_fetch', condition: 'static_site', success: true, cost: 5, }); // Query what the network knows const cal = await db.signal.query({ domain: 'tool_selection', }); // → [{ strategy: 'web_fetch', successRate: 0.94 }]

What's sent

{ "domain": "tool_selection", "context": "summarize_url", "strategy": "web_fetch", "condition": "static_site", "successRate": 0.94 }

What's never sent

Names, emails, entity IDs, source data, attributes, aliases, or any PII. The network learns patterns, not people.
69
Tests Passing
90KB
Package Size
0
Dependencies
v0.4.0
Latest Release

Give your agent a memory.

MIT licensed. Zero dependencies. Works anywhere Node runs.
Opt into the network when you're ready.