Developer documentation
Everything you need to connect, import data, and start querying with LoamDB.
Get running in 3 steps
From zero to your first query in under 5 minutes.
Connect to LoamDB
import { createLoamDB } from '@loamdb/client';
const db = createLoamDB({
projectId: 'your-project-id',
apiKey: process.env.LOAMDB_API_KEY,
});Import your data
// Upload a CSV — LoamDB auto-detects schema
const job = await db.import({
file: 'people.csv',
type: 'auto', // or 'people', 'clients', 'deals'
});
// Check import status
const status = await db.importStatus(job.id);Query your data
// Direct lookup
const person = await db.lookup('alice@company.com');
// Semantic search
const results = await db.search('engineering managers');
// Graph traversal
const reports = await db.traverse(person.id, {
direction: 'down',
depth: 3,
});MCP tool reference
17 tools available via the Model Context Protocol for structured agent interactions.
| Tool | Description |
|---|---|
| query_entities | Query any entity type with filters, sorting, and pagination |
| get_entity | Retrieve a single entity by ID with full metadata |
| search_semantic | Vector similarity search across all entity types |
| traverse_graph | BFS/DFS traversal of relationship graphs |
| get_org_chart | Retrieve org structure for a given root entity |
| import_csv | Ingest CSV data with automatic schema detection |
| import_status | Check status of an ongoing import job |
| manage_permissions | Create, update, and delete permission rules |
| check_access | Verify if a user can access a specific entity |
| get_schema | Retrieve the current database schema and entity types |
| list_imports | List all import jobs with status and metadata |
| get_statistics | Database-level stats: row counts, storage, index health |
| create_entity | Insert a new entity with validation and indexing |
| update_entity | Update entity fields with audit logging |
| delete_entity | Soft-delete an entity with cascade handling |
| bulk_operations | Batch create, update, or delete operations |
| export_data | Export query results in CSV, JSON, or Parquet format |
Function-calling tool reference
7 tools optimized for LLM function-calling patterns with latency benchmarks.
| Tool | Description | Latency |
|---|---|---|
| lookup_person | Direct entity lookup by email or name | ~20ms |
| search_knowledge | Semantic search with relevance scoring | ~150ms |
| get_org_chart | Manager hierarchy traversal | ~40ms |
| query_pipeline | Deal pipeline queries with stage filters | ~30ms |
| check_permissions | Verify access before data retrieval | ~5ms |
| get_client | Client profile with deal history | ~25ms |
| generate_report | Full RAG synthesis across multiple sources | ~600ms |
Data model overview
Four data models unified on Postgres. Each entity can be accessed through any model.
Relational
Drizzle ORM with TypeScript type safety. Normalized tables for people, clients, deals, compensation.
Graph
Adjacency-list storage with BFS traversal. Org charts, reporting lines, team hierarchies.
Vector
pgvector with HNSW indexing. Semantic search across all entities. 1536-dimension embeddings.
Document
JSONB columns with Schema.org alignment. Flexible metadata per entity type.
Full documentation coming soon
Comprehensive API docs, SDK references, and integration guides will be available at docs.loamdb.com.
Ready to get started?
Sign up for free and run your first query in minutes.