Skip to documentation

Build with repository intelligence.

Move from a repository overview to prepared, source-backed questions without leaving the Dandi workflow.

Repository intelligence flow

Summarize gives an immediate overview of an accessible repository. Prepare indexes public repository content into retrieval-ready chunks. Ask retrieves relevant prepared context and returns an answer with source evidence when matches are available.

Summarize

Inspect structure, purpose, and key components immediately.

Prepare

Create or restore a durable completed preparation job for a public repository.

Ask

Query the prepared public repository and inspect associated evidence.

Preparation enables Ask; it is not required for Summary. Summary does not automatically prepare a repository.

Quickstart

1. Create or select an API key in Workspace Settings → API access. 2. Choose a public GitHub repository URL. 3. Send this Summary request. 4. Inspect the streamed response and metadata. 5. Open the same workflow in Playground.
summary-request
curl -X POST https://dandi-orcin.vercel.app/api/github-summarizer \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"githubUrl":"https://github.com/facebook/react"}'
Open Summarize in Playground →

Send your API key with every request

All documented endpoints accept JSON requests and require x-api-key: YOUR_API_KEY. Keep keys server-side; never place a live key in browser code or a public repository.
HeaderRequiredValue
Content-TypeYesapplication/json
x-api-keyYesYour Dandi API key

Summary, Prepare, and Ask currently support public GitHub repositories only. A connected GitHub App is display-only integration metadata and does not authorize private repository reads.

/api/github-summarizer

Repository Summary

Generate a README-grounded overview of a public repository's documented purpose, features, setup, and architecture when supported by the README. GitHub metadata is attached separately. This endpoint does not prepare the repository for later questions.

Open Summarize in Playground
ParameterRequiredDescription
githubUrlYesFull public GitHub repository URL, such as https://github.com/owner/repo.

The successful body is a streamed structured summary based on README evidence. Repository metadata is supplied in the x-github-metadata response header as base64-encoded JSON.

Invalid URLs return 400; unavailable or private repositories can return 404, 403, or 422 depending on visibility and metadata retrieval.

repository-summary-request
curl -X POST https://dandi-orcin.vercel.app/api/github-summarizer \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"githubUrl":"https://github.com/facebook/react"}'
/api/rag/ingest

Prepare repository

Index a public repository into retrieval-ready chunks. Prepare is required before asking source-backed questions; completed jobs may be restored rather than indexed again. Private repository preparation is not supported.

Open Prepare & Ask in Playground
ParameterRequiredDescription
githubUrlYesFull public GitHub repository URL.
prepare-repository-request
curl -X POST https://dandi-orcin.vercel.app/api/rag/ingest \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"githubUrl":"https://github.com/facebook/react"}'
prepare-repository-response
{
  "success": true,
  "jobId": "JOB_ID",
  "repoUrl": "https://github.com/facebook/react",
  "status": "queued",
  "currentStep": "queued"
}

Use GET /api/rag/ingest?jobId=JOB_ID with the same API key to inspect a job. A completed job includes its status, current step, and available preparation summary such as file and chunk counts when returned.

/api/rag/chat

Ask a repository

Retrieve relevant prepared public-repository context and generate a streamed answer. The response can attach source evidence for the matched repository content. Private repository chat is not supported.

Open Prepare & Ask in Playground
ParameterRequiredDescription
githubUrlYesThe prepared public GitHub repository URL.
messagesYesMessage objects with role (user or assistant) and content strings.
ask-repository-request
curl -N -X POST https://dandi-orcin.vercel.app/api/rag/chat \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "githubUrl":"https://github.com/facebook/react",
    "messages":[{"role":"user","content":"Where is state managed?"}]
  }'

Answers stream in the response body. The optional x-rag-sources header describes retrieved repository evidence; it is context associated with the prepared repository, not chain-of-thought or a promise of an exact source count.

Responses and source evidence

Summary and Ask return streaming text. Prepare returns JSON. Read headers alongside streams when you need repository metadata or the evidence that was retrieved for an answer.
source-evidence-header
x-rag-sources: [{
  "chunkId": "CHUNK_ID",
  "filePath": "packages/react/src/ReactClient.js",
  "preview": "…",
  "similarity": 0.872
}]

How to use sources

  • filePath identifies the matching repository file.
  • preview is a short excerpt and may be absent.
  • similarity is retrieval metadata, not a confidence guarantee.
  • chunkId is a technical identifier for the matched chunk.

If no relevant evidence is returned, verify that the repository was prepared, refine the question, and retry only when appropriate. An empty source list does not expose internal model reasoning.

Errors and recovery

Errors use status codes and safe messages. Check the request, access, and limits before retrying; retries are not guaranteed to succeed.
400

Invalid repository URL or request

Use a full GitHub repository URL and valid message payload. Correct the input before retrying.

401

Missing or invalid API key

Send x-api-key and verify the key is active. Create or select a valid key before retrying.

403 / 404

Repository access or request allowance

Summary, Prepare, and Ask require a public repository. Also check your plan allowance and repository URL.

422

Repository metadata failure

The repository could not be fetched or interpreted. Verify availability and retry later if the repository is temporarily unavailable.

429

Request limit exceeded

Wait before retrying. Summary, Prepare, and Ask have endpoint-specific limits.

503

Repository verification or retrieval unavailable

Dandi could not safely verify public access or retrieve prepared evidence. Wait briefly and retry without changing repository permissions.

500

Summary, ingestion, or chat failure

Retry only after checking the request. If it persists, use the safe error message when contacting support.