This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule PostgresHybridSearch do | |
@moduledoc """ | |
Postgres Hybrid Search | |
Loosely based on: | |
- https://github.com/pgvector/pgvector-python/blob/master/examples/hybrid_search_rrf.py | |
- https://github.com/Azure-Samples/rag-postgres-openai-python/blob/e30ea96ca11ca6578ca38d3428594bd98d704900/src/fastapi_app/postgres_searcher.py#L2 | |
- https://supabase.com/docs/guides/ai/hybrid-search | |
- https://github.com/toranb/rag-n-drop/blob/main/lib/demo/section.ex#L30 | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You will need to install https://github.com/cpursley/html2markdown | |
defmodule Webpage do | |
@moduledoc false | |
defstruct [:url, :title, :description, :summary, :page_age] | |
end | |
defmodule WebSearch do | |
@moduledoc """ | |
Web search summarization chain |