DiffLens.mp4
DiffLens AI Server는 LLM 기반 지능형 패널 검색 및 분석 서비스입니다.
| LEAD/BE | FE | FE/DE | BE | AI/DATA |
![]() |
![]() |
![]() |
![]() |
![]() |
| 박세웅 | 윤예진 | 윤혜성 | 김준용 | 신정호 |
- Python 3.11 - 런타임
- FastAPI - 웹 프레임워크
- LangChain - LLM 프레임워크
- Anthropic Claude - LLM (Haiku, Sonnet)
- Upstage Embedding - 벡터 임베딩
- PostgreSQL + pgvector - 데이터베이스
- SQLAlchemy + asyncpg - ORM (비동기)
- Docker - 컨테이너
# 저장소 클론 (서브모듈 포함)
git clone --recurse-submodules https://github.com/SW-DiffLens/be-sub.git
cd be-sub
# 가상환경 생성 및 활성화
python -m venv venv
source venv/bin/activate
# 의존성 설치
pip install -r requirements.txt
pip install -r ai/requirements.txt# LLM API Keys
ANTHROPIC_API_KEY=sk-ant-api03-xxx
UPSTAGE_API_KEY=up_xxx
# Database
DATABASE_URL=localhost
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=your_password
DATABASE_NAME=panel_search
DB_PORT=5432uvicorn app.main:app --reload --host 0.0.0.0 --port 8000# 이미지 빌드
docker build -t difflens-ai .
# 컨테이너 실행
docker run -p 8000:8000 --env-file .env difflens-aibe-sub/
├── app/
│ └── main.py # AI 서브모듈 로더
├── ai/ # AI 서브모듈 (git submodule)
│ ├── main.py # FastAPI 앱 엔트리포인트
│ ├── src/
│ │ ├── api/ # API 라우터 및 스키마
│ │ ├── services/ # 비즈니스 로직
│ │ ├── repositories/ # 데이터 접근 계층
│ │ ├── llm/ # LLM 통합 모듈
│ │ ├── domain/ # 도메인 모델
│ │ ├── core/ # 설정 및 유틸리티
│ │ └── utils/ # 상수 정의
│ └── prompts/ # LLM 프롬프트 템플릿
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── start.sh
- 자연어 쿼리 파싱: LLM을 활용한 자연어 → 구조화된 필터 변환
- 하이브리드 검색: 필터 검색 + 벡터 유사도 검색 조합
- 지능형 차트 추천: 데이터 특성에 맞는 최적의 시각화 차트 자동 선택
- 개인화 추천: 업종/회원 검색 이력 기반 맞춤형 패널 추천
- 집단 비교 분석: 두 코호트 간 통계적 차이 분석 및 AI 인사이트 생성
- 프로필 생성: 패널 메타데이터 기반 자연어 프로필 및 해시태그 자동 생성
POST /api/search/- 자연어/필터 기반 패널 검색POST /api/search/search-result/{search_id}/refine- 검색 결과 필터 추가GET /api/search/search-result/{search_id}/info- 검색 결과 상세 조회
POST /api/quick-search/recommendations- 업종 기반 패널 추천POST /api/quick-search/recommendations/by-member- 회원 검색 이력 기반 추천
POST /api/cohort-comparison/compare- 두 코호트 비교 분석GET /api/cohort-comparison/metrics- 비교 가능한 메트릭 목록
서버 실행 후 아래 URL에서 확인:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
이 레포지토리는 ai/ 폴더를 Git 서브모듈로 관리합니다. AI 핵심 로직은 별도 레포지토리(ai)에서 개발되며, 이 레포는 Docker 컨테이너로 패키징하고 배포하기 위한 래퍼 역할을 합니다.
git submodule init
git submodule update# 서브모듈 최신화
git submodule update --remote
# 변경사항 커밋
git add ai
git commit -m "chore: AI 서브모듈 업데이트"
git pushgit clone --recurse-submodules https://github.com/SW-DiffLens/be-sub.git이 프로젝트는 한성대학교 기업연계 SW캡스톤디자인 수업에서 진행되었습니다.




