diff --git a/troubleshooting/250915_skill-rag-file_초기_구축.md b/troubleshooting/250915_skill-rag-file_초기_구축.md index e7d54a2..66be63d 100644 --- a/troubleshooting/250915_skill-rag-file_초기_구축.md +++ b/troubleshooting/250915_skill-rag-file_초기_구축.md @@ -2,7 +2,9 @@ ## 작성일: 2025-09-15 ## 작성자: Claude (51123 서버 관리자) -## 관련 문서: [RAG 파일 처리 아키텍처](../ideas/250909_RAG_file_processing_architecture.md) +## 관련 문서: +- [RAG 파일 처리 아키텍처](../ideas/250909_RAG_file_processing_architecture.md) +- [테이블 구조](../300_architecture/database/tables.md) ## 1. 구현 사항 @@ -20,10 +22,8 @@ - **권한**: admin:xusers (읽기/쓰기 가능) ### 서비스 구성 -- **서비스명**: skill-rag-file -- **포트**: 8508 -- **저장 경로**: /mnt/51123data/documents/{team_id}/YYYY-MM/ - **Gitea 레포**: https://git.ro-being.com/ivada_Ro-being/skill-rag-file +- **프로젝트 구조**: app/{api,core,models,services,utils} 디렉토리만 생성, 구현 파일 없음 ## 2. 핵심 결정 사항 @@ -42,9 +42,57 @@ - **추가**: /mnt/51123data (데이터/문서 전용) - **장점**: 51124 로컬 쓰기 → 51123 HDD 직접 저장 -## 3. 다음 단계 -1. skill-rag-file 프로젝트 구조 설정 -2. FastAPI 기본 서버 구현 (/upload, /search, /healthz) -3. PyPDF2, python-docx 텍스트 추출 -4. ChromaDB team_{team_id}_documents 컬렉션 설정 +## 3. 확인된 시스템 정보 + +### 51124 서버 환경 +- **SSHFS 마운트**: /mnt/51123data → 192.168.219.45:/mnt/hdd/data +- **documents 디렉토리**: /mnt/51123data/documents/ 존재 +- **ChromaDB**: 0.5.20 설치됨 + +### ChromaDB 연결 정보 +- **호스트**: localhost +- **포트**: 8000 + +### skill-embedding 서비스 +- **URL**: http://localhost:8515 +- **엔드포인트**: POST /embed +- **요청 형식**: {"texts": ["텍스트1", "텍스트2"]} +- **응답 형식**: {"embeddings": [[...]], "model": "...", "dimensions": 768} +- **최대 배치**: 100개 텍스트 + +### Docker 패턴 (기존 스킬 참조) +- **skill-email 방식**: network_mode: host +- **skill-news 방식**: ports 매핑, robeing-network +- **헬스체크**: curl http://localhost:[PORT]/health + +### FastAPI 패턴 (기존 서비스 참조) +- **미들웨어**: CORSMiddleware (allow_origins=["*"]) +- **환경변수**: load_dotenv() 사용 +- **lifespan**: 컨텍스트 매니저 패턴 + +### 미설치 라이브러리 +- PyPDF2: 현재 미설치 +- python-docx: 현재 미설치 + +### Slack 통합 고려사항 +- **파일 수신**: Slack 봇 files:read 스코프 필요 +- **토큰**: slack_workspace 테이블 bot_token 사용 +- **기존 연동**: rb8001/rb10508이 Slack 메시지 처리 중 +- **통합 방식**: rb8001에서 호출 또는 직접 이벤트 수신 필요 + +## 4. 확정 사항 + +| 항목 | 확정값 | +|------|---------| +| 포트 | 8508 | +| 헬스체크 | /healthz | +| 컬렉션명 | rb8001_{team_id}_documents | +| 엔드포인트 | /upload, /search, /healthz | +| 저장 경로 | /mnt/51123data/documents/{team_id}/YYYY-MM/ | + +## 5. 다음 단계 +1. FastAPI 서버 구현 (app/ 디렉토리 내 실제 코드 작성) +2. PyPDF2, python-docx 설치 및 텍스트 추출 구현 +3. ChromaDB rb8001_{team_id}_documents 컬렉션 연동 +4. Slack 파일 수신 로직 구현 또는 rb8001 연동 5. Docker 컨테이너화 (포트 8508) \ No newline at end of file