ai.2brother.in
checking status…

Retrieval that reads the graph, not just the vectors.

A multi-tenant RAG API over a dense index and a knowledge graph, with speaker-aware transcription built in. It speaks the OpenAI protocol, so every client you already have works unchanged — only the base_url moves.

Open the API reference → Quickstart
API
Vector store
Graph store
Inference node
Model
Quickstart

Point your existing client here

Authenticate with the API key issued for your tenant. Every response carries citations back to the exact chunk — and, for audio, the speaker and timestamp.

# pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://ai.2brother.in/v1",
    api_key="rag_live_…",
)

r = client.chat.completions.create(
    model="qwen3:8b",
    messages=[{"role": "user",
               "content": "What did we agree with Acme on pricing?"}],
)

print(r.choices[0].message.content)
# citations ride along on the response
print(r.model_extra["citations"])
// npm i openai
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://ai.2brother.in/v1",
  apiKey:  process.env.RAG_API_KEY,
});

const stream = await client.chat.completions.create({
  messages: [{ role: "user", content: "Summarise yesterday's call." }],
  stream: true,
});

for await (const part of stream) {
  process.stdout.write(part.choices[0]?.delta?.content ?? "");
}
curl https://ai.2brother.in/v1/chat/completions \
  -H "Authorization: Bearer $RAG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{"role":"user","content":"Who owns the Acme renewal?"}],
    "rag": { "use_graph": true, "top_k": 8 }
  }'

# retrieval only, no generation
curl https://ai.2brother.in/v1/search \
  -H "Authorization: Bearer $RAG_API_KEY" \
  -d '{"query":"renewal terms","top_k":5}'
# Upload a recording. Deepgram diarizes it; every chunk keeps
# its speaker and time window, so answers cite the moment.
curl https://ai.2brother.in/v1/ingest/file \
  -H "Authorization: Bearer $RAG_API_KEY" \
  -F "file=@standup.m4a" \
  -F 'meta={"collection":"calls","deal":"acme"}'

# or hand us a URL — the bytes never touch our server
curl https://ai.2brother.in/v1/ingest/url \
  -H "Authorization: Bearer $RAG_API_KEY" \
  -d '{"url":"https://cdn.example.com/call.mp3"}'

# poll until status = ready
curl https://ai.2brother.in/v1/documents/$DOC_ID \
  -H "Authorization: Bearer $RAG_API_KEY"
Pipeline

What happens to a question

Dense and lexical search disagree usefully. Fusing them on rank, then widening through the graph, surfaces sources that keyword matching alone would miss.

01

Rewrite

Follow-ups get resolved into standalone queries, and named things are pulled out for graph lookup.

02

Dense + lexical

pgvector HNSW cosine search alongside Postgres full-text, fused with reciprocal rank fusion.

03

Graph expansion

Entities in the top hits are walked out two hops in Neo4j, pulling in connected chunks that share no keywords.

04

Diversify

Maximal marginal relevance drops near-duplicates so the context window carries distinct evidence.

05

Ground

A local model answers strictly from context and cites each claim — speaker and timestamp for audio.

06

Meter

Tokens, audio seconds and cost land in an append-only ledger, per tenant, per key.

Endpoints

Surface area

Full schemas, request bodies and try-it-now live in the interactive reference.

POST/v1/chat/completionsGrounded answer. OpenAI-shaped, streams over SSE.
POST/v1/embeddingsVectors from the local embedding model.
POST/v1/searchRetrieval without generation — inspect what matched and why.
POST/v1/ingest/fileUpload a document or recording. Audio routes to Deepgram.
POST/v1/ingest/urlIngest from a remote URL.
POST/v1/ingest/textIngest raw text directly.
GET/v1/documentsList, inspect and delete indexed sources.
GET/v1/graph/entitiesEntities extracted from your corpus, by mention count.
GET/v1/graph/neighbourhoodSubgraph around an entity, ready to render.
GET/v1/usageSpend this period, broken down by kind.
POST/v1/invoices/previewDraft invoice for the period in progress.