ChromaDB 컬렉션 현황
최종 업데이트: 2026-04-13 관련: 품아이 데이터셋 기획, ChromaDB SEGV 복구, 품아이 브레인맵
개요
- 위치:
/home/haeory/poomasi/rag/chroma_db/ - 총 용량: 153MB
- 총 건수: 30,855건 (5개 컬렉션)
- 엔진 연동:
rag/engine.py— search() 호출 시 poomasi_qa + poomasi_qa_addl 병합 검색
컬렉션 목록
| 컬렉션 | 건수 | 용도 | 메타키 |
|---|---|---|---|
| poomasi_qa | 24,843 | QA 쌍 (메인) | question, answer |
| poomasi_docs | 3,001 | 원문 청크 | chunk_index, folder_name, source_file |
| member_profiles | 2,386 | 조합원 프로필 | member_id, member_name, investment, visit_count, type, compiled_at |
| farmer_profiles | 503 | 농가 프로필 | farmer_no, farmer_name, farmer_type, branch, certification, production_type, tx_count, is_internal_code, compiled_at |
| poomasi_qa_addl | 122 | 추가 QA (시드) | question, answer |
각 컬렉션 상세
poomasi_qa — 메인 QA (24,843건)
- 출처:
rag/refined/qa/(228개 JSONL, 총 7,258건 원본 → 인덱싱 후 24,843건) - 내용: 후니님 강의·문서에서 추출한 QA 쌍
- 예시:
Q: 칼 폴라니의 '이중운동'이 뭐야?
- 예시:
- 검색 방식:
engine.py search()기본 검색 대상 - ⚠️ 이력: 2026-04-05 위키백과 66,315건 벌크 인제스트 → SEGV 사고 → 삭제 복구 → 현재 정상 (→ ChromaDB SEGV 복구)
poomasi_qa_addl — 추가 QA 시드 (122건)
- 출처:
rag/poomasi_qa_addl.jsonl(수동 작성) - 구성:
- seed_detail: 45건 (품앗이생협 도메인 지식)
- djco_detail: 25건 (대전주민운동교육원)
- subdomain_detail: 15건 (서브도메인 안내)
- cross_domain: 24건 (교차 도메인)
- correction: 13건 (오답 교정)
- 검색: poomasi_qa와 병합 검색
poomasi_docs — 원문 청크 (3,001건)
- 출처: 내부 문서 청킹 결과
- 메타: folder_name + source_file로 출처 추적 가능
- 용도: QA 생성의 원재료, 직접 검색도 가능
member_profiles — 조합원 프로필 (2,386건)
- 출처: Supabase → 컴파일 → ChromaDB 인덱싱
- 활용: 조합원 검색, CRM 인텐트 처리
- 접근 제한: 로그인(Supabase Auth JWT) 필수 (engine.py auth_required)
- compiled_at: 마지막 동기화 시각 기록
farmer_profiles — 농가 프로필 (503건)
- 출처: 넷포스 농가 코드 → 컴파일
- 활용: 농가 검색, 품목-농가 매핑
- 주요 메타: branch(지점), certification(인증), production_type(재배방식), tx_count(거래건수)
engine.py 라우팅 (2026-04-12 기준)
기본 라우트: chroma (이전: direct)
→ 모든 질문이 ChromaDB 먼저 검색
→ 키워드 매칭(_KNOW_KW) 없어도 자동 검색 대상
검색 흐름:
engine.search(query)호출- poomasi_qa + poomasi_qa_addl 병합 검색 (n_results=5 each)
- score 기준 정렬 → 상위 refs 반환
- LLM 프롬프트에 context로 주입
데이터 추가 방법
cd /home/haeory/poomasi/rag
source venv/bin/activate
# QA 추가 (upsert — 중복 방지 필수)
python3 ingest_qa.py --file refined/qa/새파일.jsonl --collection poomasi_qa
# 컬렉션 상태 확인
python3 -c "
import chromadb
client = chromadb.PersistentClient(path='chroma_db')
for c in client.list_collections():
print(c.name, client.get_collection(c.name).count())
"⚠️ 반드시 upsert 사용 — add() 쓰면 중복 3배 → SEGV (→ ChromaDB SEGV 복구)
미완료 / 다음 단계
- 파인튜닝 데이터셋 500건 목표 (현재 329건, 171건 부족)
- HuggingFace 공무원시험 7,872건 인제스트 (위키 사고 후 보류 중)
- 수능 기출 PDF 파싱 스크립트 작성
- member_profiles / farmer_profiles 정기 동기화 자동화