Skip to main content

Namespace: ragCore

Namespaces

Interfaces

References

AddAssistantMessageParams

Re-exports AddAssistantMessageParams


AddConversationMessageParams

Re-exports AddConversationMessageParams


AddFunctionMessageParams

Re-exports AddFunctionMessageParams


AddManyConversationMessagesParams

Re-exports AddManyConversationMessagesParams


AddMessageParams

Re-exports AddMessageParams


AddSomeMessageParams

Re-exports AddSomeMessageParams


AddSystemMessageParams

Re-exports AddSystemMessageParams


AddUserMessageParams

Re-exports AddUserMessageParams


AssistantMessage

Re-exports AssistantMessage


AssistantMessageMetadata

Re-exports AssistantMessageMetadata


CallToolResponse

Re-exports CallToolResponse


ChatLlm

Re-exports ChatLlm


ChunkFunc

Re-exports ChunkFunc


ChunkMetadataGetter

Re-exports ChunkMetadataGetter


ChunkOptions

Re-exports ChunkOptions


ChunkTransformer

Re-exports ChunkTransformer


CommentMessageParams

Re-exports CommentMessageParams


ContentChunk

Re-exports ContentChunk


Conversation

Re-exports Conversation


ConversationConstants

Re-exports ConversationConstants


ConversationCustomData

Re-exports ConversationCustomData


ConversationsService

Re-exports ConversationsService


CreateConversationParams

Re-exports CreateConversationParams


DbMessage

Re-exports DbMessage


DeleteEmbeddedContentArgs

Re-exports DeleteEmbeddedContentArgs


DeletePagesArgs

Re-exports DeletePagesArgs


EmbedArgs

Re-exports EmbedArgs


EmbedConcurrencyOptions

Re-exports EmbedConcurrencyOptions


EmbedResult

Re-exports EmbedResult


EmbeddedContent

Re-exports EmbeddedContent


EmbeddedContentStore

Re-exports EmbeddedContentStore


Embedder

Re-exports Embedder


FindByIdParams

Re-exports FindByIdParams


FindContentFunc

Re-exports FindContentFunc


FindContentFuncArgs

Re-exports FindContentFuncArgs


FindContentResult

Re-exports FindContentResult


FindVerifiedAnswerFunc

Re-exports FindVerifiedAnswerFunc


FindVerifiedAnswerFuncArgs

Re-exports FindVerifiedAnswerFuncArgs


FindVerifiedAnswerResult

Re-exports FindVerifiedAnswerResult


FunctionMessage

Re-exports FunctionMessage


LlmAnswerQuestionParams

Re-exports LlmAnswerQuestionParams


LlmCallToolParams

Re-exports LlmCallToolParams


LoadPagesArgs

Re-exports LoadPagesArgs


MakeDefaultFindContentFuncArgs

Re-exports MakeDefaultFindContentFuncArgs


MakeDefaultFindVerifiedAnswerFuncArgs

Re-exports MakeDefaultFindVerifiedAnswerFuncArgs


MakeLangChainEmbedderParams

Re-exports MakeLangChainEmbedderParams


MakeLangchainChatLlmProps

Re-exports MakeLangchainChatLlmProps


MakeMongoDbEmbeddedContentStoreParams

Re-exports MakeMongoDbEmbeddedContentStoreParams


MakeMongoDbPageStoreParams

Re-exports MakeMongoDbPageStoreParams


MakeOpenAiChatLlmParams

Re-exports MakeOpenAiChatLlmParams


MakeOpenAiEmbedderArgs

Re-exports MakeOpenAiEmbedderArgs


Message

Re-exports Message


MessageBase

Re-exports MessageBase


MongoDbEmbeddedContentStore

Re-exports MongoDbEmbeddedContentStore


MongoDbPageStore

Re-exports MongoDbPageStore


OpenAIChatCompletionWithoutUsage

Re-exports OpenAIChatCompletionWithoutUsage


OpenAiAwaitedResponse

Re-exports OpenAiAwaitedResponse


OpenAiChatMessage

Re-exports OpenAiChatMessage


OpenAiMessageRole

Re-exports OpenAiMessageRole


OpenAiStreamingResponse

Re-exports OpenAiStreamingResponse


Page

Re-exports Page


PageAction

Re-exports PageAction


PageConcurrencyOptions

Re-exports PageConcurrencyOptions


PageFormat

Re-exports PageFormat


PageMetadata

Re-exports PageMetadata


PageStore

Re-exports PageStore


PersistedPage

Re-exports PersistedPage


Question

Re-exports Question


RateMessageParams

Re-exports RateMessageParams


SearchBooster

Re-exports SearchBooster


SomeMessage

Re-exports SomeMessage


SomeTokenizer

Re-exports SomeTokenizer


