Saltar al contenido principal

Class: BaseIndex<T>

Indexes are the data structure that we store our nodes and embeddings in so they can be retrieved for our queries.

Type parameters

Name
T

Hierarchy

Constructors

constructor

new BaseIndex<T>(init): BaseIndex<T>

Type parameters

Name
T

Parameters

NameType
initBaseIndexInit<T>

Returns

BaseIndex<T>

Defined in

packages/core/src/indices/BaseIndex.ts:65

Properties

docStore

docStore: BaseDocumentStore

Defined in

packages/core/src/indices/BaseIndex.ts:60


indexStore

Optional indexStore: BaseIndexStore

Defined in

packages/core/src/indices/BaseIndex.ts:62


indexStruct

indexStruct: T

Defined in

packages/core/src/indices/BaseIndex.ts:63


serviceContext

serviceContext: ServiceContext

Defined in

packages/core/src/indices/BaseIndex.ts:58


storageContext

storageContext: StorageContext

Defined in

packages/core/src/indices/BaseIndex.ts:59


vectorStore

Optional vectorStore: VectorStore

Defined in

packages/core/src/indices/BaseIndex.ts:61

Methods

asQueryEngine

asQueryEngine(options?): BaseQueryEngine

Create a new query engine from the index. It will also create a retriever and response synthezier if they are not provided.

Parameters

NameTypeDescription
options?Objectyou can supply your own custom Retriever and ResponseSynthesizer
options.responseSynthesizer?BaseSynthesizer-
options.retriever?BaseRetriever-

Returns

BaseQueryEngine

Defined in

packages/core/src/indices/BaseIndex.ts:85


asRetriever

asRetriever(options?): BaseRetriever

Create a new retriever from the index.

Parameters

NameType
options?any

Returns

BaseRetriever

Defined in

packages/core/src/indices/BaseIndex.ts:78


deleteRefDoc

deleteRefDoc(refDocId, deleteFromDocStore?): Promise<void>

Parameters

NameType
refDocIdstring
deleteFromDocStore?boolean

Returns

Promise<void>

Defined in

packages/core/src/indices/BaseIndex.ts:104


insert

insert(document): Promise<void>

Insert a document into the index.

Parameters

NameType
documentDocument<Metadata>

Returns

Promise<void>

Defined in

packages/core/src/indices/BaseIndex.ts:94


insertNodes

insertNodes(nodes): Promise<void>

Parameters

NameType
nodesBaseNode<Metadata>[]

Returns

Promise<void>

Defined in

packages/core/src/indices/BaseIndex.ts:103