Live on Base mainnet · 768-dim embeddings

Persistent legal memory
for AI agents that
can't afford to forget.

Namespace-isolated, audit-logged semantic memory exposed as a simple HTTP API. Pay per call in USDC on Base — or a flat monthly rate through Stripe. Designed for the standards of practice, not consumer chat.

  • 1,000 free calls
  • No credit card
  • Namespace isolation
  • Audit logged
POST /recall  ·  api.lawmem.ai
# Recall the top 5 semantically relevant
# memories for a specific matter.

import httpx

r = httpx.post(
    "https://api.lawmem.ai/recall",
    headers={"Authorization": f"Bearer {KEY}"},
    json={
        "query":     "NDA breach damages New York",
        "matter_id": "case-2024-001",
        "top_k":     5,
    },
)

for hit in r.json()["results"]:
    print(hit["score"], hit["text"][:80])
Why LawMem

Built for legal AI — not retrofitted from general-purpose tools.

Three properties every legal workflow needs, engineered into the data layer — not bolted on at the application layer.

Privilege protected

Namespace isolation ensures one firm's memories never touch another's. Every API key maps to a dedicated tenant_id — enforced at the query level, not the application level.

Audit ready

Every store and recall is logged with timestamp, wallet, agent ID, and query. A PostgreSQL audit trail designed for e-discovery and compliance review. DPA available to Legal Pro customers.

Legal-domain embeddings

Powered by nomic-embed-text — 768-dimensional cosine similarity optimised for dense legal text: contracts, pleadings, depositions, and case notes.

Architecture

One API call, four services, zero infrastructure.

Your agent issues HTTP requests. LawMem handles embeddings, vector search, namespace enforcement, audit logging, and payment — so your agent code stays about the agent.

Quick Start

Integrate in under five minutes.

First 1,000 calls are free — no API key purchase required. After the free tier, x402 payment on Base network handles billing automatically.

# Store a memory
curl -X POST https://api.lawmem.ai/store \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Client retained firm for M&A due
      diligence. Target: Acme Corp. NDA
      signed 2024-01-15. Closing Q2 2024.",
    "matter_id": "matter-acme-2024",
    "agent_id":  "due-diligence-agent",
    "source_doc": "retainer_letter.pdf"
  }'

# Recall semantically relevant memories
curl -X POST https://api.lawmem.ai/recall \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query":     "M&A due diligence NDA",
    "matter_id": "matter-acme-2024",
    "top_k":     5
  }'
import httpx

BASE = "https://api.lawmem.ai"
KEY  = "YOUR_KEY"
HDR  = {"Authorization": f"Bearer {KEY}"}

def store(text, matter_id, agent_id="agent",
          source_doc=None):
    r = httpx.post(f"{BASE}/store",
        headers=HDR,
        json={
            "text":       text,
            "matter_id":  matter_id,
            "agent_id":   agent_id,
            "source_doc": source_doc,
        }
    )
    if r.status_code == 402:
        handle_payment(r)
        return
    r.raise_for_status()
    return r.json()["id"]

def recall(query, matter_id=None, top_k=5):
    r = httpx.post(f"{BASE}/recall",
        headers=HDR,
        json={
            "query":     query,
            "matter_id": matter_id,
            "top_k":     top_k,
        }
    )
    if r.status_code == 402:
        handle_payment(r)
        return []
    r.raise_for_status()
    return r.json()["results"]
const BASE = "https://api.lawmem.ai";
const KEY  = "YOUR_KEY";

async function store(text, matterId, agentId) {
  const res = await fetch(`${BASE}/store`, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${KEY}`,
      "Content-Type":  "application/json",
    },
    body: JSON.stringify({
      text:      text,
      matter_id: matterId,
      agent_id:  agentId,
    }),
  });

  if (res.status === 402) {
    const body = await res.json();
    await handleX402Payment(body);
    return;
  }

  return (await res.json()).id;
}

async function recall(query, matterId, topK=5) {
  const res = await fetch(`${BASE}/recall`, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${KEY}`,
      "Content-Type":  "application/json",
    },
    body: JSON.stringify({
      query:     query,
      matter_id: matterId,
      top_k:     topK,
    }),
  });

  if (res.status === 402) {
    await handleX402Payment(await res.json());
    return [];
  }

  const { results } = await res.json();
  return results;
}
Stay in the loop

Get the integration guide.

Pick what fits your role — we'll send a PDF walk-through by email, and occasionally a new pattern or case study when it's worth your time.

Who are you?

One email, no spam. Unsubscribe any time.

Check your inbox.

The guide is on its way. If you don't see it in two minutes, check spam and add david@lawmem.ai to your safe senders.

Pricing

Start free. Pay only when you scale.

Subscription plans via Stripe. Pay-as-you-go via x402 on Base. No credit card for free tier.

Free
$0
1,000 lifetime calls
  • All endpoints included
  • Namespace isolation
  • Audit logs
  • 768-dim embeddings
Get started
Pay-as-you-go
$0.005/call
No monthly commitment
  • USDC on Base (eip155:8453)
  • Automatic x402 payment
  • Audit logs
  • No cap
Get started
Legal Pro DPA DPA
$499/mo
150,000 calls · $0.0033 effective (save 33%)
  • 150,000 calls / month included
  • Overage at $0.005/call via x402
  • Namespace isolation
  • DPA included
  • Priority support
Start Legal Pro
Enterprise
Custom
Volume pricing · Custom SLA
  • Custom volume & pricing
  • Custom SLA
  • SOC 2 docs on request
  • Procurement support
Contact sales
Trust & Security

Built for compliance from day one.

SSL secured

TLS 1.3 via Let's Encrypt. Auto-renewed. HSTS enabled.

Namespace isolated

Every API key is bound to a tenant_id. No cross-tenant data leakage — enforced at query level.

Audit logged

Every store, recall, and delete recorded in PostgreSQL with wallet, timestamp, and query hash.

DPA available

DPA available to Legal Pro customers.

Right to erasure

DELETE /memory/{id} performs a hard delete from both vector store and PostgreSQL for legal compliance.