InMemoryQueryEngine

InMemoryQueryEngine(llm_config: dict[str, Any])

This engine stores ingested documents in memory and then injects them into an internal agent’s system message for answering queries.

Parameters:
NameDescription
llm_configType: dict[str, typing.Any]

Instance Methods

add_docs

add_docs(
    self,
    new_doc_dir: Path | str | None = None,
    new_doc_paths: list[Path | str] | None = None
) -> None

Add additional documents to the in-memory store

Loads new Docling-parsed Markdown files from a specified directory or a list of file paths and inserts them into the in-memory store.

Parameters:
NameDescription
new_doc_dirThe directory path from which to load additional documents.

If provided, all eligible files in this directory are loaded.

Type: pathlib.Path | str | None

Default: None
new_doc_pathsA list of file paths specifying additional documents to load.

Each file should be a Docling-parsed Markdown file.

Type: list[pathlib.Path | str] | None

Default: None

query

query(self, question: str) -> str

Run a query against the ingested documents and return the answer.

Parameters:
NameDescription
questionType: str