Ash FrameworkAF
Ash Frameworkโ€ข7mo agoโ€ข
8 replies
hyperion_zw

How to setup "AshPostgres.Extensions.Vector"

I want to use Ash.AI to build RAG feature for my app. Currently, I am not sure how to setup AshPostgres for vector.

According to the document: https://hexdocs.pm/ash_postgres/AshPostgres.Extensions.Vector.html

An extension that adds support for the vector type.
Create a file with these contents, not inside of a module:

Postgrex.Types.define(<YourApp>.PostgrexTypes, [AshPostgres.Extensions.Vector] ++ Ecto.Adapters.Postgres.extensions(), [])


I am confused by this:
- which file should I create? a .exs or .ex file ?
- where should I put that file, in the root of my project? or in lib folder ?

Thanks a lot for your help ๐Ÿ™‚
Solution
It goes in the lib/ folder, and in a .ex file
Was this page helpful?