Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e488a0a
docs: 배포 방식 업데이트
ChoiSeungWoo98 Jul 4, 2025
20a534f
Merge remote-tracking branch 'origin/feature/initalize' into develop
ChoiSeungWoo98 Jul 4, 2025
fc63d44
feat: 포트 동적 할당 후 문구를 출력해 일렉트론에서 받아서 사용하도록 수정
ChoiSeungWoo98 Jul 4, 2025
d817f11
docs: 포트 동적 할당으로 변경에 따른 리드미 수정
ChoiSeungWoo98 Jul 4, 2025
edbcf12
Merge remote-tracking branch 'origin/feature/initalize' into develop
ChoiSeungWoo98 Jul 5, 2025
692992e
chore: 환경변수 및 테스트 파일 추가
hyeong8465 Jul 10, 2025
6fc4b91
feat: DB 연결
hyeong8465 Jul 10, 2025
8074a5e
chore: __pycache__ 추가
hyeong8465 Jul 10, 2025
a3700c1
feat: 기본 LLM 객체 생성
hyeong8465 Jul 10, 2025
8113c07
feat: api 인풋 아웃풋 형식 지정
hyeong8465 Jul 10, 2025
7256c89
feature: sql chatbot workflow 지정
hyeong8465 Jul 10, 2025
7dcacee
feat: sql parser 추가
hyeong8465 Jul 11, 2025
5436585
feat: chatbot api
hyeong8465 Jul 11, 2025
d43d3b1
feat: chatbot 메인 서비스 로직
hyeong8465 Jul 11, 2025
28decdd
chore: 의존성 파일 업데이트(langgraph)
hyeong8465 Jul 11, 2025
9c6a00e
chore: __init__ 파일 추가
hyeong8465 Jul 12, 2025
cc162a1
feat: fastapi 서버 실행, 헬스체크
hyeong8465 Jul 12, 2025
343b390
Merge pull request #4 from Queryus/feature/agent2
wwjin-j Jul 12, 2025
abd318e
chore: mysql 드라이버 변경
hyeong8465 Jul 13, 2025
17045c3
chore: import 경로 변경(scr제거)
hyeong8465 Jul 13, 2025
f529870
Merge pull request #5 from Queryus/hotfix/ci
hyeong8465 Jul 13, 2025
4db3a7f
feat: pr 알림 봇 생성
ChoiSeungWoo98 Jul 18, 2025
31cfdec
feat: 디스코드 배포 알림 봇 추가
ChoiSeungWoo98 Jul 18, 2025
aa8b0d7
style: 노출 멘트 수정
ChoiSeungWoo98 Jul 18, 2025
b06e08f
Merge pull request #6 from Queryus/feature/bot
ChoiSeungWoo98 Jul 18, 2025
1935f55
docs: clone 주소 수정
ChoiSeungWoo98 Jul 18, 2025
0ae6d61
Merge pull request #8 from Queryus/feature/initalize
ChoiSeungWoo98 Jul 18, 2025
8b21f63
chore: pyinstaller -> nuitka 로 빌드 변경
ChoiSeungWoo98 Jul 19, 2025
cb5e693
chore: pyinstaller -> nuitka 로 빌드 변경
ChoiSeungWoo98 Jul 19, 2025
39cedec
style: 빌드 방법 재 작성 및 헬스체크 문구 수정
ChoiSeungWoo98 Jul 19, 2025
cf9e6c7
refactor: 빌드 수정
ChoiSeungWoo98 Jul 19, 2025
7de429c
Merge branch 'develop' into feature/pipeline
ChoiSeungWoo98 Jul 19, 2025
8af20d0
Merge pull request #9 from Queryus/feature/pipeline
ChoiSeungWoo98 Jul 19, 2025
e564211
refactor: Nuitka를 사용하던 빌드 pyinstaller로 원복 - 빌드 시간 증가로 인한 원복
ChoiSeungWoo98 Jul 23, 2025
6c44a74
Merge pull request #10 from Queryus/feature/bot
ChoiSeungWoo98 Jul 24, 2025
a434020
refactor: qgenie-ai 폴더 생기던 문제 해결
ChoiSeungWoo98 Jul 24, 2025
67b4ee5
style: app 쪽 커밋 메시지 영어로 수정
ChoiSeungWoo98 Jul 24, 2025
1c53449
feat: Skip deployment jobs on manual trigger
ChoiSeungWoo98 Jul 25, 2025
d63a0b5
chore: 랭체인 워크플로우 이미지 결과물 추가
hyeong8465 Jul 26, 2025
e6842fc
feat: 피드백 루프 최대 3회 제한
hyeong8465 Jul 26, 2025
a365cb9
Merge pull request #11 from Queryus/feature/pipeline
hyeong8465 Jul 26, 2025
2130343
Merge pull request #12 from Queryus/feature/loop
hyeong8465 Aug 1, 2025
8eb1b1d
docs: 프롬프트 파일 분리
hyeong8465 Aug 2, 2025
9ef70fd
feat: pyinstaller 빌드 지원 및 최종 답변 생성
hyeong8465 Aug 2, 2025
abeaee7
Merge pull request #13 from Queryus/feature/response
hyeong8465 Aug 5, 2025
216b7ae
chore: cryptography 추가
hyeong8465 Aug 5, 2025
ae1609b
feat: 의도 분류 노드 추가
hyeong8465 Aug 5, 2025
1fe69ba
docs: 의도 분류 프롬프트 추가
hyeong8465 Aug 5, 2025
1f57e9b
Merge pull request #14 from Queryus/feature/intent-classifier
hyeong8465 Aug 7, 2025
3015c56
feat: db 분류 노드 추가
hyeong8465 Aug 10, 2025
b9b4238
docs: db 분류 프롬프트 추가
hyeong8465 Aug 10, 2025
c893d58
Merge pull request #15 from Queryus/feature/db-classifier
hyeong8465 Aug 10, 2025
b5dcda1
refactor: 파일명 수정 및 파일 위치 수정
hyeong8465 Aug 13, 2025
f9c9acf
feat: annotator 데이터 타입 설정
hyeong8465 Aug 13, 2025
717babf
feat: annotator 구현
hyeong8465 Aug 13, 2025
eb9603e
feat: annotation endpoint 구현
hyeong8465 Aug 13, 2025
da93cd3
Merge pull request #16 from Queryus/feature/annotation
hyeong8465 Aug 13, 2025
06ef139
docs: 프롬프트에 채팅 내역 추가
hyeong8465 Aug 13, 2025
3a80f61
feat: 챗봇 멀티턴 구현
hyeong8465 Aug 13, 2025
08db868
Merge pull request #17 from Queryus/feature/multi-turn
hyeong8465 Aug 13, 2025
ff6e437
fix: 포트번호 고정
hyeong8465 Aug 16, 2025
da56f3d
refator: sql_agent 코드 스플릿
hyeong8465 Aug 17, 2025
52e90fb
refactor: 엔드 포인트 및 라우터
hyeong8465 Aug 17, 2025
ba4a953
refactor: init 파일 추가
hyeong8465 Aug 17, 2025
73082ae
feat: api 요청을 위한 클라이언트
hyeong8465 Aug 17, 2025
8b2c622
refactor: llm 연결 수정
hyeong8465 Aug 17, 2025
da39b4f
refactor: db_manager 삭제
hyeong8465 Aug 17, 2025
ed0c73b
refactor: 헬스체크 수정
hyeong8465 Aug 17, 2025
85cc1d1
refactor: 데이터 모델
hyeong8465 Aug 17, 2025
08c533a
refactor: 어노테이션 서비스
hyeong8465 Aug 17, 2025
c435bbd
refactor: 챗봇 서비스
hyeong8465 Aug 17, 2025
94be712
refactor: database 서비스
hyeong8465 Aug 17, 2025
74ca365
refactor: 고정포트 및 로그 추가
hyeong8465 Aug 17, 2025
70a2dd1
refactor: 쿼리 실행 요청 및 응답 모델 수정
hyeong8465 Aug 17, 2025
fcb8fe6
refactor: API 키 호출 로직 수정 및 예외 처리 개선
hyeong8465 Aug 17, 2025
d112991
test: 테스트 코드 추가
hyeong8465 Aug 17, 2025
065a39a
feat: 그래프 시각화 저장 기능 추가
hyeong8465 Aug 17, 2025
a63cf2a
refactor: API 키 및 데이터베이스 호출 로직 개선, 폴백 처리 추가
hyeong8465 Aug 17, 2025
e8f4d97
feat: 의도 분류 기능 개선 및 채팅 내역 활용 추가
hyeong8465 Aug 17, 2025
843e86a
chore: 기존 헬스 체크 모듈 삭제
hyeong8465 Aug 17, 2025
5d04e63
refactor: 에러 처리 방식 개선 - 예외를 라우터에서 처리하도록 변경
hyeong8465 Aug 18, 2025
92d1da9
refactor: 그래프 실행 중 에러 처리 방식을 개선하여 예외를 상위 레벨로 전달
hyeong8465 Aug 18, 2025
fc6877b
feat: 쿼리 실행 API 연결
hyeong8465 Aug 18, 2025
954373b
refactor: SQL 쿼리 실행 중 에러 처리 개선 및 폴백 로직 제거
hyeong8465 Aug 18, 2025
cd5c4d2
refactor: 채팅 메시지 역할 수정
hyeong8465 Aug 18, 2025
f760f50
feat: api key 전달 API 연결
hyeong8465 Aug 18, 2025
7b11ce1
refactor: 어노테이션 모델 클래스 구조 변경
hyeong8465 Aug 18, 2025
cf290e0
test: 테스트 파일 수정
hyeong8465 Aug 18, 2025
2eb6d53
fix: API 키 조회 경로 수정 및 복호화된 데이터 처리 로직 개선
hyeong8465 Aug 18, 2025
c61c13b
feat: End-to-End 채팅 및 어노테이션 기능 테스트 추가, 에러 시나리오 테스트 구현
hyeong8465 Aug 18, 2025
ab8a2d0
Merge pull request #18 from Queryus/refactor/api
hyeong8465 Aug 18, 2025
620d3a4
fix: API 경로 수정
hyeong8465 Aug 19, 2025
1bf5323
chore: requirements.txt에 cffi, cryptography, pycparser 패키지 추가
hyeong8465 Aug 19, 2025
a8f4faa
feat: DB 어노테이션 API 테스트 추가 및 어노테이션 생성 로직 수정
hyeong8465 Aug 19, 2025
4a71262
feat: 백엔드 서버 연결 체크 및 LLM 지연 초기화 로직 추가
hyeong8465 Aug 19, 2025
e0958eb
feat: DBMS 프로필 및 어노테이션 조회 로직 추가, 데이터베이스 선택 및 스키마 처리 개선
hyeong8465 Aug 19, 2025
af899b5
Update README.md
hyeong8465 Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 84 additions & 9 deletions .github/workflows/deploy_executables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,27 @@ name: Build and Deploy Executables # 워크플로우의 전체 이름
on:
release:
types: [published]
workflow_dispatch:

