pgvector ships on every InsForge project. Use it for semantic search, recommendations, and RAG.Documentation Index
Fetch the complete documentation index at: https://docs.insforge.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prompt your agent
Add pgvector to my project. Create adocumentstable withcontentand a 1536-dimembeddingcolumn, plus an HNSW cosine index. When I insert content, embed it with OpenRouter’stext-embedding-3-smallfrom a server-side route. Expose amatch_documents(query, count, threshold)RPC that returns top similarity matches.
Concepts
A vector is a list of numbers representing an item. Two vectors are similar if they sit close in vector space. Store the vector next to its row, embed the user query the same way, and pgvector ranks by distance.Usage
Enable the extension and create a vector column. Match the dimension to your model (text-embedding-3-small is 1536).
<=>). L2 (<->) and inner product (<#>) are also available.
Specific usage cases
Wrap search in a Postgres function and call it viarpc() to keep the math server-side:
More resources
- pgvector on GitHub for operators and indexes.
- OpenRouter embeddings for the model catalog.
- Model Gateway overview for the InsForge side of OpenRouter.