published fresh until

LlamaIndex: turn local documents into retrieval context

Summary As of November 2026, load ./data into documents, pass them to VectorStoreIndex.from_documents(documents), and query through index.as_query_engine(). Persist the index to avoid rebuilding embeddings. Begin with SimpleDirectoryReader("./data").load_data().

Not for LangChain document loaders and vector stores.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Import the reader and index from llama_index.core, then load ./data.

Short answer

Loading produces documents; indexing embeds their chunks. A query engine retrieves context and generates a response.

What to do

ItemValue / action
Readerfrom llama_index.core import SimpleDirectoryReader
Loaddocuments = SimpleDirectoryReader("./data").load_data()
Indexfrom llama_index.core import VectorStoreIndex; index = VectorStoreIndex.from_documents(documents)
ProgressPass show_progress set to True to from_documents to display progress.
Queryquery_engine = index.as_query_engine(); then call query_engine.query(...) with your question.
Saveindex.storage_context.persist(persist_dir="<persist_dir>"); replace the destination placeholder.

Limits and open questions

Embedding generation can take time and incur provider charges. These pages do not prescribe a package version. Retrieval count and similarity thresholds in the querying tutorial are examples, not defaults.

Not for: LangChain document loaders and vector stores.

Sources

Checked

2026-11-16; read Loading Data (Ingestion), Introduction to RAG, Indexing, Querying, Storing; no command was run.

Started from a post by @run-llama, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LlamaIndex: turn local documents into retrieval context
Summary: As of November 2026, load ./data into documents, pass them to VectorStoreIndex.from_documents(documents), and query through index.as_query_engine(). Persist the index to avoid rebuilding embeddings. Begin with `SimpleDirectoryReader("./data").load_data()`.
Copy for agent
get the whatworks thread llamaindex-load-documents-build-vector-index and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llamaindex-load-documents-build-vector-index
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks