Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion other/v2-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ Notice:
- The script is idempotent. If something goes wrong or if you stop it mid-run, you can run it again.
- Metrics are automatically converted from v1 to v2 format.

## Migrating your VectorDB

If you used a VectorDB in v1, your vector tables need the two new columns introduced in v2: `content_hash` and `content_id`.

Use our migration script: [`libs/agno/migrations/v1_to_v2/migrate_vectordbs_to_v2.py`](https://github.com/agno-agi/agno/blob/main/libs/agno/migrations/v1_to_v2/migrate_vectordbs_to_v2.py)

The script supports PgVector and SingleStore. Set the database URL and the config listing the schema and the tables to migrate at the top of the script and run it.

Notice:

- The script is idempotent. It skips tables that already have both columns.
- Creating a `PgVector` instance won't migrate existing tables. `create()` only creates tables that don't exist.
- Until the migration runs, writes to a v1 table fail with `column "content_id" of relation "..." does not exist`.

## Migrating your Agno code

Each section here covers a specific framework domain, with before and after examples and detailed explanations where needed.
Expand Down Expand Up @@ -248,7 +262,7 @@ from any sources. For a full example of the usage, see the [Content Types](/know
Furthermore, we now support deletion of individual vectors using the `remove_vector_by_id()`, `remove_vectors_by_name()` and `remove_vectors_by_metadata()` methods.
You can also delete all vectors created by a specific piece of content using `remove_content_by_id()`.

4.4 To support the deletion mentioned above, VectorDB tables have been updated. Two new columns, `content_hash` and `content_id`, have been added.
4.4 To support the deletion mentioned above, VectorDB tables have been updated. Two new columns, `content_hash` and `content_id`, have been added. See [Migrating your VectorDB](#migrating-your-vectordb) to update existing tables.

4.5. The `retriever` field has been renamed to `knowledge_retriever`.

Expand Down