# API Reference


## Document Stores


Backend storage systems for documents and embeddings.


[BaseDocumentStore](BaseDocumentStore.md#gdtest_long_names.BaseDocumentStore)  
Abstract base class for document stores.

[DuckDBDocumentStore](DuckDBDocumentStore.md#gdtest_long_names.DuckDBDocumentStore)  
DuckDB-backed document store with vector search.

[PostgreSQLDocumentStore](PostgreSQLDocumentStore.md#gdtest_long_names.PostgreSQLDocumentStore)  
PostgreSQL-backed document store with pgvector.


## DuckDBDocumentStore Methods


Methods for the DuckDBDocumentStore class


[DuckDBDocumentStore.upsert_documents()](DuckDBDocumentStore.upsert_documents.md#gdtest_long_names.DuckDBDocumentStore.upsert_documents)  
Insert or update documents in the store.

[DuckDBDocumentStore.ingest_from_directory()](DuckDBDocumentStore.ingest_from_directory.md#gdtest_long_names.DuckDBDocumentStore.ingest_from_directory)  
Ingest all documents from a directory.

[DuckDBDocumentStore.retrieve_by_similarity()](DuckDBDocumentStore.retrieve_by_similarity.md#gdtest_long_names.DuckDBDocumentStore.retrieve_by_similarity)  
Retrieve documents by vector similarity search.

[DuckDBDocumentStore.retrieve_by_bm25_score()](DuckDBDocumentStore.retrieve_by_bm25_score.md#gdtest_long_names.DuckDBDocumentStore.retrieve_by_bm25_score)  
Retrieve documents using BM25 text scoring.

[DuckDBDocumentStore.retrieve_hybrid_combination()](DuckDBDocumentStore.retrieve_hybrid_combination.md#gdtest_long_names.DuckDBDocumentStore.retrieve_hybrid_combination)  
Retrieve using hybrid vector + BM25 combination.

[DuckDBDocumentStore.build_vector_index()](DuckDBDocumentStore.build_vector_index.md#gdtest_long_names.DuckDBDocumentStore.build_vector_index)  
Build or rebuild the vector similarity index.

[DuckDBDocumentStore.get_collection_size()](DuckDBDocumentStore.get_collection_size.md#gdtest_long_names.DuckDBDocumentStore.get_collection_size)  
Return the number of documents in the store.


## Embedding Providers


Services for generating vector embeddings.


[EmbeddingProvider](EmbeddingProvider.md#gdtest_long_names.EmbeddingProvider)  
Base class for embedding providers.

[OpenAIEmbeddingProvider](OpenAIEmbeddingProvider.md#gdtest_long_names.OpenAIEmbeddingProvider)  
OpenAI embedding provider using text-embedding models.

[CohereEmbeddingProvider](CohereEmbeddingProvider.md#gdtest_long_names.CohereEmbeddingProvider)  
Cohere embedding provider with input type support.


## Chunker Strategies


Strategies for splitting documents into chunks.


[BaseChunkerStrategy](BaseChunkerStrategy.md#gdtest_long_names.BaseChunkerStrategy)  
Abstract base class for document chunking strategies.

[MarkdownChunkerStrategy](MarkdownChunkerStrategy.md#gdtest_long_names.MarkdownChunkerStrategy)  
Markdown-aware chunking strategy that respects heading boundaries.


## Data Types


Type definitions and result containers.


[RetrievedDocumentChunk](RetrievedDocumentChunk.md#gdtest_long_names.RetrievedDocumentChunk)  
A document chunk returned from a retrieval query.

[DocumentMetadataConfig](DocumentMetadataConfig.md#gdtest_long_names.DocumentMetadataConfig)  
Configuration for document metadata extraction.

[EmbeddingVectorResult](EmbeddingVectorResult.md#gdtest_long_names.EmbeddingVectorResult)  
Result container for embedding vector operations.


## Plain Text Names


Classes with long names containing no special characters.


[documentstorewithvectorsearchcapabilities](documentstorewithvectorsearchcapabilities.md#gdtest_long_names.documentstorewithvectorsearchcapabilities)  
A store for documents supporting vector search.

[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT)  
All-uppercase embedding provider class.

[Chunkerstrategywithoverlapdetection](Chunkerstrategywithoverlapdetection.md#gdtest_long_names.Chunkerstrategywithoverlapdetection)  
Initial-cap chunker strategy class.


## documentstorewithvectorsearchcapabilities Methods


Methods for the documentstorewithvectorsearchcapabilities class


[documentstorewithvectorsearchcapabilities.insertdocumentswithembeddings()](documentstorewithvectorsearchcapabilities.insertdocumentswithembeddings.md#gdtest_long_names.documentstorewithvectorsearchcapabilities.insertdocumentswithembeddings)  
Insert documents along with their embedding vectors.

[documentstorewithvectorsearchcapabilities.searchbyvectorsimilarity()](documentstorewithvectorsearchcapabilities.searchbyvectorsimilarity.md#gdtest_long_names.documentstorewithvectorsearchcapabilities.searchbyvectorsimilarity)  
Search for documents by vector similarity.

[documentstorewithvectorsearchcapabilities.rebuildvectorsearchindex()](documentstorewithvectorsearchcapabilities.rebuildvectorsearchindex.md#gdtest_long_names.documentstorewithvectorsearchcapabilities.rebuildvectorsearchindex)  
Rebuild the internal vector search index.

[documentstorewithvectorsearchcapabilities.deletedocumentsbyidentifier()](documentstorewithvectorsearchcapabilities.deletedocumentsbyidentifier.md#gdtest_long_names.documentstorewithvectorsearchcapabilities.deletedocumentsbyidentifier)  
Delete a document by its unique identifier.

[documentstorewithvectorsearchcapabilities.countdocumentsincollection()](documentstorewithvectorsearchcapabilities.countdocumentsincollection.md#gdtest_long_names.documentstorewithvectorsearchcapabilities.countdocumentsincollection)  
Return the total number of documents stored.

[documentstorewithvectorsearchcapabilities.exportcollectiontojsonlines()](documentstorewithvectorsearchcapabilities.exportcollectiontojsonlines.md#gdtest_long_names.documentstorewithvectorsearchcapabilities.exportcollectiontojsonlines)  
Export all documents to a JSON Lines file.


## EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT Methods


Methods for the EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT class


[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.GENERATEEMBEDDINGSFROMTEXTINPUT()](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.GENERATEEMBEDDINGSFROMTEXTINPUT.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.GENERATEEMBEDDINGSFROMTEXTINPUT)  
Generate embeddings from a list of text inputs.

[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.CALCULATETOKENCOUNTFORTEXTS()](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.CALCULATETOKENCOUNTFORTEXTS.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.CALCULATETOKENCOUNTFORTEXTS)  
Calculate total token count for the given texts.

[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.RETRIEVEMODELCONFIGURATION()](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.RETRIEVEMODELCONFIGURATION.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.RETRIEVEMODELCONFIGURATION)  
Retrieve the current model configuration.

[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.VALIDATEINPUTTEXTLENGTHS()](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.VALIDATEINPUTTEXTLENGTHS.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.VALIDATEINPUTTEXTLENGTHS)  
Validate that all input texts are within length limits.

[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.EXPORTEMBEDDINGSTOFILE()](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.EXPORTEMBEDDINGSTOFILE.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.EXPORTEMBEDDINGSTOFILE)  
Export computed embeddings to a file.

[EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.RESETINTERNALBATCHCOUNTER()](EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.RESETINTERNALBATCHCOUNTER.md#gdtest_long_names.EMBEDDINGPROVIDERWITHBATCHPROCESSINGSUPPORT.RESETINTERNALBATCHCOUNTER)  
Reset the internal batch processing counter.


## Chunkerstrategywithoverlapdetection Methods


Methods for the Chunkerstrategywithoverlapdetection class


[Chunkerstrategywithoverlapdetection.splitcontentintochunks()](Chunkerstrategywithoverlapdetection.splitcontentintochunks.md#gdtest_long_names.Chunkerstrategywithoverlapdetection.splitcontentintochunks)  
Split document content into overlapping chunks.

[Chunkerstrategywithoverlapdetection.detectoverlapboundaries()](Chunkerstrategywithoverlapdetection.detectoverlapboundaries.md#gdtest_long_names.Chunkerstrategywithoverlapdetection.detectoverlapboundaries)  
Detect optimal overlap boundary positions.

[Chunkerstrategywithoverlapdetection.mergeundersizedfragments()](Chunkerstrategywithoverlapdetection.mergeundersizedfragments.md#gdtest_long_names.Chunkerstrategywithoverlapdetection.mergeundersizedfragments)  
Merge fragments that are too small to stand alone.

[Chunkerstrategywithoverlapdetection.calculateoverlappercentage()](Chunkerstrategywithoverlapdetection.calculateoverlappercentage.md#gdtest_long_names.Chunkerstrategywithoverlapdetection.calculateoverlappercentage)  
Calculate the average overlap percentage between chunks.

[Chunkerstrategywithoverlapdetection.exportchunkswithoverlap()](Chunkerstrategywithoverlapdetection.exportchunkswithoverlap.md#gdtest_long_names.Chunkerstrategywithoverlapdetection.exportchunkswithoverlap)  
Export chunks with overlap markers to a file.

[Chunkerstrategywithoverlapdetection.resetinternalchunkcache()](Chunkerstrategywithoverlapdetection.resetinternalchunkcache.md#gdtest_long_names.Chunkerstrategywithoverlapdetection.resetinternalchunkcache)  
Reset the internal chunk processing cache.
