RetrievalAgent
@nuclia/core • Docs
@nuclia/core / RetrievalAgent
Class: RetrievalAgent
Provides access to all the Retrieval Agent contents and services.
Extends
Implements
Constructors
new RetrievalAgent()
new RetrievalAgent(
nuclia,account,data):RetrievalAgent
Parameters
• nuclia: INuclia
• account: string
• data: IKnowledgeBoxBase | IKnowledgeBoxStandalone
Returns
Inherited from
WritableKnowledgeBox.constructor
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:148
Properties
accountId
accountId:
string
Inherited from
WritableKnowledgeBox.accountId
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:98
admin?
optionaladmin:boolean
True if the current user is an administrator of the Knowledge Box.
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:923
allowed_ip_addresses?
optionalallowed_ip_addresses:null|string[]
Implementation of
IRetrievalAgent.allowed_ip_addresses
Inherited from
WritableKnowledgeBox.allowed_ip_addresses
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:29
allowed_origins?
optionalallowed_origins:null|string[]
Implementation of
IRetrievalAgent.allowed_origins
Inherited from
WritableKnowledgeBox.allowed_origins
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:28
contrib?
optionalcontrib:boolean
True if the current user is a contributor of the Knowledge Box.
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:925
description?
optionaldescription:string
Implementation of
Inherited from
WritableKnowledgeBox.description
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:26
external_index_provider?
optionalexternal_index_provider:string
Implementation of
IRetrievalAgent.external_index_provider
Inherited from
WritableKnowledgeBox.external_index_provider
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:33
hidden_resources_enabled?
optionalhidden_resources_enabled:boolean
Implementation of
IRetrievalAgent.hidden_resources_enabled
Inherited from
WritableKnowledgeBox.hidden_resources_enabled
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:31
hidden_resources_hide_on_creation?
optionalhidden_resources_hide_on_creation:boolean
Implementation of
IRetrievalAgent.hidden_resources_hide_on_creation
Inherited from
WritableKnowledgeBox.hidden_resources_hide_on_creation
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:32
id
id:
string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:22
nuclia
protectednuclia:INuclia
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:99
search_configs?
optionalsearch_configs:object
Index Signature
[key: string]: any
Implementation of
IRetrievalAgent.search_configs
Inherited from
WritableKnowledgeBox.search_configs
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:30
slug
slug:
string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:23
state?
optionalstate:KBStates
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:25
title
title:
string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:24
wsOpeningCount
wsOpeningCount:
number=0
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:117
zone
zone:
string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.models.ts:27
Accessors
activityMonitor
getactivityMonitor():ActivityMonitor
Returns
Implementation of
IRetrievalAgent.activityMonitor
Inherited from
WritableKnowledgeBox.activityMonitor
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:957
fullpath
getfullpath():string
The Knowledge Box fullpath on the regional API.
Example: https://europe-1.rag.progress.cloud/api/v1/kb/3cce4a71-9cb9-4fda-beee-8a1512616bf0
Returns
string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:144
path
getpath():string
The Retrieval Agent path on the regional API.
Returns
string
Implementation of
Overrides
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:45
syncManager
getsyncManager():ISyncManager
Returns
Implementation of
Inherited from
WritableKnowledgeBox.syncManager
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:941
taskManager
gettaskManager():TaskManager
Entry point to task manager
Returns
Implementation of
Inherited from
WritableKnowledgeBox.taskManager
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:934
training
gettraining():Training
Deprecated
Returns
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:951
Methods
addContext()
addContext(
agent):Observable<object>
Add a context agent to the Retrieval Agent.
Parameters
• agent: ContextAgentCreation
data representing the context agent to add
Returns
Observable<object>
An observable providing the created agent id.
id
id:
string
Implementation of
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:389
addDriver()
addDriver(
driver):Observable<void>
Add driver to the Retrieval Agent
Parameters
• driver: DriverCreation
BraveDriver | CypherDriver | NucliaDBDriver | PerplexityDriver | TavilyDriver | SqlDriver | McpDriver
Returns
Observable<void>
Implementation of
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:306
addGeneration()
addGeneration(
agent):Observable<object>
Add a generation agent to the Retrieval Agent.
Parameters
• agent: GenerationAgentCreation
data representing the generation agent to add.
Returns
Observable<object>
An observable providing the created agent id.
id
id:
string
Implementation of
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:422
addPostprocess()
addPostprocess(
agent):Observable<object>
Add a postprocess agent to the Retrieval Agent.
Parameters
• agent: PostprocessAgentCreation
data representing the postprocess agent to add
Returns
Observable<object>
An observable providing the created agent id.
id
id:
string
Implementation of
IRetrievalAgent.addPostprocess
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:455
addPreprocess()
addPreprocess(
agent):Observable<object>
Add a preprocess agent to the Retrieval Agent.
Parameters
• agent: PreprocessAgentCreation
data representing the preprocess agent to add
Returns
Observable<object>
An observable providing the created agent id.
id
id:
string
Implementation of
Defined in
libs/sdk-core/src/lib/db/retrieval-agent/retrieval-agent.ts:356
addVectorset()
addVectorset(
model):Observable<void>
Add an embedding model to the Knowledge box
Parameters
• model: string
Returns
Observable<void>
Implementation of
Inherited from
WritableKnowledgeBox.addVectorset
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:1236
ask()
ask(query, context, features, options)
ask(
query,context?,features?,options?):Observable<Answer|IErrorResponse>
Retrieves a generative answer for the given query.
The generative answer is a text that is generated chunk by chunk by the language model.
It is retrieved through a readable HTTP stream, so the chat() method returns an Observable
emitting a value each time a new chunk is available.
The incomplete attribute of the emitted value indicates if the asnwer is complete or not.
Example:
nuclia.knowledgeBox
.ask('where does the Little Prince live')
.pipe(filter((answer) => !answer.incomplete))
.subscribe((answer) => {
console.log(answer.text);
});
Parameters
• query: string
• context?: ContextEntry[]
• features?: Features[]
• options?: ChatOptions
Returns
Observable<Answer | IErrorResponse>
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:358
ask(query, context, features, options, callback)
ask(
query,context?,features?,options?,callback?):Observable<null>
Parameters
• query: string
• context?: ContextEntry[]
• features?: Features[]
• options?: ChatOptions
• callback?
Returns
Observable<null>
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:364
batchUpload()
batchUpload(
files):Observable<UploadStatus>
Uploads a list of files to the Knowledge Box. It automatically creates a new resource for each file and uses the TUS protocol to upload the files.
Parameters
• files: FileList | File[] | FileWithMetadata[]
Returns
Observable<UploadStatus>
Implementation of
Inherited from
WritableKnowledgeBox.batchUpload
Defined in
libs/sdk-core/src/lib/db/kb/kb.ts:1151
catalog()
catalog(
query,options?):Observable<Results|IErrorResponse>
Parameters
• query: string | CatalogQuery
• options?: CatalogOptions
Returns
Observable<Results | IErrorResponse>