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
- Create a project.
- Add one source.
- Trigger sync if the connector requires it.
- Search for content you already know should be there.
Create a project
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
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
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.