---
title: "Agno"
description: "This section contains information about the Agno framework and how to integrate it with SurrealDB."
canonical_url: "https://surrealdb.com/docs/integrate/integrations/ai-frameworks/agno"
section: "AI frameworks"
surrealdb_version: "4.x"
last_modified: "2026-11-18T02:09:16Z"
---

> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Agno

This section contains information about the Agno framework and how to integrate it with SurrealDB.

[Agno](https://github.com/agno-agi/agno) is a Python framework for building multi-agent systems with shared memory, knowledge and reasoning.

Agno stores an agent's knowledge base in a vector database, and its `SurrealDb` class uses a SurrealDB table with an HNSW index for that. This page shows how to configure it. The tutorial [Build an AI agent with Python](/docs/learn/tutorials/tutorials/build-an-ai-agent.md#getting-started-with-agno) has a complete program that loads a PDF of Thai recipes into the knowledge base and asks an agent a question about it.

## Setup

Start a SurrealDB server that accepts the `root` user with the password `secret`, for example with Docker:

```shell
docker run --rm --pull always -p 8000:8000 surrealdb/surrealdb:latest start --user root --pass secret
```

## Configure the vector database

Connect with the SurrealDB Python SDK, then pass the client to `SurrealDb`:

```python
from agno.vectordb.surrealdb import SurrealDb
from surrealdb import Surreal

client = Surreal(url="ws://localhost:8000")
client.signin({"username": "root", "password": "secret"})
client.use(namespace="main", database="main")

surrealdb = SurrealDb(
    client=client,
    collection="recipes",  # Table name for storing documents
    efc=150,  # HNSW construction time/accuracy trade-off
    m=12,  # HNSW max number of connections per element
    search_ef=40,  # HNSW search time/accuracy trade-off
)
```

`collection` names the table that holds the documents and their embeddings. `efc` and `m` set the `EFC` and `M` parameters of the HNSW index, and `search_ef` sets the size of the candidate list that a search uses, as in the `<|K,EF|>` [KNN operator](/docs/reference/query-language/language-primitives/operators.md#hnsw). Larger values give more accurate results and make building the index or searching it slower.

## Use it in a knowledge base

Pass the vector database to a knowledge base as its `vector_db`, together with an embedder such as `OpenAIEmbedder()`, and give the knowledge base to an `Agent`. Agno embeds the documents when the knowledge base loads, stores them in the `recipes` table, and searches the table when the agent needs context for a question.

## Developer resources

* View [Cookbook (Sync)](https://docs.agno.com/vectordb/surrealdb)
* View [Cookbook (Async)](https://docs.agno.com/vectordb/surrealdb)
* View [Agno documentation](https://docs.agno.com/vectordb/surrealdb)
