Domicile is a private AI stack — vector database, RAG, and a local LLM — that runs entirely in the browser. On-prem-grade data custody and privilege protection, without the on-prem infrastructure. Your documents never leave their legal residence.
Privilege isn't a policy you configure. It's a boundary you build.Domicile — data domiciled in-browser, not on-prem, not in the cloud
Sensitive matter files, privileged communications, and client data never leave the workstation. Domicile runs RAG and generation locally, so attorney-client privilege isn't routed through a third-party cloud.
Domicile is the custody layer you offer clients who want on-prem guarantees without on-prem capital expense. Ship it inside their app, configure residency, walk away — no servers to run, no data plane to secure.
Persistent client-side storage in IndexedDB with a pure-TypeScript HNSW graph index. Hold and search 100K+ documents with cosine, euclidean or dot metrics — real similarity scores, non-rebuilding deletes — all in residence on the device.
Transformers.js with WebGPU acceleration and a WASM fallback. Model weights cached on-device, so repeat queries never reach the network.
WebLLM for GPU-fast inference, Wllama for CPU portability — automatic fallback so generation works on any workstation your firm issues.
Answers grounded in your matter files, with source citations linking every claim back to the document that grounded it — auditable privilege, not black-box output.
Expose your custody layer as Model Context Protocol tools — wire Domicile into Claude Desktop and the agent stacks your integration team already builds on.
Data domiciled on the device — no cloud egress, no third-party processors, no residency drift. The boundary is architectural, not a configuration someone can forget to check.
// npm install @kyrillosishak/domicile import Domicile from '@kyrillosishak/domicile'; // A private, in-browser custody layer const db = new Domicile({ storage: { dbName: 'matter-files' }, index: { dimensions: 384, metric: 'cosine' }, embedding: { model: 'Xenova/all-MiniLM-L6-v2', device: 'webgpu' }, }); await db.initialize(); await db.insert({ text: 'Privileged communication — attorney work product', metadata: { matter: 'M-204', privilege: 'true' }, }); const results = await db.search({ text: 'summary of work product', k: 5 }); console.log(results);
// Retrieval with privilege-aware metadata filtering const results = await db.search({ text: 'indemnification clauses', k: 10, filter: { field: 'matter', operator: 'eq', value: 'M-204' }, }); for (const r of results) { console.log(r.score.toFixed(3), r.metadata); } // Inspect custody state const stats: IndexStats = await db.stats(); console.log(stats.vectorCount, stats.memoryUsage);
import { RAGPipelineManager, WllamaProvider } from '@kyrillosishak/domicile'; const llm = new WllamaProvider({ model: '...' }); const rag = new RAGPipelineManager(db, llm, embedding); // Ask questions grounded in privileged matter files const result = await rag.query('Summarize the indemnification position.', { topK: 3, generateOptions: { maxTokens: 256, temperature: 0.7 }, }); console.log(result.answer); // generated response console.log(result.sources); // cited source documents
import { MCPServer } from '@kyrillosishak/domicile'; // Expose your custody layer as tools for AI agents const mcp = new MCPServer(db, rag); const tools: MCPTool[] = mcp.getTools(); // → [search, insert, rag_query, ...] // Wire into Claude Desktop or any MCP-aware agent mcp.serve({ transport: 'stdio' });
domicile bench — the same suite that gates the build. Measured on a Linux/server CPU (Node); a browser WebGPU run will differ, so run it on your own hardware.Reproduce: npm run build && node dist/cli/index.js bench · node dist/cli/index.js bench --citation
Zero infrastructure. Zero egress. Zero third-party processors. Just the device, the data, and a library that keeps the two together.