You probably don't need a separate vector database. If you're already running #PostgreSQL, you can add AI-powered semantic search with one extension: pgvector. Here's how it works in 5 steps: - Enable the extension → CREATE EXTENSION vector; - Add a VECTOR column to your existing tables - Store embeddings from any ML model (OpenAI, Hugging Face, etc.) - Query by meaning using similarity operators in plain SQL - Add an HNSW index for fast nearest-neighbor search at scale No new infrastructure. No sync jobs. No new vendor. Just SQL and vectors. The best part? You can combine vector search with everything PostgreSQL already does joins, filters, transactions, full-text search in a single query. Use cases teams are building right now: → Smart product search that understands intent, not just keywords → FAQ chatbots that match questions by meaning → Content recommendation engines Vibhor Kumar and Marc Linster wrote a great step-by-step walkthrough covering all of this from setup to production use cases. Full article here - https://lnkd.in/gBKF2APe Follow our Substack page for more such how to tutorials straight to your inbox - Data Engineering Byte
Add AI-Powered Search to PostgreSQL with pgvector
More Relevant Posts
-
If you're building RAG on PostgreSQL, the operationally painful part isn't the search. It's keeping embeddings in sync as data changes. Ahsan Hadi's latest blog walks through pgedge-vectorizer, a PostgreSQL background worker that monitors source tables via triggers, chunks text, calls your embedding provider (OpenAI, Voyage AI, or Ollama), and updates the chunk table automatically on insert or update. No external orchestration, no custom CDC scripts, no scheduled jobs. When a row changes, only that row gets re-processed. The companion RAG Server handles retrieval and generation. It runs hybrid search using vector similarity combined with BM25 keyword matching, merged via Reciprocal Rank Fusion, which gives you semantic matches plus exact keyword hits in a single query. The token budget management and LLM call are handled by the server, so your application just hits an HTTP endpoint. The full walkthrough including schema setup, trigger behavior, hybrid search config, and working curl examples is here: https://hubs.la/Q04c8C1n0 #postgres #postgresql #sql #data #vector #ai #llm #artificialintelligence #llmops #rag #ragserver #aidev #aiappdev #appdev #vectorsearch #tech #bigdata #technology
To view or add a comment, sign in
-
-
Your SQL should read like a story, not a puzzle. In modern Data Engineering, "it works" isn't the only requirement. Readability is a production feature. Here is why the choice between Subqueries and CTEs defines your code quality: 🔹 Subqueries (The Quick Fix) A query nested inside another query. Pros: • Great for simple, one-off filtering or scalar checks. • Quick to write for a "throwaway" query. Cons: • Creates "spaghetti code" that grows inward. • Hard to debug when a join fails 4 levels deep. • Makes it nearly impossible for a teammate to follow your logic. 🚀 CTEs — Common Table Expressions (The Systematic Way) Defined using the WITH clause at the top of your script. Pros: • Modular: You "name" your steps (e.g., cleaned_sales). • Top-to-Bottom: Anyone can read your logic like a book. • Reusable: Reference the same logic multiple times. Performance Note: In modern engines like Spark or SQL Server, the optimizer is smart enough to handle both efficiently. But your coworkers aren't compilers—they need to be able to read your work. 💡 Simple way to think about it: Subqueries = A long paragraph with 12 commas. CTEs = A clean, organized list of bullet points. The Verdict: If you’re building a Medallion architecture, especially in the Silver layer, default to CTEs. Your future self (and your teammates) will thank you. #DataEngineering #SQL #Databricks #Azure #CleanCode #MedallionArchitecture #Subquery #CTE
To view or add a comment, sign in
-
-
Finally! A text-to-SQL solution that actually works 🎯 (100% open-source) The real reason your text-to-SQL fails in production: It's not the LLM. It's not your prompt engineering. It's schema retrieval 💥 Here's the enterprise trap: Query: _"Which publishers received royalty payments above $5,000?"_ Vector search finds → `publisher` table ✅ Vector search finds → `royalty_ledger` table ✅ Vector search misses → `vendor_agreement` table ❌ That's your bridge table. No join path = zero rows returned. Your LLM wrote perfect SQL. Your database returned nothing. 😵💫 Why this happens: Vector embeddings match semantics, not relationships. They can't see foreign keys or multi-hop join paths across 60+ tables. The QueryWeaver approach: Treat schemas as graphs 🕸️ Instead of embedding docs: 📍 Tables become nodes 🔗 Foreign keys become edges 🛤️ Join paths are discovered by walking the graph When a query comes in, it traverses the structure and pulls EVERY bridge table needed. Including 5-hop chains. Proof it works: BIRD Benchmark on a 60-table superhero database → Resolved a complex 5-hop query by automatically chaining through all intermediate tables 🏆 No more "valid SQL, zero results" in production. If you're building text-to-SQL for enterprise databases, schema-as-graph is the missing piece. Who else has burned hours debugging "correct" SQL with empty results? 👇 check link in comment 🔗 #TextToSQL #OpenSource #DataEngineering #SQL #LLM #AIAgents #GraphDatabase #QueryWeaver #EnterpriseAI #BigData #Analytics #DeveloperTools #GenAI #Database #2026Tech
To view or add a comment, sign in
-
-
💡 𝗕𝗶𝗴𝗤𝘂𝗲𝗿𝘆 𝗦𝗲𝗰𝗿𝗲𝘁: 𝗬𝗼𝘂’𝗿𝗲 𝗽𝗿𝗼𝗯𝗮𝗯𝗹𝘆 𝗼𝘃𝗲𝗿𝗽𝗮𝘆𝗶𝗻𝗴 𝗳𝗼𝗿 𝗯𝗮𝗰𝗸𝘂𝗽𝘀 A common assumption in BigQuery is that “Copy” is the go-to method for backing up tables. But in reality, it’s often the slowest and most expensive option. Here’s the smarter way to think about it 👇 A standard table copy duplicates your entire dataset meaning double storage cost and longer execution time. It works, but it’s heavy. A table clone, on the other hand, is almost instant and initially costs $0 in storage. Because it only references the base table, it’s best suited for short-term backups, dev/test environments, or quick experiments not long-term storage. Then there are snapshots also created instantly and initially free but they’re read-only. Ideal when you want a point-in-time backup without worrying about accidental changes. Now imagine this scenario: You need to test changes on a 50TB production table. The old way? You copy the table, wait for hours, and pay for another 50TB. The smarter way? You create a clone it’s ready in seconds, and you only pay if you modify data. Here’s the command that changes everything: 𝘊𝘙𝘌𝘈𝘛𝘌 𝘛𝘈𝘉𝘓𝘌 `𝘱𝘳𝘰𝘫𝘦𝘤𝘵.𝘥𝘦𝘷_𝘥𝘢𝘵𝘢𝘴𝘦𝘵.𝘵𝘦𝘴𝘵_𝘵𝘢𝘣𝘭𝘦` 𝘊𝘓𝘖𝘕𝘌 `𝘱𝘳𝘰𝘫𝘦𝘤𝘵.𝘱𝘳𝘰𝘥_𝘥𝘢𝘵𝘢𝘴𝘦𝘵.𝘴𝘢𝘮𝘱𝘭𝘦_𝘵𝘢𝘣𝘭𝘦`; Stop duplicating data. Start cloning it. #DataEngineering #BigQuery #GoogleCloud #CostOptimization #CloudComputing #DataArchitecture #Clone
To view or add a comment, sign in
-
-
We are excited to announce that our new book is officially released today! 📘✨ Introducing “AI-Ready PostgreSQL 18: Building Intelligent Data Systems with Transactions, Analytics, and Vectors” by Vibhor Kumar and Marc Linster. If you've been diving into data-heavy or AI-driven applications lately, you’ve likely noticed something exciting: the boundaries are blurring! Transactions, analytics, and artificial intelligence are no longer separate considerations—they're coming together in powerful ways. 🔄 This book delves into that very evolution. Think of it as your hands-on guide to harnessing PostgreSQL 18 - not just as a database, but as a comprehensive platform for building smart systems capable of making real-time decisions, performing robust analytics, and tackling AI tasks like vector searches and LLM integrations. 🤖📊 Inside, we’ve packed it with: - Tangible, real-world examples just waiting for you to apply! 🛠️ - Crystal-clear guidance on architecture and the trade-offs you may encounter along the way. 🧠 - Strategies to extract maximum performance from PostgreSQL 18’s cutting-edge features. ⚡ - Insights on when to stick with Postgres and when it’s best to pivot. 🎯 Whether you’re a developer, data engineer, or architect, our goal is straightforward: empower you to create smarter systems without the hassle of unnecessary complexity. 🚀 📣 This sounds right up your alley? Check it out here: https://packt.link/gQKTu #artificialintelligence #dataarchitecture #ai #sql #postgresql
To view or add a comment, sign in
-
-
Is it just me, or is there something incredibly satisfying about watching a query actually work? I’ve officially moved my SQL learning journey from DBeaver over to MySQL Workbench. While many are making the jump to DBeaver’s latest v26.0 AI features, I decided to go back to the basics. Switching tools midway can be a hurdle, but it’s been a blessing in disguise. It forced me to look closer at the interface, understand the nuances between "Execute" (lightning bolt) icons, and finally demystify how datasets are truly structured without the extra layers. A few highlights from my latest deep dive: • The Power of SELECT & FROM: It sounds basic, but seeing a massive imported dataset filter down into exactly what I need feels like magic. • The DISTINCT Edge: Realizing how easily we can strip away the noise to see unique values. (Perfect for cleaning up user demographic data!) • Calculated Columns: Running functions like Age + 10 for the first time was a game changer. It’s not just static data; it’s a canvas you can manipulate. • Deciphering the UI: From understanding # comments to mastering the specific action keys in the Workbench, the "why" behind the tool is finally clicking. I used to view SQL as a technical requirement, but now I’m starting to see it as a storytelling tool. Being able to ask a database a question and get an immediate, clean answer is addicting. Onward to more complex queries! 🚀 #SQL #DataAnalytics #ProductManagement #ContinuousLearning #MySQL #TechJourney #DBeaver #DataStorytelling
To view or add a comment, sign in
-
Really excited to finally share something we’ve been working on - our new book is officially out now 📘 ✨ “AI-Ready PostgreSQL 18: Building Intelligent Data Systems with Transactions, Analytics, and Vectors.” by Vibhor Kumar and Marc Linster If you’ve been building data-heavy or AI-enabled applications lately, you’ve probably felt this shift; everything is converging. Transactions, analytics, AI… they’re no longer separate concerns anymore 🔄 That’s exactly what this book explores. It’s a practical guide to using PostgreSQL 18 as a unified platform not just for storing data, but for building intelligent systems that can handle real-time decisions, analytics, and even AI workloads like vector search and LLM integrations 🤖 📊 Inside, we’ve focused on: Real examples you can actually apply 🛠️ Clear guidance on architecture and trade-offs 🧠 Ways to get the most out of PostgreSQL 18’s latest features ⚡ When to stick with Postgres and when not to 🎯 Whether you’re a developer, data engineer, or architect, the goal is simple: help you build smarter systems without unnecessary complexity 🚀 📣 If this sounds relevant to your work, check it out and grab your copy here: https://packt.link/gQKTu Curious to hear your take 👉 Are you already using PostgreSQL for AI use cases? 👉 Do you think one system can realistically handle OLTP, OLAP, and AI together? Would love to hear what you’re seeing in your own work 👇 💬 #postgresql #aiengineering #dataarchitecture #realtimeanalytics #vectorsearch #techleadership #dataengineering #dataplatforms
To view or add a comment, sign in
-
-
They say you haven't truly lived as a developer until you’ve had a minor heart attack before hitting "Execute" on a DELETE query. 😅 I officially started my SQL journey today with Chai Aur Code, and the biggest "Aha!" moment wasn't about syntax—it was about architecture. The big realisation: Data doesn't go magically inside the database. It lives on the hard disk or SSD. The database is actually just highly intelligent software that acts as a bridge, helping us read and write to that disk efficiently. Whether it's SQL or NoSQL, at the end of the day, they both store data on physical disks. The real magic lies in the architecture each software follows to handle different use cases. Here’s how I’m breaking down the learning: DDL (Data Definition Language): Designing the blueprint of how that data is structured on the disk. DQL (Data Query Language): The efficient way to ask the software to "fetch" specific bits of data. DML (Data Manipulation Language): The power to change, add, or—frighteningly—remove data. Always write a SELECT query with your WHERE clause first to verify the results before you swap it for a DELETE. Better safe than sorry! Huge thanks to Hitesh Choudhary and Piyush Garg for making these deep architecture concepts so simple and practical. Onward to Joins and more! 🚀 #SQL #NoSQL #DBMS #ChaiAndCode #BackendDevelopment #CodingJourney #DataEngineering #SoftwareArchitecture Hitesh Choudhary, Piyush Garg, Akash Kadlag, Jay Kadlag
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
The integration of the AI vector data type, its indexes, and its operators, into Postgres is (yet another) proof point for the genious of the object-relational approch.