Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/source/customization/knowledge-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ writes. A 404/410 from version-probing job creation or immediate upload means
the service contract is incompatible; a later polling 404/410 means the job is
missing or expired.

`nrl_collection_ttl_hours` is sent as an absolute expiration when AI-Q creates a
collection, and NRL deletes the expired collection itself. TTL cleanup clears the
document summaries and cached state AI-Q holds for it, so agents stop being
offered documents NRL no longer serves. Expiration comes from NRL rather than
from how long a collection sat idle: the deadline used is the one NRL last
reported for the collection.

The tested service baseline is the immutable NeMo Retriever integration head
[`f3a0b418b7250fa8823ec44dea569b07e2b008cb`](https://github.com/NVIDIA/NeMo-Retriever/commit/f3a0b418b7250fa8823ec44dea569b07e2b008cb),
which contains the collection-management fixes and TXT/HTML service-mode tokenizer support. See the
Expand Down Expand Up @@ -607,6 +614,10 @@ COLLECTION_TTL_HOURS = 24
TTL_CLEANUP_INTERVAL_SECONDS = 3600
```

NeMo Retriever runs the same hourly thread, but that service owns collection lifetime: it deletes collections on the
absolute deadline it was given at creation (`nrl_collection_ttl_hours`), and the thread only expires the summaries and
cached state AI-Q keeps for them rather than deleting anything itself.

---

## Architecture
Expand Down Expand Up @@ -701,7 +712,7 @@ Configuration values are resolved in the following order (highest to lowest prio
| `KNOWLEDGE_INGESTOR_BACKEND` | All | Default ingestor backend (fallback if not in YAML) |
| `AIQ_CHROMA_DIR` | llamaindex | ChromaDB persistence path |
| `AIQ_COLLECTION_TTL_HOURS` | all local/managed backends | Hours before stale collections are deleted (default: 24) |
| `AIQ_TTL_CLEANUP_INTERVAL_SECONDS` | all local/managed backends | Collection cleanup interval (default: 3600) |
| `AIQ_TTL_CLEANUP_INTERVAL_SECONDS` | All | Collection cleanup interval (default: 3600) |
| `RAG_SERVER_URL` | foundational_rag | Query server URL (port 8081) |
| `RAG_INGEST_URL` | foundational_rag | Ingestion server URL (port 8082) |
| `OPENSEARCH_URL` | opensearch | OpenSearch endpoint URL |
Expand Down
28 changes: 28 additions & 0 deletions sources/knowledge_layer/src/nemo_retriever/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,34 @@ separate key for each endpoint.
remote inference. Python 3.13, Intel macOS, local GPU inference, and shared
multi-process data directories are outside the initial support target.

## Summary reconciliation

Document summaries live in AIQ's summary store, but NeMo Retriever owns document
lifetime, including server-side collection expiration. Collections therefore
disappear without AIQ observing a delete. On startup the ingestor reconciles the
two on a background thread: documents NRL serves gain a summary row, rows NRL no
longer backs are removed, and a collection's summaries are cleared once NRL
positively reports the collection as absent.

Reconciliation never blocks or fails startup, and a transport failure leaves the
store untouched rather than deleting summaries NRL could not confirm. The same
pass warms the document-ID-to-filename mapping that document deletes rely on,
and adopts the expirations NRL reports so cleanup also covers collections this
process did not create.

## Collection expiration

`nrl_collection_ttl_hours` is sent as an absolute expiration when AIQ creates a
collection, and NRL deletes the collection itself once that expiration passes.
A background thread retires only what AIQ keeps alongside it — the collection's
summaries and the adapter's cached document state — so agents stop being offered
documents that can no longer be retrieved. It runs every
`AIQ_TTL_CLEANUP_INTERVAL_SECONDS` (3600 by default), the shared knowledge-layer
setting; unlike the other backends, expiration comes from NRL rather than from
how long a collection sat idle. The deadline used is the one NRL last reported,
recorded when AIQ creates or updates a collection and refreshed by startup
reconciliation.

## Upload format and batch contract

AI-Q keeps its global upload allowlist at the common backend subset. To enable
Expand Down
Loading