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
-
BaseIndex
Constructors
constructor
• new BaseIndex<T
>(init
)
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
init | BaseIndexInit <T > |
Defined in
packages/core/src/indices/BaseIndex.ts:161
Properties
docStore
• docStore: BaseDocumentStore
Defined in
packages/core/src/indices/BaseIndex.ts:156
indexStore
• Optional
indexStore: BaseIndexStore
Defined in
packages/core/src/indices/BaseIndex.ts:158
indexStruct
• indexStruct: T
Defined in
packages/core/src/indices/BaseIndex.ts:159
serviceContext
• serviceContext: ServiceContext
Defined in
packages/core/src/indices/BaseIndex.ts:154
storageContext
• storageContext: StorageContext
Defined in
packages/core/src/indices/BaseIndex.ts:155
vectorStore
• Optional
vectorStore: VectorStore
Defined in
packages/core/src/indices/BaseIndex.ts:157
Methods
asQueryEngine
▸ Abstract
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
Name | Type | Description |
---|---|---|
options? | Object | you can supply your own custom Retriever and ResponseSynthesizer |
options.responseSynthesizer? | ResponseSynthesizer | - |
options.retriever? | BaseRetriever | - |
Returns
Defined in
packages/core/src/indices/BaseIndex.ts:181
asRetriever
▸ Abstract
asRetriever(options?
): BaseRetriever
Create a new retriever from the index.
Parameters
Name | Type |
---|---|
options? | any |
Returns
Defined in
packages/core/src/indices/BaseIndex.ts:174
deleteRefDoc
▸ Abstract
deleteRefDoc(refDocId
, deleteFromDocStore?
): Promise
<void
>
Parameters
Name | Type |
---|---|
refDocId | string |
deleteFromDocStore? | boolean |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/BaseIndex.ts:199
insert
▸ insert(document
): Promise
<void
>
Insert a document into the index.
Parameters
Name | Type |
---|---|
document | Document <Metadata > |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/BaseIndex.ts:190
insertNodes
▸ Abstract
insertNodes(nodes
): Promise
<void
>
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
Returns
Promise
<void
>