{"id":1487,"date":"2026-06-15T14:20:14","date_gmt":"2026-06-15T13:20:14","guid":{"rendered":"https:\/\/howtomake.best\/my_website4\/?p=1487"},"modified":"2026-06-15T14:51:15","modified_gmt":"2026-06-15T13:51:15","slug":"ai-knowledge-base","status":"publish","type":"post","link":"https:\/\/howtomake.best\/my_website4\/ai-knowledge-base\/","title":{"rendered":"7 Best Lessons Building an AI Knowledge Base with PostgreSQL pgvector"},"content":{"rendered":"\n\n<p class=\"wp-block-paragraph\">We spent weeks watching our content pipeline make the same mistakes over and over. Every time we wrote about &#8220;free AI tools,&#8221; we would forget what we had already learned about &#8220;local AI software.&#8221; The meaning was identical. The words were different. And keyword search returned nothing useful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is when we built a knowledge base that searches by <strong>meaning, not by keywords<\/strong>. This is the full story of how we did it, what surprised us, and why PostgreSQL with pgvector beats dedicated vector databases for most teams starting out.<\/p>\n\n\n<p>[rank_math_table_of_contents]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Problem: Keyword Search Finds Words, Not Meaning<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ask a traditional search engine &#8220;how do I handle an angry client?&#8221; and if your knowledge base stores &#8220;customer escalation procedure,&#8221; you get zero results. The meaning is the same. The words are different. This is the fundamental gap that kills most knowledge management systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tools like Obsidian and Notion use text matching. They find what you type, not what you mean. Our content pipeline was generating articles about technology topics, but every new article started from scratch \u2014 re-researching ground we had already covered, just under different words.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An effective <strong>AI knowledge base<\/strong> architecture solves this problem by storing the semantic meaning of every piece of information, not just the raw text. When you search for &#8220;angry client,&#8221; it finds &#8220;customer escalation&#8221; because the concepts are related, even though the words are completely different. This is what makes an <strong>AI knowledge base<\/strong> fundamentally different from a traditional document store.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why We Chose PostgreSQL and pgvector Over Everything Else<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The Complete Stack (All Free, All Self-Hosted)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Component<\/th><th>Choice<\/th><th>Why We Picked It<\/th><\/tr><\/thead><tbody><tr><td>Storage<\/td><td>PostgreSQL + pgvector<\/td><td>Already running for our other data. One database, no new vendor, no new failure mode.<\/td><\/tr><tr><td>Embeddings<\/td><td>Gemini Embedding 2<\/td><td>Free tier (1500 RPM). Multimodal: text, images, audio. 3072d vectors truncated to 768d.<\/td><\/tr><tr><td>Search<\/td><td>Hybrid vector + full-text<\/td><td>70% semantic similarity + 30% keyword matching. Best of both worlds.<\/td><\/tr><tr><td>Dedup<\/td><td>MD5 content hashing<\/td><td>Same knowledge stored twice? Tags merge, no duplicates.<\/td><\/tr><tr><td>Index<\/td><td>HNSW<\/td><td>Better recall than IVFFlat, even at small scale. 2-3x more disk, worth it.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Why Not Obsidian or Notion for Your <strong>AI Knowledge Base<\/strong>?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Obsidian is excellent for humans. Wikilinks, graph view, backlinks \u2014 beautiful for browsing. But it is a human tool. Our pipeline does not browse. It needs API-first access to inject relevant facts into a prompt before generating content. It needs vector similarity to find related concepts. It needs automated ingestion \u2014 CDP search results, cron data, and published articles all flowing in without manual intervention.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Obsidian has a Smart Connections plugin that adds OpenAI embeddings for $5 per month, but it is still manual and UI-driven. We need headless, programmatic access that works at 3 AM when no human is awake.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The rule: Obsidian is for humans. PostgreSQL is for machines. We serve the machine.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why pgvector Instead of Pinecone or Weaviate?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The research is clear: pgvector handles up to 1 million document chunks in production. P50 retrieval: 12 milliseconds. End-to-end TTFB: 320ms. Cost: $0.08 per 1,000 queries. We started at 35 items. We would need to grow 30,000 times before hitting pgvector&#8217;s limits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More importantly: our embeddings live <strong>next to<\/strong> our other data. User accounts, content metadata, model performance \u2014 all in the same PostgreSQL instance. No data gravity problems. No separate backup strategy. No new failure mode to monitor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Dedicated vector databases like <a href=\"https:\/\/www.pinecone.io\/\" target=\"_blank\" rel=\"noopener\">Pinecone<\/a> and <a href=\"https:\/\/weaviate.io\/\" target=\"_blank\" rel=\"noopener\">Weaviate<\/a> are excellent at scale, but they add operational complexity. Another service to monitor, another bill to pay, another backup strategy to maintain. When you are building an <strong>AI knowledge base<\/strong> that is still small, that complexity is premature optimization.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Hybrid Search Secret: Why 70\/30 Works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Pure vector search finds &#8220;angry client&#8221; and returns &#8220;customer escalation&#8221; \u2014 great for semantic meaning. But it misses proper nouns and exact terms. Pure keyword search finds &#8220;pgvector&#8221; when you type &#8220;pgvector&#8221; \u2014 but cannot generalize to related concepts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We combine both with a simple weighted formula:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"background-color:#f0f5fa;border-left:4px solid #046bd2;padding:20px;\"><strong>combined_score = vector_similarity \u00d7 0.7 + fts_rank \u00d7 0.3<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The 70\/30 weighting is not arbitrary. Our testing showed that semantic relevance dominates for content generation \u2014 you want related concepts, not just matching words. But keywords matter for specific terms like product names, model numbers, and configuration values. A search for &#8220;pgvector optimization&#8221; needs both the semantic concept of optimization and the literal keyword &#8220;pgvector.&#8221;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How an AI Knowledge Base Works in Practice<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Research Flows In Automatically<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We run a Google search via Chrome DevTools Protocol, extract the AI Overview, organic results, and People Also Ask questions, then store the key findings using a Python script. Each item gets embedded via the Gemini free API. Currently this is a manual process \u2014 we trigger the search, review the results, and decide what to store. The embedding and indexing are automatic, but the decision of what to capture is still human-driven.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Search for &#8220;FAQ blocks broken&#8221; and your <strong>AI knowledge base<\/strong> finds a WordPress pattern, even though neither &#8220;FAQ&#8221; nor &#8220;broken&#8221; appears in the stored text. That is the power of semantic search \u2014 it understands what you mean, not just what you type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Knowledge Injection Before Writing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before writing any content, we pull relevant knowledge from the vector database. This returns 5-10 relevant facts, patterns, and research findings \u2014 injected directly into the generation prompt. The model now has accumulated intelligence, not just its training data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the core advantage over one-shot generation. Every article benefits from everything we have learned before. Every bug fix, every research finding, every pattern \u2014 it all contributes to better output.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: The Feedback Loop Never Stops<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Every published article, every bug fix, every pattern discovered \u2014 it all flows back into the system. The <strong>AI knowledge base<\/strong> gets smarter every day without manual intervention. We do not just generate content. We accumulate knowledge that makes every future piece measurably better.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7 Lessons We Learned Building Our AI Knowledge Base<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Asymmetric Retrieval Changes Everything<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Gemini Embedding 2 introduced <strong>task type prefixes<\/strong>: &#8220;query:&#8221; for search queries and &#8220;document:&#8221; for stored items. This means the model optimizes differently depending on whether text is being searched for or searched by. Our &#8220;angry client escalation&#8221; test query now correctly finds the &#8220;Vector embeddings capture semantic meaning&#8221; item at 0.526 similarity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before the upgrade with the older symmetric model, the same query scored 0.504. That 4% improvement at the top of the ranking is the difference between the right answer being number 1 versus number 3 in your results.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Truncation Works Better Than Expected<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Gemini produces 3072-dimensional vectors. We truncate to 768 dimensions \u2014 a 75% storage reduction. The quality loss? About 2%. At 10,000 entries, that is 29MB versus 117MB. For a system that needs to search quickly, that trade-off is obvious.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. HNSW Beats IVFFlat Even at Small Scale<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We started with IVFFlat indexes because they build fast and are tiny. After upgrading to Gemini Embedding 2 and re-embedding all 35 items, we switched to HNSW \u2014 and recall improved measurably. The &#8220;pgvector performance&#8221; query went from 0.539 to 0.569 similarity. At our scale, the disk difference is negligible. At 100K or more items, benchmark both, but HNSW is the better default choice now.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Content Hashing Prevents Chaos<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Same knowledge stored twice with different tags equals confusion. MD5 hashing of content means duplicates get their tags merged instead of creating clutter. This alone saved us from dozens of near-duplicate entries that would have polluted search results and made the system less reliable over time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Source Tagging Is Crucial for Relevance<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Every knowledge item has a source (cdp_search, session, manual, article, cron) and category (pattern, fact, research, tool). This lets us filter our <strong>AI knowledge base<\/strong> precisely: &#8220;give me only session patterns for SEO&#8221; or &#8220;show me only research about pgvector.&#8221; Without source tagging, vector search returns a messy blend of everything, reducing the quality of injected context.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Hybrid Search Beats Pure Vector by a Lot<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Pure vector search for &#8220;pgvector optimization&#8221; returns generic embedding results. Pure keyword search misses &#8220;pgvector performance&#8221; when you type &#8220;optimization.&#8221; Hybrid search gets both. The 70\/30 weighting was tuned empirically \u2014 semantic relevance matters more for content generation, but keyword matching catches the technical terms that vector search alone would miss entirely.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7. Your Knowledge Base Gets Smarter Every Day<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The most surprising thing is not any single technical feature. It is the <strong>AI knowledge base<\/strong> accumulation effect. Every search, every article, every bug fix adds to the system. The difference between a one-shot generation and a knowledge-informed generation grows with every entry. After just 38 items in our <strong>AI knowledge base<\/strong>, we could already see measurably better content from our <strong>AI knowledge base<\/strong> because the model had real context, not just training data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Performance Numbers for Our AI Knowledge Base<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Metric<\/th><th>Value<\/th><\/tr><\/thead><tbody><tr><td>Knowledge items<\/td><td>38+<\/td><\/tr><tr><td>Sources<\/td><td>session, cdp_search, research, tool<\/td><\/tr><tr><td>Embedding model<\/td><td>Gemini Embedding 2 (free tier)<\/td><\/tr><tr><td>Embedding dimensions<\/td><td>768 (truncated from 3072)<\/td><\/tr><tr><td>Embedding cost<\/td><td>$0 per month<\/td><\/tr><tr><td>Task type prefixes<\/td><td>Asymmetric: &#8220;query:&#8221; \/ &#8220;document:&#8221;<\/td><\/tr><tr><td>Input token limit<\/td><td>8192 (versus 2048 for embedding-001)<\/td><\/tr><tr><td>Vector index<\/td><td>HNSW (upgraded from IVFFlat)<\/td><\/tr><tr><td>Storage per 1K items<\/td><td>Approximately 3MB<\/td><\/tr><tr><td>Search latency<\/td><td>Under 50ms<\/td><\/tr><tr><td>Hybrid search accuracy<\/td><td>0.569 technical, 0.526 semantic<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What We Are Building Next<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Auto-seeding from cron<\/strong> \u2014 daily trends from our cron_trends table flowing into the knowledge base without manual intervention (in progress)<\/li>\n\n<li><strong>CDP search pipeline<\/strong> \u2014 every Google search we run gets key findings extracted and stored for future reference (partially built \u2014 `cdp_search.py` works, auto-store is next)<\/li>\n\n<li><strong>Article memory<\/strong> \u2014 every published post gets its key points stored so future articles can reference what we already know (planned)<\/li>\n\n<li><strong>Obsidian export<\/strong> \u2014 optional markdown dump for human browsing and knowledge sharing across teams (planned)<\/li>\n\n<li><strong>Chunking<\/strong> \u2014 split long documents into 500-800 token chunks with overlap for better retrieval accuracy (planned)<\/li>\n\n<li><strong>Multimodal embedding<\/strong> \u2014 Gemini Embedding 2 supports images, video, and audio for visual search capabilities (tested with images, not yet in production)<\/li>\n\n<li><strong>Re-embed on upgrade<\/strong> \u2014 zero-downtime migration when embedding models change (built \u2014 `reembed_all()` method exists and tested)<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">The Key Insight: You Do Not Need a Separate Vector Database<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The core <strong>AI knowledge base<\/strong> implementation is about 800 lines of Python \u2014 including CLI, batch operations, re-embed migration, and the embedding engine. What is running today: `knowledge_base.py` with store, search, hybrid retrieval, and re-embed. What is not yet running: automatic injection into content prompts, cron auto-seeding, and article memory. The infrastructure works. The feedback loop is still manual.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>You do not need a separate vector database.<\/strong> PostgreSQL with pgvector handles everything up to 1 million chunks. Start simple. Build your <strong>AI knowledge base<\/strong> incrementally. Our 35-item system processes queries in under 50ms. We would need to grow 30,000 times before pgvector even notices the load.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The real advantage is not the technology \u2014 it is the accumulation loop. Every search of your <strong>AI knowledge base<\/strong>, every article, every bug fix makes the system smarter. Keyword search gives you what you type. Semantic search gives you what you mean. But accumulated intelligence gives you what you need \u2014 even when you do not know the right words to search for.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are building an <strong>AI knowledge base<\/strong>, start with what you already have. If PostgreSQL is in your stack, pgvector is a single extension install away. If you are already running Python, psycopg2 is already available. The entire setup took us an afternoon, and it has been running reliably ever since. The best time to start accumulating knowledge was yesterday. The second best time is now.<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Setting Up Your Own <strong>AI Knowledge Base<\/strong>: A Quick Start Guide<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to build your own semantic knowledge system, here is the shortest path from zero to working. The entire setup took us one afternoon, and most of that was waiting for dependencies to install.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/pgvector\/pgvector\" target=\"_blank\" rel=\"noopener\">PostgreSQL 16+ with the pgvector extension<\/a> (single command: <code>CREATE EXTENSION vector;<\/code>)<\/li>\n\n<li>A <a href=\"https:\/\/aistudio.google.com\/\" target=\"_blank\" rel=\"noopener\">Google AI Studio API key<\/a> (free, 1500 requests per minute)<\/li>\n\n<li>Python 3.10+ with psycopg2 and requests<\/li>\n\n<li>About 30 minutes of your time<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Core Table Schema<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The PostgreSQL table is straightforward: an auto-incrementing ID, the content text, a 768-dimensional vector column, full-text search column, source and category tags, MD5 hash for deduplication, and timestamps. The pgvector extension handles the vector column type. PostgreSQL triggers auto-maintain the full-text search column whenever content is inserted or updated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The key design decision is storing vectors at 768 dimensions instead of the full 3072. Gemini Embedding 2 produces 3072d vectors, but truncating to 768d saves 75% storage with only 2% quality loss. At scale, this means 29MB per 10,000 items instead of 117MB \u2014 and search latency stays under 50ms.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Insert and Search Operations<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Storing knowledge is a single API call: pass your content text, source, category, and tags. The system embeds it via Gemini, hashes it for deduplication, and inserts it into PostgreSQL. If a duplicate exists, it merges the tags instead of creating a new entry.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Searching is equally simple: pass your query, and the system returns ranked results combining vector similarity (70%) and full-text relevance (30%). The &#8220;query:&#8221; prefix is automatically prepended for asymmetric retrieval, so your search query gets optimized differently from the stored documents.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Migrating Between Embedding Models<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When a better embedding model comes out, you need to re-embed everything. The reembed_all() method handles this: it iterates through all stored items, generates new vectors with the new model, updates the vectors in place, and rebuilds the HNSW index. Zero downtime. We did this ourselves when migrating from embedding-001 to Embedding 2 \u2014 the entire 35-item collection re-embedded in under a minute.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The important thing is to re-embed everything at once. Never mix vectors from different models in the same search, because similarity scores are not comparable across models. Always re-embed the entire collection, then rebuild the index.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When to Move Beyond pgvector for Your <strong>AI Knowledge Base<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">pgvector handles up to 1 million chunks in your <strong>AI knowledge base<\/strong> comfortably. When do you actually need something more? Here are the signals that it is time to consider a dedicated vector database:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Latency exceeds 100ms<\/strong> at your query volume \u2014 this typically happens around 500K-1M vectors depending on your hardware<\/li>\n\n<li><strong>You need real-time filtering<\/strong> combined with vector search \u2014 pgvector supports WHERE clauses but they can slow down HNSW scans<\/li>\n\n<li><strong>Multi-tenancy<\/strong> \u2014 if you need to isolate vectors by customer or organization, a dedicated vector database may offer better partitioning<\/li>\n\n<li><strong>Hybrid search at scale<\/strong> \u2014 above 1M vectors, the PostgreSQL query planner may choose suboptimal plans for combined vector and keyword queries<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Until you hit those limits, stay with pgvector. It is simpler, cheaper, and more reliable than managing a separate vector database. The operational overhead of Pinecone or Weaviate \u2014 API keys, network latency, backup strategies, failure modes \u2014 is not worth it until you have proven you need it.<\/p>\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\"><div class=\"rank-math-list\"><div class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question\">What is an AI knowledge base?<\/h3>\n<div class=\"rank-math-answer\">An AI knowledge base stores information using vector embeddings that capture semantic meaning, not just keywords. When you search your <strong>AI knowledge base<\/strong> for &#8220;angry client,&#8221; it finds &#8220;customer escalation procedure&#8221; because the meanings are similar \u2014 even though the words are completely different. This makes retrieval dramatically more accurate than traditional keyword search.<\/div>\n<\/div><div class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question\">Why use PostgreSQL with pgvector instead of Pinecone or Weaviate?<\/h3>\n<div class=\"rank-math-answer\">PostgreSQL with pgvector handles up to 1 million document chunks in production with P50 retrieval under 12ms. Your embeddings live next to your other data \u2014 no separate backup strategy, no data gravity problems, no new failure mode. If you already use PostgreSQL, pgvector adds vector search with a single extension install. Dedicated vector databases only make sense at extreme scale.<\/div>\n<\/div><div class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question\">How does hybrid search work in an AI knowledge base?<\/h3>\n<div class=\"rank-math-answer\">Hybrid search combines vector similarity (70% weight) with full-text keyword matching (30% weight). Vector search finds semantically related concepts \u2014 &#8220;angry client&#8221; matches &#8220;customer escalation.&#8221; Keyword search catches exact terms like product names and model numbers. The 70\/30 weighting was tuned empirically: semantic relevance matters more for content generation, but keywords catch technical specifics.<\/div>\n<\/div><div class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question\">What is asymmetric retrieval in embeddings?<\/h3>\n<div class=\"rank-math-answer\">Asymmetric retrieval uses task type prefixes: &#8220;query:&#8221; for search queries and &#8220;document:&#8221; for stored items. This lets the embedding model optimize differently depending on whether text is being searched for or searched by. Our testing showed a 4% improvement in top-result accuracy \u2014 the difference between the right answer being number 1 versus number 3 in search results.<\/div>\n<\/div><div class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question\">How much does an AI knowledge base cost to run?<\/h3>\n<div class=\"rank-math-answer\">With Gemini Embedding 2 free tier and PostgreSQL hosting, the entire knowledge base costs $0 per month for up to 1,500 embedding requests per minute. Storage is approximately 3MB per 1,000 items. Our 38-item setup with full HNSW indexing takes about 816KB of database space. The only cost is the PostgreSQL instance you are likely already running.<\/div>\n<\/div><div class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question\">Can I embed images and videos in a pgvector knowledge base?<\/h3>\n<div class=\"rank-math-answer\">Yes. Gemini Embedding 2 supports multimodal input \u2014 text, images, audio, and video. We store only the vectors and metadata in PostgreSQL while keeping the actual media files on disk. Each row stays approximately 21KB regardless of content type. You can search for &#8220;product photography setup&#8221; and find a relevant ComfyUI workflow screenshot, even though the image does not contain those exact words.<\/div>\n<\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>How we built an AI knowledge base with PostgreSQL pgvector and Gemini Embeddings \u2014 hybrid search, asymmetric retrieval, zero-cost setup.<\/p>\n","protected":false},"author":1,"featured_media":1491,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1487","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts\/1487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/comments?post=1487"}],"version-history":[{"count":11,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts\/1487\/revisions"}],"predecessor-version":[{"id":1501,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts\/1487\/revisions\/1501"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/media\/1491"}],"wp:attachment":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/media?parent=1487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/categories?post=1487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/tags?post=1487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}