MongoDBQueryEngine for
retrieval-augmented question answering over documents. It shows how to
set up the engine with Docling parsed Markdown files, and execute
natural language queries against the indexed data.
The MongoDBQueryEngine integrates cloud MongoDB Atlas vector storage
with LlamaIndex for efficient document retrieval.
Set up Open AI key for query engine retrieval
Set up Mongo DB instance
To use this notebook, you will need to have a MongoDB Atlas environment. For this notebook, we use a docker instance. please refer MongoDB: Create a Local Atlas Deployment with Docker for more info. Some info that you need to get include: - MongoDB Connection String (URI)MongoDBQueryEngine you can specify a collection_name and
database_name to ingest into.
Initialize DB and ingest documents
Let’s ingest a document and query it.init_db will overwrite the existing collection with the same name.
connect_db to avoid overwriting the existing collection.