The .query() method empowers developers to ask questions and receive relevant answers through a user-friendly query API.
Function signature is given below:
Parameters
string
required
Question to ask
string
The conversation ID to which the query belongs in case this is a chatbot scenario
Chunk[]
In case you want to pass along your own context information. Passing this parameter disables the default context generation.
Show Chunk properties
Returns
string
Unique identifier for the query response in a conversation
Date
Unique identifier for the query response in a conversation
string
Unique identifier for the query response in a conversation
SourceDetail[]
The individual sources that were used to generate the answer
Show SourceDetail properties
string
Unique identifier for the loader
string
The source of the information
object
The number of tokens used to answer the query
Show properties
number | 'UNKNOWN'
The number of input tokens used to process the query
number | 'UNKNOWN'
The number of output tokens used to process the query
Usage
If you want to get the answer to question and return both answer and citations, use the following code snippet:
Code Example
import { RAGApplicationBuilder } from '@llm-tools/embedjs';import { OllamaEmbeddings } from '@llm-tools/embedjs-ollama';import { WebLoader } from '@llm-tools/embedjs-loader-web';import { HNSWDb } from '@llm-tools/embedjs-hnswlib';const ragApplication = await new RAGApplicationBuilder().setModel(new Ollama({ modelName: "llama3.2", baseUrl: 'http://localhost:11434' })).setEmbeddingModel(new OllamaEmbeddings({ model: 'nomic-embed-text', baseUrl: 'http://localhost:11434' })).setVectorDatabase(new HNSWDb()).build();ragApplication.addLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' })ragApplication.addLoader({ urlOrContent: 'https://en.wikipedia.org/wiki/Elon_Musk' })await ragApplication.query('What is the net worth of Elon Musk today?')await ragApplication.query('Who is Elon Musk?' { conversationId: '1' })/**/
Was this page helpful?
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"EmbedJs","colors":{"primary":"#8B0000","light":"#FF7F7F","dark":"#8B0000"},"favicon":"https://mintcdn.com/llm-tools/8mcnKVjSSGiy15PV/favicon.png?fit=max\u0026auto=format\u0026n=8mcnKVjSSGiy15PV\u0026q=85\u0026s=19adf04c5075dd488213ef8965512a7d","logo":{"light":"https://mintcdn.com/llm-tools/8mcnKVjSSGiy15PV/logo/light.webp?fit=max\u0026auto=format\u0026n=8mcnKVjSSGiy15PV\u0026q=85\u0026s=ea1646931af6e1a2196fd631c9c404e2","dark":"https://mintcdn.com/llm-tools/8mcnKVjSSGiy15PV/logo/dark.webp?fit=max\u0026auto=format\u0026n=8mcnKVjSSGiy15PV\u0026q=85\u0026s=e88e91e778318cabaa74c3bdc7c14530","href":"https://github.com/llm-tools/embedjs"},"appearance":{"default":"dark","strict":null},"background":{"decoration":null,"color":{"light":"#fff","dark":"#000"}},"navbar":{"links":[{"label":"GitHub","href":"https://github.com/llm-tools/embedJs"}],"primary":{"type":"button","label":"Install","href":"https://www.npmjs.com/package/@llm-tools/embedjs"}},"search":{"prompt":"✨ Search embedJs docs..."},"footer":{"socials":{"website":"https://ragkit.ai","github":"https://github.com/llm-tools/embedJs","linkedin":"https://www.linkedin.com/in/adhityan/"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"llm-tools","hasAudioNarration":false,"actualSubdomain":"llm-tools","customDomains":[],"gitSource":{"type":"github","owner":"llm-tools","repo":"embedjs","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"REMOVE_BRANDING":{"status":"ENABLED"}},"buildId":"6ae92246237be9213292a265:success","clientVersion":"0.0.4205","searchFilterCounts":[{"language":"default","tag":"📘 Documentation","count":63},{"language":"default","tag":"Components","count":51},{"language":"default","tag":"Built in","count":45},{"language":"default","tag":"🗂️ Data sources","count":20},{"language":"default","tag":"API Reference","count":16},{"language":"default","tag":"🗄️ Vector databases","count":9},{"language":"default","tag":"🧩 Embedding models","count":8},{"language":"default","tag":"🤖 Large language models","count":8},{"language":"default","tag":"RAGApplication methods","count":7},{"language":"default","tag":"⚡ Stores","count":5}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/methods/query","slug":"/api-reference/methods/query","pageMetadata":{"title":"❓ query","description":null,"href":"/api-reference/methods/query"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`.query()`}),` method empowers developers to ask questions and receive relevant answers through a user-friendly query API.\\r\nFunction signature is given below:`]}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsx(ParamField,{path:`userQuery`,type:`string`,required:true,id:`param-user-query`,children:_jsx(_components.p,{children:`Question to ask`})}),`\n`,_jsx(ParamField,{path:`conversationId`,type:`string`,optional:true,id:`param-conversation-id`,children:_jsx(_components.p,{children:`The conversation ID to which the query belongs in case this is a chatbot scenario`})}),`\n`,_jsxs(ParamField,{path:`customContext`,type:`Chunk[]`,optional:true,id:`param-custom-context`,children:[_jsx(_components.p,{children:`In case you want to pass along your own context information. Passing this parameter disables the default context generation.`}),_jsxs(Expandable,{title:`Chunk properties`,children:[_jsx(ParamField,{name:`pageContent`,type:`string`,children:_jsx(_components.p,{children:`The context text that is passed to the LLM`})}),_jsxs(ParamField,{name:`metadata`,type:`Metadata`,children:[_jsx(_components.p,{children:`The metadata that is passed to EmbedJs`}),_jsxs(Expandable,{title:`Metadata`,children:[_jsx(ParamField,{name:`id`,type:`string`,children:_jsx(_components.p,{children:`Unique identifier for the bit of information`})}),_jsx(ParamField,{name:`uniqueLoaderId`,type:`string`,children:_jsx(_components.p,{children:`The unique identifier for the group of information bits`})}),_jsx(ParamField,{name:`source`,type:`string`,children:_jsx(_components.p,{children:`The source string returned if this piece of info was used by the LLM`})})]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`returns`,children:`Returns`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`Unique identifier for the query response in a conversation`})}),`\n`,_jsx(ResponseField,{name:`timestamp`,type:`Date`,id:`param-timestamp`,children:_jsx(_components.p,{children:`Unique identifier for the query response in a conversation`})}),`\n`,_jsx(ResponseField,{name:`content`,type:`string`,id:`param-content`,children:_jsx(_components.p,{children:`Unique identifier for the query response in a conversation`})}),`\n`,_jsxs(ResponseField,{name:`sources`,type:`SourceDetail[]`,id:`param-sources`,children:[_jsx(_components.p,{children:`The individual sources that were used to generate the answer`}),_jsxs(Expandable,{title:`SourceDetail properties`,children:[_jsx(ResponseField,{name:`loaderId`,type:`string`,id:`param-loader-id`,children:_jsx(_components.p,{children:`Unique identifier for the loader`})}),_jsx(ResponseField,{name:`source`,type:`string`,id:`param-source`,children:_jsx(_components.p,{children:`The source of the information`})})]})]}),`\n`,_jsxs(ResponseField,{name:`tokenUse`,type:`object`,id:`param-token-use`,children:[_jsx(_components.p,{children:`The number of tokens used to answer the query`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`inputTokens`,type:`number | 'UNKNOWN'`,id:`param-input-tokens`,children:_jsx(_components.p,{children:`The number of input tokens used to process the query`})}),_jsx(ResponseField,{name:`outputTokens`,type:`number | 'UNKNOWN'`,id:`param-output-tokens`,children:_jsx(_components.p,{children:`The number of output tokens used to process the query`})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsx(_components.p,{children:`If you want to get the answer to question and return both answer and citations, use the following code snippet:`}),`\n`,_jsx(CodeBlock,{filename:`Code Example`,numberOfLines:`19`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { RAGApplicationBuilder } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@llm-tools/embedjs'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { OllamaEmbeddings } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@llm-tools/embedjs-ollama'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { WebLoader } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@llm-tools/embedjs-loader-web'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { HNSWDb } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@llm-tools/embedjs-hnswlib'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ragApplication = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` RAGApplicationBuilder()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.setModel(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Ollama({ modelName: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama3.2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, baseUrl: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'http://localhost:11434'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.setEmbeddingModel(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OllamaEmbeddings({ model: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'nomic-embed-text'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, baseUrl: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'http://localhost:11434'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.setVectorDatabase(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` HNSWDb())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.build();`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ragApplication.addLoader({ urlOrContent: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://www.forbes.com/profile/elon-musk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ragApplication.addLoader({ urlOrContent: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://en.wikipedia.org/wiki/Elon_Musk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ragApplication.query(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'What is the net worth of Elon Musk today?'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ragApplication.query(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Who is Elon Musk?'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { conversationId: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/*`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`*/`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"❓ query","description":null,"href":"/api-reference/methods/query"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Parameters","slug":"parameters","depth":3,"children":[]},{"title":"Returns","slug":"returns","depth":3,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"llm-tools","siteName":"EmbedJs","title":"❓ query - EmbedJs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-26T13:23:33.560Z","originalFileLocation":"api-reference/methods/query.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"EmbedJs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"❓ query - EmbedJs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"EmbedJs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://llm-tools.mintlify.app/api-reference/methods/query\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://llm-tools.mintlify.site/_mintlify/api/og/v2?division=RAGApplication+methods\u0026amp;title=%E2%9D%93+query\u0026amp;theme=28ba4245053888504c267c4f\u0026amp;signature=6d2e8a74b5dd54fc2bd070edb48ba6f442ea035a3979c48569304b266dea5325\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"❓ query - EmbedJs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://llm-tools.mintlify.site/_mintlify/api/og/v2?division=RAGApplication+methods\u0026amp;title=%E2%9D%93+query\u0026amp;theme=28ba4245053888504c267c4f\u0026amp;signature=6d2e8a74b5dd54fc2bd070edb48ba6f442ea035a3979c48569304b266dea5325\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/llm-tools/fIMSd8dJhjD0vNSA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"EmbedJs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8B0000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://llm-tools.mintlify.app/api-reference/methods/query\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/methods/query.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://llm-tools.mintlify.app/#organization\",\"name\":\"EmbedJs\",\"url\":\"https://llm-tools.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/llm-tools/8mcnKVjSSGiy15PV/logo/light.webp?fit=max\u0026auto=format\u0026n=8mcnKVjSSGiy15PV\u0026q=85\u0026s=ea1646931af6e1a2196fd631c9c404e2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://llm-tools.mintlify.app#website\",\"name\":\"EmbedJs\",\"url\":\"https://llm-tools.mintlify.app\",\"publisher\":{\"@id\":\"https://llm-tools.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://llm-tools.mintlify.app/api-reference/methods/query#webpage\",\"url\":\"https://llm-tools.mintlify.app/api-reference/methods/query\",\"name\":\"❓ query\",\"dateModified\":\"2026-06-26T13:23:33.560Z\",\"isPartOf\":{\"@id\":\"https://llm-tools.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://llm-tools.mintlify.app/api-reference/methods/query#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://llm-tools.mintlify.app/api-reference/methods/query#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://llm-tools.mintlify.app/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"❓ query\",\"item\":\"https://llm-tools.mintlify.app/api-reference/methods/query\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://llm-tools.mintlify.app/api-reference/methods/query#article\",\"headline\":\"❓ query\",\"name\":\"❓ query\",\"url\":\"https://llm-tools.mintlify.app/api-reference/methods/query\",\"mainEntityOfPage\":{\"@id\":\"https://llm-tools.mintlify.app/api-reference/methods/query#webpage\"},\"dateModified\":\"2026-06-26T13:23:33.560Z\",\"publisher\":{\"@id\":\"https://llm-tools.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://llm-tools.mintlify.app#website\"}}]}\u003c/script>","agentPointerHref":"/api-reference/methods/query.md","siteName":"EmbedJs","nav":{"global":null,"tabs":[{"tab":"📘 Documentation","pages":[{"title":"📘 Documentation","href":"/get-started/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"RAGApplicationBuilder","description":null,"href":"/api-reference/overview"},{"group":"RAGApplication methods","pages":[{"title":"❓ query","href":"/api-reference/methods/query"},{"title":"🔍 search","description":null,"href":"/api-reference/methods/search"},{"title":"📊 addLoader","href":"/api-reference/methods/add-loader"},{"title":"📄 getLoaders","href":"/api-reference/methods/get-loaders"},{"title":"🗑 deleteLoader","href":"/api-reference/methods/delete-loader"},{"title":"🗑 deleteConversation","href":"/api-reference/methods/delete-conversation"},{"title":"🔄 reset","href":"/api-reference/methods/reset"}]}]}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/slack_bot"}]}]},"basePath":"","title":"❓ query - EmbedJs","deploymentId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","buildId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","dynamics":[],"chunks":[]}