> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/build/integrate-ai/understand-ai-components.md). Agents can also search and read this documentation through its [MCP server](https://docs.n8n.io/~gitbook/mcp).

# Understand AI components

Learn the core building blocks of AI workflows in n8n: chains, agents, memory, tools, and vector databases.

## In this section

* [What chains do](https://docs.n8n.io/build/integrate-ai/understand-ai-components/what-chains-do.md): understand chains in the context of AI.
* [What agents do](https://docs.n8n.io/build/integrate-ai/understand-ai-components/what-agents-do.md): understand how n8n provides agents.
* [How memory works](https://docs.n8n.io/build/integrate-ai/understand-ai-components/how-memory-works.md): understand memory in the context of AI.
* [How tools work](https://docs.n8n.io/build/integrate-ai/understand-ai-components/how-tools-work.md): understand tools in the context of AI.
* [Store and search data with vectors](https://docs.n8n.io/build/integrate-ai/understand-ai-components/store-and-search-data-with-vectors.md): understand vector databases, embeddings, and retrievers.
* [Retrieve relevant context](https://docs.n8n.io/build/integrate-ai/understand-ai-components/retrieve-relevant-context.md): use Retrieval-Augmented Generation (RAG) to give models access to context-specific resources.
* [Agents vs chains](https://docs.n8n.io/build/integrate-ai/understand-ai-components/agents-vs-chains.md): a workflow example demonstrating key differences between agents and chains.

## Related resources

* [Integrate AI](https://docs.n8n.io/build/integrate-ai.md)
* [MCP servers](https://docs.n8n.io/build/integrate-ai/mcp-servers.md)
* [LangChain in n8n](https://docs.n8n.io/build/integrate-ai/langchain-in-n8n.md)
* [Test and improve AI workflows](https://docs.n8n.io/build/integrate-ai/test-and-improve-ai-workflows.md)
* [AI examples](https://docs.n8n.io/build/integrate-ai/ai-examples.md)
