Private beta. Early API keys for agent builders, with a free daily sandbox allowance. Read the quickstart

SDKs

@lineage/sdk for TypeScript, with Vercel AI SDK tools, and lineage-api for Python, with LangChain and LlamaIndex tools.

The packages are built and tested in the repo but not yet published to npm or PyPI. Until they are, run them from a clone of the repo, as shown below. The remote MCP server needs no install at all.

git clone https://github.com/Verafyai/lineage-api.git
cd lineage-api
npm ci
npm run build:packages

TypeScript

LineageClient wraps every endpoint with no dependencies and runs on Node 18 or later, Bun, Deno and edge runtimes. Keep the key on the server. Errors throw LineageError with code, status, fix and docsUrl.

import { LineageClient } from "@lineage/sdk";

const lineage = new LineageClient(); // reads LINEAGE_API_KEY
const search = await lineage.searches.run({
  query: "Thomas Lincoln, 1778 to 1851, Kentucky and Illinois",
  depth: "quick",
  budget_credits: 10,
});
for (const record of search.records) console.log(record.title, record.citation.url);

Vercel AI SDK

import { generateText, stepCountIs } from "ai";
import { lineageTools } from "@lineage/sdk/ai";

const { text } = await generateText({
  model,
  tools: lineageTools(),
  stopWhen: stepCountIs(6),
  prompt: "Who were the parents of Thomas Lincoln (1778 to 1851)? Cite each record.",
});

Python

The Python package is lineage-api (the name lineage is taken on PyPI) and imports as lineage_api. It uses only the standard library. LangChain and LlamaIndex tools load when those libraries are installed.

pip install "./packages/sdk-python[langchain]"
from lineage_api import Lineage

lineage = Lineage()  # reads LINEAGE_API_KEY
search = lineage.searches.run(query="Thomas Lincoln, 1778 to 1851, Kentucky and Illinois", budget_credits=10)
for record in search["records"]:
    print(record["title"], record["citation"]["url"])

from lineage_api.langchain import lineage_tools
tools = lineage_tools(lineage)

Good to know

  • Searches about anyone who may be alive return living_person_blocked and cost 0 credits. Lineage researches someone only when a death date is on record, or a birth more than 110 years ago. A relative who may be alive comes back as { relation, living: true } with no name, dates or places.
  • Both SDKs send the key only in the Authorization header and accept an idempotency key on every POST.
  • The SDKs and the MCP server share one tool list, checked by tests against GET /v1/tools.