Operate Context sources
A Context library turns files, database results, or API responses into searchable Documents. Add sources to a library, wait for indexing to complete, and verify results before using the Context in an Action.
This page covers the Context Library UI and its indexing lifecycle. For programmatic Context and Document operations, use the Context API reference.
Before you begin
You need an active workspace membership and a Context library. Open Context and select Add Context if you need to create one. Context libraries are available across Apps in the workspace; an Action uses a library only after you connect that Context to the Action.
Add a source
Open Context, select a library, then open Sources.
Upload files
- Select Add Files or drop files into the upload control.
- Wait for the upload to finish.
- Watch the source status until it reads Ready for Search.
Uploaded files become available as Documents after indexing completes.
The upload form does not currently display a file-size or extension limit. Test representative files before relying on a particular format or size.
Add a database source
- Select Add Source.
- Choose Database under Context Source.
- Select an existing Provider, or create one from the provider selector.
- Enter the source query or filter under Context Configuration.
- Select Add Source.
Database sources support PostgreSQL, MySQL, Elastic, Redis, Pinecone, Snowflake, and MongoDB configuration forms. Successful indexing also depends on valid credentials, network access, and query configuration.
Use a read-only database credential and a bounded query. Source processing executes the saved query again during reindexing, so an unbounded query can increase indexing time, document volume, and embedding cost.
Add an API source
- Select Add Source.
- Choose API under Context Source.
- Enter
url,method, andheadersin Context Configuration. - Select Add Source.
Treat API headers and tokens as sensitive credentials. Use your organization's approved secret-handling process when configuring them.
Understand the indexing lifecycle
After you add or refresh a source, Klu loads the source content, creates Documents, and updates the source status. Wait for Ready for Search before testing retrieval.
Source statuses have these operational meanings:
| Status | Meaning | Operator action |
|---|---|---|
UNPROCESSED | The source has not completed indexing. | Start or retry indexing. |
PROCESSING | Klu is creating or updating Documents. | Wait, then retry or contact your workspace administrator. |
Ready for Search (DONE) | The latest source run completed and Documents were written. | Verify retrieval with Retrieval Test. |
FAILED | The source could not be indexed. | Review the source configuration, then reindex. |
Use the source status and a retrieval test to confirm that indexing succeeded.
Configure retrieval and document splitting
Open the library's Settings tab. The current form enforces these values:
| Setting | Accepted value | Effect |
|---|---|---|
| Retrieval Length | 50–4,096 in the UI | Maximum Context tokens returned to the Action. |
| Docs to Retrieve | 1–100 | Maximum number of candidate Documents. |
| Length | 50–4,000 tokens | Target chunk size for generated Documents. |
| Overlap | 0–100 tokens | Repeated tokens between adjacent chunks. |
| Separator | Text | Boundary used by the sentence splitter; an empty setting falls back to a space during processing. |
Select Save after editing settings. Saved splitting changes do not alter existing Documents. Use Refresh Document Embedding to recreate the library with the new settings.
Verify retrieval
Wait until every required source reads Ready for Search, then:
- Open Documents and confirm that Documents exist and contain expected text and metadata.
- Use the search box for literal search, or enable Semantic search for vector similarity.
- Open Retrieval Test and submit representative production questions.
- Confirm the returned Documents are relevant before connecting or redeploying an Action.
An overall Context badge can read Ready after processing. Source-level statuses and the Documents list give you finer evidence when a library contains several sources.
Refresh, reindex, and delete
Use the refresh control beside an individual source to rebuild only that source. Select several rows and choose Bulk Actions → Reindex Selected to process a batch.
Use Settings → Refresh Document Embedding to rebuild the sources with the saved Context settings. Refreshing replaces the generated Documents and may remove edits made directly to those Documents.
Deleting a source removes it and its generated Documents from the Context. Deleting the Context removes its Action links. Review your organization's retention requirements before deleting either one.
Troubleshoot indexing
A source remains PROCESSING
Check the source configuration and try the source refresh control. Contact your workspace administrator if the source does not progress.
A source reads FAILED
Review the source credentials, network access, query or headers, content format, and Context settings. Correct the problem, then use the source refresh control.
A batch completes with missing Documents
Inspect each source status. Confirm Ready for Search, inspect Documents, and run Retrieval Test for any source that is missing results.
Reindexing removes manual edits
Reindexing replaces the generated Documents for that source. Put durable corrections in the original file, query, or API response.
Retrieval returns stale content
Confirm that Indexed At changed, then inspect the generated Documents. If the source has not changed upstream, reindexing may continue to return the same content.