SystemMessage

Re-exports SystemMessage


SystemPrompt

Re-exports SystemPrompt


Tool

Re-exports Tool


ToolCallDirective

Re-exports ToolCallDirective


ToolCallParams

Re-exports ToolCallParams


UserMessage

Re-exports UserMessage


VerifiedAnswer

Re-exports VerifiedAnswer


VerifiedAnswerEventData

Re-exports VerifiedAnswerEventData


VerifiedAnswerStore

Re-exports VerifiedAnswerStore


WithFilterAndK

Re-exports WithFilterAndK


asPageFormat

Re-exports asPageFormat


chunkCode

Re-exports chunkCode


chunkMd

Re-exports chunkMd


chunkOpenApiSpecYaml

Re-exports chunkOpenApiSpecYaml


chunkPage

Re-exports chunkPage


createMessage

Re-exports createMessage


createMessageFromOpenAIChatMessage

Re-exports createMessageFromOpenAIChatMessage


defaultConversationConstants

Re-exports defaultConversationConstants


defaultOpenApiSpecYamlChunkOptions

Re-exports defaultOpenApiSpecYamlChunkOptions


extractFrontMatter

Re-exports extractFrontMatter


getChangedPages

Re-exports getChangedPages


isPageFormat

Re-exports isPageFormat


isSupportedLanguage

Re-exports isSupportedLanguage


makeBoostOnAtlasSearchFilter

Re-exports makeBoostOnAtlasSearchFilter


makeChunkFrontMatterUpdater

Re-exports makeChunkFrontMatterUpdater


makeDefaultFindContent

Re-exports makeDefaultFindContent


makeDefaultFindVerifiedAnswer

Re-exports makeDefaultFindVerifiedAnswer


makeLangChainEmbedder

Re-exports makeLangChainEmbedder


makeLangchainChatLlm

Re-exports makeLangchainChatLlm


makeMongoDbConversationsService

Re-exports makeMongoDbConversationsService


makeMongoDbEmbeddedContentStore

Re-exports makeMongoDbEmbeddedContentStore


makeMongoDbPageStore

Re-exports makeMongoDbPageStore


makeMongoDbVerifiedAnswerStore

Re-exports makeMongoDbVerifiedAnswerStore


makeOpenAiChatLlm

Re-exports makeOpenAiChatLlm


makeOpenAiEmbedder

Re-exports makeOpenAiEmbedder


pageFormat

Re-exports pageFormat


pageFormatToLanguage

Re-exports pageFormatToLanguage


pageFormats

Re-exports pageFormats


pageIdentity

Re-exports pageIdentity


persistPages

Re-exports persistPages


removeFrontMatter

Re-exports removeFrontMatter


standardChunkFrontMatterUpdater

Re-exports standardChunkFrontMatterUpdater


standardMetadataGetter

Re-exports standardMetadataGetter


updateEmbeddedContent

Re-exports updateEmbeddedContent


updateEmbeddedContentForPage

Re-exports updateEmbeddedContentForPage


updateFrontMatter

Re-exports updateFrontMatter


updatePages

Re-exports updatePages

Type Aliases

Classification

Ƭ Classification: z.infer<typeof Classification>

Defined in

mongodb-rag-core/build/makeClassifier.d.ts:40

mongodb-rag-core/build/makeClassifier.d.ts:41


Classifier

Ƭ Classifier: ({ input }: { input: string }) => Promise<{ classification: Classification ; inputMessages: OpenAI.ChatCompletionMessageParam[] }>

Type declaration

▸ ({ input }): Promise<{ classification: Classification ; inputMessages: OpenAI.ChatCompletionMessageParam[] }>

Parameters
NameType
{ input }Object
{ input }.inputstring
Returns

Promise<{ classification: Classification ; inputMessages: OpenAI.ChatCompletionMessageParam[] }>

Defined in

mongodb-rag-core/build/makeClassifier.d.ts:4


ConversationIdStreamEvent

Ƭ ConversationIdStreamEvent: StreamEvent & { data: string ; type: "conversationId" }

Event when server streams the conversation ID to the client.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:55


DatabaseConnection

Ƭ DatabaseConnection: Object

Type declaration

NameType
close(force?: boolean) => Promise<void>
drop() => Promise<void>
init?() => Promise<void>

Defined in

mongodb-rag-core/build/DatabaseConnection.d.ts:1


DeltaStreamEvent

Ƭ DeltaStreamEvent: StreamEvent & { data: string ; type: "delta" }

Event when server streams additional message response to the client.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:16


FindNearestNeighborsOptions

Ƭ FindNearestNeighborsOptions: Object

Options for performing a nearest-neighbor search.

Type declaration

