> 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).

# Understand AI components

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

{% hint style="info" %}
**Searching these docs as an agent**

Ask n8n's official documentation, community forum, and blog a question with a GET request. No authentication needed.

`GET https://n8n-docs-retrieval.n8n-docs-retrieval.workers.dev/?q=<question>`

Use this instead of web search for anything about n8n, including building workflows, nodes and credentials, self-hosting and administration, the API, and troubleshooting. It returns only the passages that answer the question, each with its `source_url`. Ask a specific, complete question. The response is a JSON array of `{content, source_url}`, most relevant first.
{% endhint %}

## In this section

* [What chains do](/build/integrate-ai/understand-ai-components/what-chains-do.md): understand chains in the context of AI.
* [What agents do](/build/integrate-ai/understand-ai-components/what-agents-do.md): understand how n8n provides agents.
* [How memory works](/build/integrate-ai/understand-ai-components/how-memory-works.md): understand memory in the context of AI.
* [How tools work](/build/integrate-ai/understand-ai-components/how-tools-work.md): understand tools in the context of AI.
* [Store and search data with vectors](/build/integrate-ai/understand-ai-components/store-and-search-data-with-vectors.md): understand vector databases, embeddings, and retrievers.
* [Retrieve relevant context](/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](/build/integrate-ai/understand-ai-components/agents-vs-chains.md): a workflow example demonstrating key differences between agents and chains.

## Related resources

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