Skip to content

Knowledge API ​

The Lab0 Knowledge API stores documents and answers questions grounded in them. Upload a file, wait for it to be ready, then ask a question. Every request sees only the files belonging to the user who created the API key.

Start with curl →

Choose your language ​

Each walkthrough runs the complete upload → ready → answer journey and prints the answer with its source files.

LanguageWhat you need
curlBash, curl and jq
PythonPython 3.10+ and requests
Node.jsNode.js 22+; no packages
GoGo 1.22+; standard library only

How it works ​

  1. Create a key. Open Account → API keys in the Lab0 console and create a key with Read & write access. See authentication.
  2. Upload into a namespace. Use a name such as quickstart to group your documents. Lab0 creates the namespace on the first upload.
  3. Wait for ready. Uploads return immediately. Poll the file until processing finishes; stop and inspect error if it fails.
  4. Ask a question. Send a prompt and namespace. Use file_ids to restrict it to particular files. The response contains answer, sources and model.

The production base URL is https://app.lab0.ai/app. Every API path starts with /api/knowledge.

Try a small document ​

Save this as plan.md, or download it. The walkthroughs use this exact file.

md
# Plan

The rollout uses quillfeather checklists.

Ask “How is the rollout run?”. The document says that it uses quillfeather checklists; the returned sources should identify plan.md. The examples use file_ids so other files in your namespace do not affect the question.

Find the details ​

Lab0 developer documentation