diff --git a/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md b/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md index 11f310d..8439a9c 100644 --- a/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md +++ b/troubleshooting/250916_rb8001_skill-rag-file_연동_구조.md @@ -19,7 +19,12 @@ - **rb8001**: 파일 수신은 하지만 처리 로직 없음 - slack_handler.py:244에서 `files = event.get("files", [])` 추출만 - context에 파일 정보 포함 후 전달만 함 -- **skill-rag-file**: API 엔드포인트만 있고 실제 구현 없음 + - skill-rag-file 호출 코드 없음 + +### skill-rag-file 구현 상태 (51124) +- **구현 완료**: app/main.py, api/{upload.py,search.py}, services/* (텍스트 추출/청킹/임베딩/ChromaDB) +- **DB 모델**: app/models/database.py (team_document 테이블 정의) +- **기본 경로**: DOCUMENT_BASE_PATH=/mnt/51123data/documents (app/core/config.py) ## 2. 실제 메시지 플로우 (확인됨) @@ -38,7 +43,7 @@ rb8001:8001 (51124) /api/slack/events - slack_endpoint.py → slack_handler.py - handle_slack_events()에서 파일 추출 - - background_process_request()로 비동기 처리 + - asyncio.create_task(process_slack_message_async())로 비동기 처리 ↓ brain_service/llm_service (파일 처리 없이 텍스트만 처리) @@ -59,9 +64,9 @@ brain_service/llm_service (파일 처리 없이 텍스트만 처리) ## 4. skill-rag-file 현황 (51124) -### API 엔드포인트 (구현은 되어 있으나 기능 미완성) +### API 엔드포인트 (구현됨) - POST /api/upload: 파일 업로드 -- GET /api/search: 검색 +- POST /api/search: 검색 (GET 아님) - GET /api/search/collections: 컬렉션 목록 - GET /healthz: 헬스체크 @@ -71,9 +76,9 @@ brain_service/llm_service (파일 처리 없이 텍스트만 처리) ## 5. 데이터베이스 상태 (51123 PostgreSQL) -### team_document 테이블 (생성 완료) +### team_document 테이블 상태 +**PostgreSQL 실제 테이블** (file_size, mime_type, chunk_count, processing_status 포함): ```sql --- 실제 생성된 테이블 구조 id UUID PRIMARY KEY DEFAULT gen_random_uuid() team_id UUID NOT NULL REFERENCES team(id) filename VARCHAR(255) NOT NULL @@ -87,18 +92,24 @@ processing_status VARCHAR(20) DEFAULT 'pending' metadata JSONB DEFAULT '{}' created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP +``` --- 인덱스 -idx_team_doc_hash UNIQUE (team_id, file_hash) +**skill-rag-file 코드 모델** (app/models/database.py): +```python +# file_size, mime_type, chunk_count, processing_status 컬럼 없음 +# 파일 크기/타입은 metadata JSONB에 저장 +id, team_id, filename, file_hash, storage_path, +text_content, metadata, created_at, updated_at ``` ## 6. 확인 완료 사항 -- ✅ team_document 테이블 생성됨 +- ✅ team_document 테이블 생성됨 (단, 코드 모델과 스키마 차이 있음) - ✅ /mnt/hdd/data/documents/ 디렉터리 생성됨 + - 코드 기본값: /mnt/51123data/documents (skill-rag-file/app/core/config.py) - ✅ Slack bot_token 2개 팀 보유 (Robeing, Company-X Team) - ✅ files:read 스코프 포함 (설치 URL에서 확인) - ✅ rb8001 → skill-rag-file:8508 네트워크 연결 가능 ## 7. 로컬 개발자 작업 필요 -- rb8001/app/router/slack_handler.py:244 이후 파일 처리 코드 추가 -- skill-rag-file 전체 구현 (Slack 파일 다운로드, 텍스트 추출, DB 저장) \ No newline at end of file +- rb8001/app/router/slack_handler.py:244 이후 skill-rag-file 호출 추가 +- skill-rag-file DB 모델과 실제 테이블 스키마 동기화 필요 \ No newline at end of file