🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)
🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Building a RAG System from Scratch — Wrap-up and What Comes Next

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In this final article, we'll recap what we built across the series, consolidate the design decisions, and point to where to go next.









What We Built



Starting from a blank Python project, we built a complete AI system step by step:




CODE
01_setup_db.py       pgvector table + extension
02_create_index.py HNSW index (m=16, ef_construction=64)
03_ingest.py Embed documents → store in pgvector
04_search.py Cosine similarity search
05_rag.py Full RAG pipeline

06_tool_basic.py LLM decides whether to search
07_tool_multi.py LLM routes between multiple tools
08_tool_agent.py Multi-step agentic loop

09_agent_basic.py ReAct pattern
10_agent_memory.py Persistent memory across sessions
11_agent_planner.py Plan → Execute → Evaluate

mcp_server/
server.py MCP server (stdio, Claude Desktop)
server_http.py MCP server (HTTP)
server_render.py MCP server (Render deployment)

12_mcp_agent.py Agent via MCP (local)
13_mcp_http_agent.py Agent via MCP (cloud)












Design Decisions at a Glance






pgvector over a dedicated vector DB



pgvector integrates with existing PostgreSQL, supports SQL + vector in one query, and handles millions of documents comfortably. Start here and migrate only when you have evidence you need to.






768 dimensions



gemini-embedding-001 outputs 3072 dims by default, but pgvector's HNSW index has a 2000-dim hard limit. 768 dims stays well within bounds with negligible quality loss.






Asymmetric task_type



Use RETRIEVAL_DOCUMENT when storing, RETRIEVAL_QUERY when searching. The Gemini embedding model is trained to map queries toward documents, not to the same point. Using the same task type for both degrades retrieval accuracy.






HNSW over IVFFlat



HNSW requires no training data, delivers consistent recall at scale, and is faster at query time. IVFFlat is only worth considering under tight memory constraints.






Tool description is routing logic



The LLM selects tools based on their description field. Precise, distinguishing descriptions produce correct tool selection. Vague descriptions produce random behavior.






The conversation history is the agent's memory



Each tool call and result gets appended to contents. The LLM reads the full history on every step — this is how multi-step reasoning works.






MCP makes tools infrastructure



MCP turns hardcoded functions into a standalone server. Claude Desktop, Gemini agents, and any future client can connect to the same server without duplicating tool definitions.






Render + Supabase for zero-cost cloud deployment



Render's free web service hosts the MCP server. Supabase's free tier hosts pgvector. The Connection Pooler (port 6543) is mandatory — Render doesn't support the IPv6 used by Supabase's standard port 5432.









The Architecture We Ended Up With






CODE
Local:
Claude Desktop
↓ stdio
mcp_server/server.py
↓ psycopg2
pgvector (Docker)

Cloud:
Python agent (13_mcp_http_agent.py)
↓ HTTPS
Render (server_render.py)
↓ PostgreSQL + SSL (port 6543)
Supabase (pgvector)

Gemini Embedding + LLM












What This Series Did Not Cover



This series focused on getting a production-ready RAG system off the ground. Several important topics are out of scope here:



Evaluation (Evals) — How do you know if your RAG is actually working? You need automated quality measurement: Context Recall, Answer Relevancy, and Faithfulness scoring.



Observability — When something goes wrong in production, how do you debug it? Tracing each step with a tool like Langfuse tells you exactly where latency or quality issues originate.



Security — How do you handle adversarial inputs? Prompt injection, jailbreaks, and PII leakage are real threats in any public-facing RAG system.



MLOps / LLMOps — How do you ship changes safely? Prompt versioning, CI/CD quality gates, and API cost tracking become essential when the system is in production.



Fine-tuning — When the base model doesn't behave the way you need, LoRA fine-tuning lets you adapt it to your domain with surprisingly little data and compute.



Multi-Agent Systems — When a single agent isn't enough, orchestrator-worker patterns distribute work across specialized agents.



Governance — The EU AI Act is now fully in force. Compliance for a chatbot system means AI disclosure notices, audit logging, and a documented risk assessment.



All of these are covered in Vol.2 of this series.









Vol.2: Production Operations Guide



The second series picks up where this one leaves off — taking a working RAG system and making it production-grade.





The README covers setup, directory structure, and the reasoning behind each design decision.









Series Index







  1. Cloud Deployment — Render × Supabase


  2. Wrap-up and Next Steps (this article)






Thanks for following along. If you found this useful, the GitHub repo and Vol.2 are the best places to continue.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Hackers Just Poisoned the Rust Supply Chain | Threat Wire
1 Quelle
Hackers Found a Way Into Humanoid Robots | Threat Wire
1 Quelle
Bits und so #1021 (Passwort für Laufwerk)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building a RAG System from Scratch — Wrap-up and What Comes Next

Thematisch verwandte Begriffe: Building, System, from, Scratch · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...