Browse docs

API

Tap to expand

Contribute

APIUpdated 2026-03-18

Projects and Sources

Create a project, add sources, sync them, and verify that the content you expect is actually searchable.

Applies to: Context API v1

Projects and sources are the backbone of RetainDB's retrieval model. If this layer is wrong, every later search result will feel confusing.

What each object does

  • Project: the namespace that owns sources, memory, and retrieval scope
  • Source: the thing you attach to a project, such as GitHub, a URL, a PDF, or raw text

Common first-run flow

  1. Create a project.
  2. Add one source.
  3. Trigger sync if the connector requires it.
  4. Search for content you already know should be there.

Create a project

bash
curl -X POST "https://api.retaindb.com/v1/projects" \
  -H "Authorization: Bearer $RETAINDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "docs-demo"
  }'

Add a source

bash
curl -X POST "https://api.retaindb.com/v1/projects/PROJECT_ID/sources" \
  -H "Authorization: Bearer $RETAINDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product docs",
    "connectorType": "url",
    "config": {
      "url": "https://example.com/docs/getting-started"
    }
  }'

Trigger sync when needed

bash
curl -X POST "https://api.retaindb.com/v1/sources/SOURCE_ID/sync" \
  -H "Authorization: Bearer $RETAINDB_API_KEY"

Direct ingest when you already have content

If you already have the content in hand, POST /v1/projects/:id/ingest is often faster than setting up a connector just to prove the flow works.

The most useful verification step

After adding a source, search for a phrase that you know exists in the source. If you cannot retrieve it, do not keep adding more data. Fix the first source before broadening scope.

Troubleshooting

The source exists but search is empty

Check whether the connector needs a sync step and whether the sync completed.

The results are noisy

Tighten project scope, source config, include paths, or crawl depth before blaming reranking.

Next step

Use choose a connector if you are still deciding which source to add, or sources: add, sync, and troubleshoot if you want the dashboard workflow.

Was this page helpful?

Your feedback helps us prioritize docs improvements weekly.