postgres-ai

Automate vector search, RAG, and memory in Azure PostgreSQL with pgvector and azure_ai.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/samelhousseini/microhacks --skill postgres-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-ai
Source: https://github.com/samelhousseini/microhacks/tree/main/.github/skills/postgres-ai
Command: npx skills add https://github.com/samelhousseini/microhacks --skill postgres-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2, pgvector, python-dotenv, openai, langchain-core, langchain-openai, langchain-postgres, langchain, langgraph, langgraph-checkpoint-postgres, and includes scripts (resource) components.

What problem does it solve?

Azure PostgreSQL AI workloads are complex to set up and maintain; this Skill delivers a ready-to-run integration for vector search, RAG pipelines, and persistent agent memory using pgvector and azure_ai extensions to accelerate AI-powered data apps.

Core Features & Use Cases

  • Vector search with pgvector on Azure PostgreSQL for fast similarity queries over embeddings
  • RAG pipelines using LangChain, Azure OpenAI, and a PostgreSQL-backed vector store for retrieval-augmented generation
  • Persistent agent memory and checkpointing with LangGraph to maintain context across sessions

Quick Start

Configure environment variables (PGHOST, PGDATABASE, PGUSER, PGPASSWORD, AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY) and run the scripts in .github/skills/postgres-ai/scripts to initialize the vector table, insert documents, and perform a sample search or RAG query.

Frequently Asked Questions about postgres-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up vector search in Azure PostgreSQL using pgvector?

Vector search in Azure PostgreSQL requires installing pgvector and azure_ai extensions to create a vector table, insert embeddings, and run similarity queries. The Skill automates this initialization using configured environment variables.

Can I use LangChain and Azure OpenAI for RAG pipelines in PostgreSQL?

Yes, you can build RAG pipelines using LangChain, Azure OpenAI, and a PostgreSQL-backed vector store. This Skill provides scripts to execute retrieval-augmented generation queries directly inside your database.

How does LangGraph maintain persistent agent memory in PostgreSQL?

LangGraph maintains persistent agent memory in PostgreSQL through checkpointing to store and retrieve context across sessions. This Skill integrates langgraph-checkpoint-postgres to preserve state continuity for data-driven apps.

What environment variables are required to connect Azure OpenAI with PostgreSQL?

Connecting Azure OpenAI with PostgreSQL requires configuring PGHOST, PGDATABASE, PGUSER, PGPASSWORD, AZURE_OPENAI_ENDPOINT, and AZURE_OPENAI_API_KEY. These variables authenticate both the database and AI embedding services.

What is the best way to implement scalable embeddings and retrieval in Azure PostgreSQL?

The best way to implement scalable embeddings and retrieval in Azure PostgreSQL is using pgvector for similarity queries and LangGraph for state management. This Skill delivers a ready-to-run integration for these specific workloads.