retrieveChunksFromDocuments
chainalign-backend / services/RAGService / retrieveChunksFromDocuments
Function: retrieveChunksFromDocuments()
retrieveChunksFromDocuments(
query,tenant_id,k,user):Promise<any[]>
Defined in: services/RAGService.js:137
Retrieves the most relevant chunks from tenant-specific uploaded documents.
Parameters
query
string
The user query.
tenant_id
string
The tenant's ID to scope the search.
k
number = 5
The number of top relevant chunks to retrieve.
user
any
The user object (e.g., from req.user).
Returns
Promise<any[]>
An array of objects containing relevant text content and the source document name.\n