Skip to main content

Class: SummaryIndex

A SummaryIndex keeps nodes in a sequential order for use with summarization.

Extends

Constructors

new SummaryIndex()

new SummaryIndex(init): SummaryIndex

Parameters

init: BaseIndexInit<IndexList>

Returns

SummaryIndex

Overrides

BaseIndex.constructor

Defined in

packages/llamaindex/src/indices/summary/index.ts:59

Properties

docStore

docStore: BaseDocumentStore

Inherited from

BaseIndex.docStore

Defined in

packages/llamaindex/src/indices/BaseIndex.ts:27


indexStore?

optional indexStore: BaseIndexStore

Inherited from

BaseIndex.indexStore

Defined in

packages/llamaindex/src/indices/BaseIndex.ts:28


indexStruct

indexStruct: IndexList

Inherited from

BaseIndex.indexStruct

Defined in

packages/llamaindex/src/indices/BaseIndex.ts:29


serviceContext?

optional serviceContext: ServiceContext

Inherited from

BaseIndex.serviceContext

Defined in

packages/llamaindex/src/indices/BaseIndex.ts:25


storageContext

storageContext: StorageContext

Inherited from

BaseIndex.storageContext

Defined in

packages/llamaindex/src/indices/BaseIndex.ts:26

Methods

asQueryEngine()

asQueryEngine(options?): RetrieverQueryEngine

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.nodePostprocessors?: BaseNodePostprocessor[]

options.preFilters?: unknown

options.responseSynthesizer?: BaseSynthesizer

options.retriever?: BaseRetriever

Returns

RetrieverQueryEngine

Overrides

BaseIndex.asQueryEngine

Defined in

packages/llamaindex/src/indices/summary/index.ts:173


asRetriever()

asRetriever(options?): BaseRetriever

Create a new retriever from the index.

Parameters

options?

options.mode?: SummaryRetrieverMode

Returns

BaseRetriever

Overrides

BaseIndex.asRetriever

Defined in

packages/llamaindex/src/indices/summary/index.ts:160


deleteNodes()

deleteNodes(nodeIds, deleteFromDocStore): Promise<void>

Parameters

nodeIds: string[]

deleteFromDocStore: boolean

Returns

Promise<void>

Defined in

packages/llamaindex/src/indices/summary/index.ts:236


deleteRefDoc()

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

Parameters

refDocId: string

deleteFromDocStore?: boolean

Returns

Promise<void>

Overrides

BaseIndex.deleteRefDoc

Defined in

packages/llamaindex/src/indices/summary/index.ts:217


getRefDocInfo()

getRefDocInfo(): Promise<Record<string, RefDocInfo>>

Returns

Promise<Record<string, RefDocInfo>>

Defined in

packages/llamaindex/src/indices/summary/index.ts:250


insert()

insert(document): Promise<void>

Insert a document into the index.

Parameters

document: Document<Metadata>

Returns

Promise<void>

Inherited from

BaseIndex.insert

Defined in

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


insertNodes()

insertNodes(nodes): Promise<void>

Parameters

nodes: BaseNode<Metadata>[]

Returns

Promise<void>

Overrides

BaseIndex.insertNodes

Defined in

packages/llamaindex/src/indices/summary/index.ts:211


buildIndexFromNodes()

static buildIndexFromNodes(nodes, docStore, indexStruct?): Promise<IndexList>

Parameters

nodes: BaseNode<Metadata>[]

docStore: BaseDocumentStore

indexStruct?: IndexList

Returns

Promise<IndexList>

Defined in

packages/llamaindex/src/indices/summary/index.ts:196


fromDocuments()

static fromDocuments(documents, args): Promise<SummaryIndex>

Parameters

documents: Document<Metadata>[]

args = {}

args.serviceContext?: ServiceContext

args.storageContext?: StorageContext

Returns

Promise<SummaryIndex>

Defined in

packages/llamaindex/src/indices/summary/index.ts:130


init()

static init(options): Promise<SummaryIndex>

Parameters

options: SummaryIndexOptions

Returns

Promise<SummaryIndex>

Defined in

packages/llamaindex/src/indices/summary/index.ts:63