Saltar al contenido principal

Class: abstract BaseIndex<T>

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

Extended by

Type parameters

T

Constructors

new BaseIndex()

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

Parameters

init: BaseIndexInit<T>

Returns

BaseIndex<T>

Source

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

Properties

docStore

docStore: BaseDocumentStore

Source

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


indexStore?

optional indexStore: BaseIndexStore

Source

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


indexStruct

indexStruct: T

Source

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


serviceContext?

optional serviceContext: ServiceContext

Source

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


storageContext

storageContext: StorageContext

Source

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


vectorStore?

optional vectorStore: VectorStore

Source

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

Methods

asQueryEngine()

abstract asQueryEngine(options?): QueryEngine

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

Parameters

options?

you can supply your own custom Retriever and ResponseSynthesizer

options.responseSynthesizer?: BaseSynthesizer

options.retriever?: BaseRetriever

Returns

QueryEngine

Source

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


asRetriever()

abstract asRetriever(options?): BaseRetriever

Create a new retriever from the index.

Parameters

options?: any

Returns

BaseRetriever

Source

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


deleteRefDoc()

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

Parameters

refDocId: string

deleteFromDocStore?: boolean

Returns

Promise<void>

Source

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


insert()

insert(document): Promise<void>

Insert a document into the index.

Parameters

document: Document <Metadata>

Returns

Promise<void>

Source

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


insertNodes()

abstract insertNodes(nodes): Promise<void>

Parameters

nodes: BaseNode <Metadata>[]

Returns

Promise<void>

Source

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