AI 학습 세션의 대화 내용, 학습 노트, 요약 정보를 저장하고 관리하는 서비스입니다.
| 항목 | 값 |
|---|---|
| 포트 | 8002 |
| Base URL | /api/v1/notes |
| API 문서 | Swagger UI |
| 데이터베이스 | aklp_note |
{
"title": "Kubernetes Pod 기초 학습",
"content": "Pod는 Kubernetes에서 가장 작은 배포 단위입니다...",
"session_id": "550e8400-e29b-41d4-a716-446655440001"
}| 파라미터 | 타입 | 설명 |
|---|---|---|
page |
int | 페이지 번호 (기본: 1) |
session_id |
UUID | 세션별 필터링 |
{
"title": "수정된 제목",
"content": "수정된 내용"
}모든 노트는 session_id로 AI 세션과 연결됩니다. Agent는 세션 시작 시 UUID를 생성하고, 해당 세션의 모든 노트에 동일한 session_id를 사용해야 합니다.
import uuid
session_id = uuid.uuid4() # 세션 시작 시 생성사용자와의 대화가 끝나면 학습 내용을 요약하여 저장:
curl -X POST http://localhost:8002/api/v1/notes \
-H "Content-Type: application/json" \
-d '{
"title": "2025-12-06 Kubernetes 학습 요약",
"content": "## 오늘 배운 내용\n- Pod 생성 방법\n- kubectl 기본 명령어\n\n## 다음 학습 주제\n- Service와 네트워킹",
"session_id": "550e8400-e29b-41d4-a716-446655440001"
}'사용자가 실행한 kubectl 명령어와 결과 저장:
curl -X POST http://localhost:8002/api/v1/notes \
-H "Content-Type: application/json" \
-d '{
"title": "kubectl 명령어 실행 기록",
"content": "```bash\n$ kubectl get pods\nNAME READY STATUS RESTARTS AGE\nnginx-pod 1/1 Running 0 5m\n```",
"session_id": "550e8400-e29b-41d4-a716-446655440001"
}'특정 세션의 모든 노트 조회:
curl "http://localhost:8002/api/v1/notes?session_id=550e8400-e29b-41d4-a716-446655440001"기존 노트에 새로운 학습 내용 추가:
curl -X PUT http://localhost:8002/api/v1/notes/{note_id} \
-H "Content-Type: application/json" \
-d '{
"content": "## 추가 학습 내용\n- Deployment 롤링 업데이트\n- ReplicaSet 동작 원리"
}'| 타입 | 제목 예시 | 용도 |
|---|---|---|
| 세션 요약 | YYYY-MM-DD 학습 요약 |
세션 종료 시 자동 생성 |
| 명령어 기록 | kubectl 명령어 실행 기록 |
실행한 명령어 로깅 |
| 개념 정리 | Pod vs Deployment 차이점 |
학습한 개념 정리 |
| 트러블슈팅 | CrashLoopBackOff 해결 과정 |
문제 해결 과정 기록 |
| 실습 결과 | Service 생성 실습 |
실습 과제 결과 저장 |
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"session_id": "550e8400-e29b-41d4-a716-446655440001",
"title": "Kubernetes Pod 기초 학습",
"content": "Pod는 Kubernetes에서 가장 작은 배포 단위입니다...",
"created_at": "2025-12-06T10:00:00Z",
"updated_at": "2025-12-06T10:00:00Z"
}{
"items": [...],
"total": 25,
"page": 1,
"limit": 10,
"total_pages": 3,
"has_next": true,
"has_prev": false
}# 의존성 설치
uv sync --all-extras
# 개발 서버 실행
uv run uvicorn app.main:app --reload --port 8002
# 마이그레이션 실행
uv run alembic upgrade headMIT