jobs:
# ==================================
# 1. 파이프라인 시작 알림
# ==================================
start:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Send Pipeline Start Notification
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "AI 배포 봇",
"embeds": [{
"description": "**${{ github.ref_name }}** AI 배포를 시작합니다.",
"color": 2243312
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
# 1단계: 각 OS에서 실행 파일을 빌드하는 잡
build:
strategy:
Expand Down Expand Up @@ -44,32 +63,35 @@ jobs:
shell: bash
run: |
if [ "${{ runner.os }}" == "macOS" ]; then
echo "EXE_NAME=askql-ai" >> $GITHUB_ENV
echo "EXE_NAME=qgenie-ai" >> $GITHUB_ENV
elif [ "${{ runner.os }}" == "Windows" ]; then
echo "EXE_NAME=askql-ai.exe" >> $GITHUB_ENV
echo "EXE_NAME=qgenie-ai.exe" >> $GITHUB_ENV
fi

# 6. PyInstaller를 사용해 파이썬 코드를 실행 파일로 만듭니다.
- name: Build executable with PyInstaller
run: pyinstaller src/main.py --name ${{ env.EXE_NAME }} --onefile --noconsole
run: pyinstaller --clean --onefile --name ${{ env.EXE_NAME }} src/main.py

# 7. 빌드된 실행 파일을 다음 단계(deploy)에서 사용할 수 있도록 아티팩트로 업로드합니다.
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: executable-${{ runner.os }}
path: dist/${{ env.EXE_NAME }}
retention-days: 1

# 2단계: 빌드된 실행 파일들을 Front 레포지토리에 배포하는 잡
deploy:
# build 잡이 성공해야 실행됨
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
# 1. 배포 대상인 Front 리포지토리의 코드를 가져옵니다.
- name: Checkout Front Repository
- name: Checkout App Repository
uses: actions/checkout@v4
with:
repository: AskQL/Front
repository: Queryus/QGenie_app
token: ${{ secrets.PAT_FOR_FRONT_REPO }}
# 배포할 브랜치를 develop으로 변경
ref: develop
Expand All @@ -78,15 +100,14 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
# artifacts 폴더에 모든 아티팩트를 다운로드
path: artifacts

# 3. 다운로드한 실행 파일들을 정해진 폴더(resources/mac, resources/win)로 이동시킵니다.
- name: Organize files
run: |
mkdir -p resources/mac resources/win
mv artifacts/executable-macOS/askql-ai resources/mac/
mv artifacts/executable-Windows/askql-ai.exe resources/win/
mv artifacts/executable-macOS/qgenie-ai resources/mac/
mv artifacts/executable-Windows/qgenie-ai.exe resources/win/

# 4. 변경된 파일들을 Front 리포지토리에 커밋하고 푸시합니다.
- name: Commit and push changes
Expand All @@ -98,6 +119,60 @@ jobs:
if git diff-index --quiet HEAD; then
echo "No changes to commit."
else
git commit -m "feat: AI 실행 파일 업데이트 (${{ github.ref_name }})"
git commit -m "feat: Update AI executable (${{ github.ref_name }})"
git push
fi

# ==================================
# 파이프라인 최종 결과 알림
# ==================================
finish:
needs: deploy
runs-on: ubuntu-latest
if: always() && github.event_name == 'release'

steps:
- name: Send Success Notification
if: needs.deploy.result == 'success'
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "AI 배포 봇",
"embeds": [{
"title": "New AI Release: ${{ github.ref_name }}",
"url": "${{ github.event.release.html_url }}",
"description": "**${{ github.ref_name }}** AI 배포가 성공적으로 완료되었습니다!",
"color": 5167473
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Send Failure Notification
if: contains(needs.*.result, 'failure')
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "AI 배포 봇",
"embeds": [{
"title": "AI 배포 실패",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "**${{ github.ref_name }}** AI 배포 중 오류가 발생했습니다.",
"color": 15219495
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Send Skipped or Cancelled Notification
if: contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "AI 배포 봇",
"embeds": [{
"title": "AI 배포 미완료",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "**${{ github.ref_name }}** AI 배포가 완료되지 않았습니다. (상태: 취소 또는 건너뜀)\n이전 단계에서 문제가 발생했을 수 있습니다.",
"color": 16577629
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
86 changes: 86 additions & 0 deletions .github/workflows/pr_bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# .github/workflows/pr_bot.yml
name: Pull Request Bot

on:
# Pull Request 관련 이벤트 발생 시
pull_request:
types: [opened, closed, reopened, synchronize]
issue_comment:
types: [created]

jobs:
notify:
runs-on: ubuntu-latest
steps:
# -------------------------
# 생성/동기화 알림
# -------------------------
- name: Send PR Created Notification
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize')
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "GitHub PR 봇",
"embeds": [{
"title": "Pull Request #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}",
"description": "**${{ github.actor }}**님이 Pull Request를 생성하거나 업데이트했습니다.",
"url": "${{ github.event.pull_request.html_url }}",
"color": 2243312
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

# -------------------------
# 댓글 알림
# -------------------------
- name: Send PR Comment Notification
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
run: |
COMMENT_BODY=$(echo "${{ github.event.comment.body }}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
curl -X POST -H "Content-Type: application/json" \
-d "{
\"username\": \"GitHub 댓글 봇\",
\"embeds\": [{
\"title\": \"New Comment on PR #${{ github.event.issue.number }}\",
\"description\": \"**${{ github.actor }}**님의 새 댓글: \\n${COMMENT_BODY}\",
\"url\": \"${{ github.event.comment.html_url }}\",
\"color\": 15105570
}]
}" \
${{ secrets.DISCORD_WEBHOOK_URL }}

# -------------------------
# 머지(Merge) 알림
# -------------------------
- name: Send PR Merged Notification
if: github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "GitHub Merge 봇",
"embeds": [{
"title": "Pull Request #${{ github.event.pull_request.number }} Merged!",
"description": "**${{ github.actor }}**님이 **${{ github.event.pull_request.title }}** PR을 머지했습니다.",
"url": "${{ github.event.pull_request.html_url }}",
"color": 5167473
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

# -------------------------
# 닫힘(Close) 알림
# -------------------------
- name: Send PR Closed Notification
if: github.event.action == 'closed' && github.event.pull_request.merged == false
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "GitHub PR 봇",
"embeds": [{
"title": "Pull Request #${{ github.event.pull_request.number }} Closed",
"description": "**${{ github.actor }}**님이 **${{ github.event.pull_request.title }}** PR을 닫았습니다.",
"url": "${{ github.event.pull_request.html_url }}",
"color": 15219495
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# 2. 가상환경 파일
*venv*
.env

# 3. 빌드 결과물 (Build output)
*.spec
Expand All @@ -11,4 +12,7 @@ dist

# 4. 기타
.vscode
.idea
.idea
test.ipynb
__pycache__
workflow_graph.png
44 changes: 19 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AI 모델 프로젝트

이 프로젝트는 ...을 위한 AI 모델을 개발합니다.
이 프로젝트는 DB 어노테이션과 SQL 챗봇을 위한 AI 서버를 개발합니다.

---

Expand All @@ -12,16 +12,19 @@

1. **저장소 복제**
```bash
git clone https://github.com/AskQL/AI.git
git clone https://github.com/Queryus/QGenie_ai.git
```

2. **가상 환경 생성 및 활성화**
```bash
# 가상 환경 생성 (최초 한 번)
python3 -m venv .venv

# 가상 환경 활성화
# 가상 환경 활성화 (macOS/Linux)
source .venv/bin/activate

# 가상 환경 활성화 (Windows)
.venv\Scripts\activate
```

3. **라이브러리 설치**
Expand All @@ -36,10 +39,7 @@
rm -rf build dist

# 실행 파일 빌드
pyinstaller src/main.py --name ai --onefile --noconsole

# 실행 파일 실행
./dist/ai
pyinstaller --clean --onefile --add-data "src/prompts:prompts" --name ai src/main.py
```

---
Expand All @@ -59,21 +59,17 @@ GitHub에서 새로운 태그를 발행하면 파이프라인이 자동으로

~~~markdown
1. 모든 기능 개발과 테스트가 완료된 코드를 main 브랜치에 병합(Merge)합니다.
2. AskQL/AI 저장소의 Releases 탭으로 이동하여 Draft a new release 버튼을 클릭합니다.
3. Choose a tag 항목에서 v1.0.0과 같이 새로운 버전 태그를 입력하고 생성합니다.
4. (가장 중요 ⭐) Target 드롭다운 메뉴에서 반드시 main 브랜치를 선택합니다.
5. 릴리즈 노트를 작성하고 Publish release 버튼을 클릭합니다.
6. Target 드롭다운 메뉴에서 반드시 main 브랜치를 선택합니다.
7. 릴리즈 노트를 작성하고 Publish release 버튼을 클릭합니다.
2. 레포지토리에서 Releases 탭으로 이동하여 Create a new release 버튼을 클릭합니다.
3. Choose a tag 항목을 클릭한후 Find or create a new tag 부분에 버전(v1.0.0)과 같이 새로운 버전 태그를 입력하고 아래 Create new tag를 클릭하여 태그를 생성합니다.
4. ⭐중요) Target 드롭다운 메뉴에서 반드시 main 브랜치를 선택합니다.
5. 제목에 버전을 입력하고 릴리즈 노트를 작성합니다
6. 🚨주의) Publish release 버튼을 클릭합니다.
릴리즈 발행은 되돌릴 수 없습니다.
잘못된 릴리즈는 서비스에 직접적인 영향을 줄 수 있으니, 반드시 팀의 승인을 받고 신중하게 진행해 주십시오.
7. Actions 탭에 들어가 파이프라인을 확인 후 정상 배포되었다면 App 레포에 develop 브랜치에서 실행 파일을 확인합니다.
8. 만약 실패하였다면 인프라 담당자에게 말해주세요.
~~~

버튼을 클릭하는 즉시, 아래의 경고 사항에 설명된 자동 배포 프로세스가 시작됩니다.

🛑 경고: 릴리즈 발행은 되돌릴 수 없습니다
GitHub에서 새로운 릴리즈를 발행하면, 자동으로 프로덕션 배포가 시작됩니다.

이 과정은 중간에 멈출 수 없으며, main 브랜치의 현재 상태가 즉시 Front 리포지토리의 develop 브랜치에 반영됩니다.
잘못된 릴리즈는 서비스에 직접적인 영향을 줄 수 있으니, 반드시 팀의 승인을 받고 신중하게 진행해 주십시오.

---

Expand All @@ -82,11 +78,9 @@ GitHub에서 새로운 릴리즈를 발행하면, 자동으로 프로덕션 배
이 레포지토리에는 간단한 헬스체크 서버가 포함되어 있습니다. 아래 명령어로 실행 파일을 빌드하여 서버 상태를 확인할 수 있습니다.

```bash
# 실행 파일 빌드
pyinstaller src/main.py --name ai --onefile --noconsole

# 빌드된 파일 실행 (dist 폴더에 생성됨)
./dist/ai

curl http://localhost:33332/health
```
# 다른 터미널에서 헬스체크 요청
curl http://localhost:<할당된 포트>/api/v1/health
```
Loading
Loading