NameTypeDescription
filterRecord<string, unknown>Search filter expression.
indexNamestringThe name of the index to use.
knumberThe number of nearest neighbors to return.
minScorenumberThe minimum nearest-neighbor score threshold between 0-1.
numCandidatesnumberNumber of nearest neighbors to use during the search. Value must be less than or equal to 10000. You can't specify a number less than the number of documents to return (k).
pathstringThe keypath to the field with the vector data to use.

Defined in

mongodb-rag-core/build/VectorStore.d.ts:17


FinishedStreamEvent

Ƭ FinishedStreamEvent: StreamEvent & { data: string ; type: "finished" }

Event denoting the end of streaming.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:48


MetadataStreamEvent

Ƭ MetadataStreamEvent: StreamEvent & { data: Record<string, unknown> ; type: "metadata" }

Event when server streams a metadata object to the client.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:41


ProcessingStreamEvent

Ƭ ProcessingStreamEvent: StreamEvent & { data: string ; type: "processing" }

Event for when the server is processing a request.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:23


Reference

Ƭ Reference: z.infer<typeof Reference>

A formatted reference for an assistant message.

For example, a Reference might be a docs page, dev center article, or a MongoDB University module.

Defined in

mongodb-rag-core/build/References.d.ts:8

mongodb-rag-core/build/References.d.ts:9


References

Ƭ References: z.infer<typeof References>

Defined in

mongodb-rag-core/build/References.d.ts:42

mongodb-rag-core/build/References.d.ts:43


ReferencesStreamEvent

Ƭ ReferencesStreamEvent: StreamEvent & { data: any[] ; type: "references" }

Event when server streams single References object to the client.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:34


SomeStreamEvent

Ƭ SomeStreamEvent: DeltaStreamEvent | MetadataStreamEvent | ProcessingStreamEvent | ReferencesStreamEvent | FinishedStreamEvent | ConversationIdStreamEvent

The event types streamed from the chat server to the client.

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:62


VectorStore

Ƭ VectorStore<T>: Object

Generic vector store for vector-searchable data.

Type parameters

Name
T

Type declaration

NameType
close?() => Promise<void>
findNearestNeighbors(vector: number[], options?: Partial<FindNearestNeighborsOptions>) => Promise<WithScore<T>[]>

Defined in

mongodb-rag-core/build/VectorStore.d.ts:4


WithScore

Ƭ WithScore<T>: T & { score: number }

Type parameters

Name
T

Defined in

mongodb-rag-core/build/VectorStore.d.ts:11

Variables

CORE_CHATBOT_APP_ENV_VARS

Const CORE_CHATBOT_APP_ENV_VARS: Object

Type declaration

NameType
MONGODB_CONNECTION_URIstring
MONGODB_DATABASE_NAMEstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:36


CORE_ENV_VARS

Const CORE_ENV_VARS: Object

Type declaration

NameType
MONGODB_CONNECTION_URIstring
MONGODB_DATABASE_NAMEstring
OPENAI_API_KEYstring
OPENAI_API_VERSIONstring
OPENAI_CHAT_COMPLETION_DEPLOYMENTstring
OPENAI_CHAT_COMPLETION_MODEL_VERSIONstring
OPENAI_ENDPOINTstring
OPENAI_RETRIEVAL_EMBEDDING_DEPLOYMENTstring
OPENAI_VERIFIED_ANSWER_EMBEDDING_DEPLOYMENTstring
VECTOR_SEARCH_INDEX_NAMEstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:40


CORE_OPENAI_CHAT_COMPLETION_ENV_VARS

Const CORE_OPENAI_CHAT_COMPLETION_ENV_VARS: Object

Type declaration

NameType
OPENAI_API_KEYstring
OPENAI_API_VERSIONstring
OPENAI_CHAT_COMPLETION_DEPLOYMENTstring
OPENAI_CHAT_COMPLETION_MODEL_VERSIONstring
OPENAI_ENDPOINTstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:19


CORE_OPENAI_CONNECTION_ENV_VARS

Const CORE_OPENAI_CONNECTION_ENV_VARS: Object

Type declaration

NameType
OPENAI_API_KEYstring
OPENAI_API_VERSIONstring
OPENAI_ENDPOINTstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:1


CORE_OPENAI_ENV_VARS

Const CORE_OPENAI_ENV_VARS: Object

Type declaration

NameType
OPENAI_API_KEYstring
OPENAI_API_VERSIONstring
OPENAI_CHAT_COMPLETION_DEPLOYMENTstring
OPENAI_CHAT_COMPLETION_MODEL_VERSIONstring
OPENAI_ENDPOINTstring
OPENAI_RETRIEVAL_EMBEDDING_DEPLOYMENTstring
OPENAI_VERIFIED_ANSWER_EMBEDDING_DEPLOYMENTstring
VECTOR_SEARCH_INDEX_NAMEstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:26


