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.

1

Connect to LoamDB

import { createLoamDB } from '@loamdb/client';

const db = createLoamDB({
  projectId: 'your-project-id',
  apiKey: process.env.LOAMDB_API_KEY,
});
2

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);
3

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.

ToolDescription
query_entitiesQuery any entity type with filters, sorting, and pagination
get_entityRetrieve a single entity by ID with full metadata
search_semanticVector similarity search across all entity types
traverse_graphBFS/DFS traversal of relationship graphs
get_org_chartRetrieve org structure for a given root entity
import_csvIngest CSV data with automatic schema detection
import_statusCheck status of an ongoing import job
manage_permissionsCreate, update, and delete permission rules
check_accessVerify if a user can access a specific entity
get_schemaRetrieve the current database schema and entity types
list_importsList all import jobs with status and metadata
get_statisticsDatabase-level stats: row counts, storage, index health
create_entityInsert a new entity with validation and indexing
update_entityUpdate entity fields with audit logging
delete_entitySoft-delete an entity with cascade handling
bulk_operationsBatch create, update, or delete operations
export_dataExport query results in CSV, JSON, or Parquet format

Function-calling tool reference

7 tools optimized for LLM function-calling patterns with latency benchmarks.

ToolDescriptionLatency
lookup_personDirect entity lookup by email or name~20ms
search_knowledgeSemantic search with relevance scoring~150ms
get_org_chartManager hierarchy traversal~40ms
query_pipelineDeal pipeline queries with stage filters~30ms
check_permissionsVerify access before data retrieval~5ms
get_clientClient profile with deal history~25ms
generate_reportFull 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.