- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
1.7 KiB
1.7 KiB
Implementation Plan - Advanced Vector RAG (Parallel Deployment)
We will build the "Advanced Vector RAG" system as a separate module to compare with the existing "Live Search RAG".
User Review Required
Note
New Menu Item: "운영자 vertex RAG 챗봇" will be added to the SAM menu. Initial Setup: You must run
chatbot/rag/ingest.phponce to populate the vector database.
Proposed Changes
1. New UI & Entry Point
[MODIFY] myheader.php
- Add new menu item: "운영자 vertex RAG 챗봇" linking to
chatbot/rag_index.php.
[NEW] chatbot/rag_index.php
- Copied from
index.php. - Updated to call
rag_api.phpinstead ofapi.php. - Updated title/branding to indicate "RAG Version".
2. Vector Backend
[NEW] chatbot/rag_api.php
- Copied from
api.php. - logic:
NotionClient->search()replaced withVectorSearch->search().
3. Vector Engine (Core Logic)
[NEW] chatbot/rag/ingest.php
- EXTRACT: Fetch all Notion pages.
- EMBED: Generate vectors using Gemini
text-embedding-004. - STORE: Save to
chatbot/rag/data/vectors.json.
[NEW] chatbot/rag/search.php
- LOAD: Read
vectors.json. - SEARCH: Calculate Cosine Similarity between Query Vector and Stored Vectors.
- RETRIEVE: Return top 5 matches.
Verification Plan
- Menu Check: Verify new menu item appears and leads to the new page.
- Ingestion: Run
ingest.php(via browser or CLI) and checkvectors.jsonsize. - Comparison Test: Ask the same question to both chatbots and compare answers.