CORE_OPENAI_RETRIEVAL_ENV_VARS

Const CORE_OPENAI_RETRIEVAL_ENV_VARS: Object

Type declaration

NameType
OPENAI_API_KEYstring
OPENAI_API_VERSIONstring
OPENAI_ENDPOINTstring
OPENAI_RETRIEVAL_EMBEDDING_DEPLOYMENTstring
VECTOR_SEARCH_INDEX_NAMEstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:6


CORE_OPENAI_VERIFIED_ANSWERS_ENV_VARS

Const CORE_OPENAI_VERIFIED_ANSWERS_ENV_VARS: Object

Type declaration

NameType
OPENAI_API_KEYstring
OPENAI_API_VERSIONstring
OPENAI_ENDPOINTstring
OPENAI_VERIFIED_ANSWER_EMBEDDING_DEPLOYMENTstring

Defined in

mongodb-rag-core/build/CoreEnvVars.d.ts:13


Classification

Classification: ZodObject<{ reason: ZodOptional<ZodString> ; type: ZodString }, "strip", ZodTypeAny, { reason?: string ; type: string }, { reason?: string ; type: string }>

Defined in

mongodb-rag-core/build/makeClassifier.d.ts:40

mongodb-rag-core/build/makeClassifier.d.ts:41


Reference

Reference: ZodObject<{ metadata: ZodOptional<ZodObject<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, "passthrough", ZodTypeAny, objectOutputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough">, objectInputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough">>> ; title: ZodString ; url: ZodString }, "strip", ZodTypeAny, { metadata?: objectOutputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough"> ; title: string ; url: string }, { metadata?: objectInputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough"> ; title: string ; url: string }>

Defined in

mongodb-rag-core/build/References.d.ts:8

mongodb-rag-core/build/References.d.ts:9


References

References: ZodArray<ZodObject<{ metadata: ZodOptional<ZodObject<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, "passthrough", ZodTypeAny, objectOutputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough">, objectInputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough">>> ; title: ZodString ; url: ZodString }, "strip", ZodTypeAny, { metadata?: objectOutputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough"> ; title: string ; url: string }, { metadata?: objectInputType<{ sourceName: ZodOptional<ZodString> ; sourceType: ZodOptional<ZodString> ; tags: ZodOptional<ZodArray<ZodString, "many">> }, ZodTypeAny, "passthrough"> ; title: string ; url: string }>, "many">

Defined in

mongodb-rag-core/build/References.d.ts:42

mongodb-rag-core/build/References.d.ts:43


logger

Const logger: Logger

Defined in

mongodb-rag-core/build/logger.d.ts:13

Functions

assertEnvVars

assertEnvVars<T>(ENV_VARS): T

Type parameters

NameType
Textends Record<string, string>

Parameters

NameType
ENV_VARST

Returns

T

Defined in

mongodb-rag-core/build/assertEnvVars.d.ts:1


createLoggerMessage

createLoggerMessage(«destructured»): Object

Parameters

NameType
«destructured»CreateMessageParams

Returns

Object

NameType
ipAddressundefined | string
messagestring
requestBodyunknown
requestIdundefined | string

Defined in

mongodb-rag-core/build/logger.d.ts:7


escapeNewlines

escapeNewlines(str): string

Parameters

NameType
strstring

Returns

string

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:4


filterDefined

filterDefined<T>(array): Exclude<T, undefined>[]

Given an array of possibly undefined T, return those that are defined.

Type parameters

Name
T

Parameters

NameType
arrayT[]

Returns

Exclude<T, undefined>[]

Defined in

mongodb-rag-core/build/arrayFilters.d.ts:8


filterFulfilled

filterFulfilled<T>(array): PromiseFulfilledResult<T>[]

Given an array of PromiseSettledResults, return those that are fulfilled as PromiseFulfilledResults.

Type parameters

Name
T

Parameters

NameType
arrayPromiseSettledResult<T>[]

Returns

PromiseFulfilledResult<T>[]

Defined in

mongodb-rag-core/build/arrayFilters.d.ts:4


makeClassifier

makeClassifier(«destructured»): Classifier

Parameters

NameTypeDescription
«destructured»Object-
› chainOfThought?booleanIf set to true, the classification will include a reason field that performs chain-of-thought reasoning before determining the classification type..
› classificationTypesClassificationType[]A list of valid classification types.
› modelstring-
› openAiClientOpenAI-

Returns

Classifier

Defined in

mongodb-rag-core/build/makeClassifier.d.ts:51


makeDataStreamer

makeDataStreamer(): DataStreamer

Create a DataStreamer that streams data to the client.

Returns

DataStreamer

Defined in

mongodb-rag-core/build/DataStreamer.d.ts:76