# Building first RAG system

**URL:** <https://community.openai.com/t/building-first-rag-system/1289548>\
**Category:** API\
**Created:** [June 15, 2025, 10:13pm UTC](https://community.openai.com/t/building-first-rag-system/1289548 "2025-06-15T22:13:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lucmachine](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/lucmachine/32/633237_2.png) [@lucmachine](https://community.openai.com/u/lucmachine)\
**Post date:** [June 15, 2025, 10:13pm UTC](https://community.openai.com/t/building-first-rag-system/1289548/3 "2025-06-15T22:13:15Z")

</div>

Thanks.

I suppose I should have mentioned that the final ojbective is to create a chatbot.

My tentative workflow is as follows (noting that this for a MVP - testing a use case with low cost):

| Layer | Technology | Purpose | Implementation Details |
| --- | --- | --- | --- |
| Document Preprocessing | Python + Regex + python-docx | Semantic chunking | Custom logic for headings, clauses, structure preservation. Run locally, upload to Supabase |
| Embedding Generation | Hugging Face API from Edge Function | Vector generation | Deno-based edge function calling HF API for embeddings |
| Vector Storage | Supabase pgvector | Semantic search database | Native PostgreSQL with vector similarity (same database) |
| Query Vectorization | Hugging Face API | Query-to-vector conversion | Same API call from edge function |
| Chunk Retrieval | Native SQL in Edge Function | Top-K selection | Direct SQL queries to pgvector within same Supabase instance |
| LLM Completion | OpenAi/Claude/Gemini API | Response generation | API calls from Supabase edge functions |
| Frontend | React/Next.js or WIX | Chat interface | Any frontend calling Supabase edge function endpoints |
| Backend | Supabase Edge Functions | Integrated serverless | TypeScript/Deno functions with direct database access |

Nb: Using Wix because I alread have an account. If I scale up, I’ll find better back and frontend solutions.

Anything glaringly off?

---

_[View the full topic](https://community.openai.com/t/building-first-rag-system/1289548)._
