docs/examples/data_connectors/MboxReaderDemo.ipynb
<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/MboxReaderDemo.ipynb" target="_parent"></a>
If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.
%pip install llama-index-readers-mbox
!pip install llama-index
%env OPENAI_API_KEY=sk-************
from llama_index.readers.mbox import MboxReader
from llama_index.core import VectorStoreIndex
documents = MboxReader().load_data(
"mbox_data_dir", max_count=1000
) # Returns list of documents
index = VectorStoreIndex.from_documents(
documents
) # Initialize index with documents
query_engine = index.as_query_engine()
res = query_engine.query("When did i have that call with the London office?")
res.response