Commit Graph

21 Commits

Author SHA1 Message Date
lasta
47a710a8b9 Fix datetime deprecation warnings in Phase 8 modules
- Update all datetime.utcnow() to datetime.now(UTC) for Python 3.12+ compatibility
- Update all datetime.utcfromtimestamp() to datetime.fromtimestamp(..., UTC)
- Fix dataclass default_factory to use lambda: datetime.now(UTC)
- Update auth, audit, billing, and realtime modules
- Add UTC import from datetime module
- Update pytest configuration to include pytest-asyncio
- All 28 Phase 8 enterprise tests pass with no warnings

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-14 11:50:23 +09:00
lasta
34e0df939f 온톨로지 시스템 구축 플랫폼 최종 정리 및 한글 가이드 2026-05-14 11:35:55 +09:00
lasta
939b65f0b7 온톨로지 시스템 구축 플랫폼 종합 가이드 (Phase 0-6 정리) 2026-05-14 11:35:18 +09:00
lasta
93533691fd Phase 6 구현 완료: REST API + GraphQL + RAG 파이프라인
[REST API]
- 10개 그래프 작업 엔드포인트
  * /graph/resolve (Entity 중복 해결)
  * /graph/subgraph/* (부분 그래프 추출)
  * /graph/patterns/* (경로/순환/모티프)
  * /graph/analytics/* (중심성/커뮤니티/통계)
  * /rag/context-extraction (RAG 컨텍스트)
  * /rag/query (RAG 쿼리)

[GraphQL]
- 유연한 쿼리 지원
- Entity 조회
- Aggregate 쿼리 (communities, stats)

[RAG 파이프라인]
- 벡터 검색 → 컨텍스트 추출 → LLM 프롬프트 생성
- LLM 통합 준비 (프롬프트 형식 표준화)
- 자동 문서화 (Swagger/OpenAPI)

[테스트]
- test_phase6_api.py (7/7 통과)
- API 응답 구조 검증
- RAG 워크플로우 검증
- 에러 처리 검증

[문서]
- PHASE_6_API_GUIDE.md (완전 레퍼런스)
- 예제 코드 (Python, cURL)
- 배포 가이드 (Docker, Kubernetes)

다음: Phase 7 - LLM 엔드투엔드 통합

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-14 11:29:41 +09:00
lasta
07a3f3cd41 Phase 5 완료 보고서: GraphRAG 구현 종합 정리 2026-05-14 11:20:22 +09:00
lasta
4d7feb125d Phase 5.2 구현 완료: GraphAnalytics (중심성 + 커뮤니티)
[GraphAnalytics]
- calculate_centrality(type): degree, pagerank, betweenness, closeness
- detect_communities(algorithm): Louvain, label propagation
- get_graph_statistics(): density, diameter, connectivity
- find_influential_entities(): 복합 점수 기반 중요도 분석
- Community 데이터 클래스

[특징]
- 정규화된 점수 (0-1 범위)
- 순위 지정 (1, 2, 3, ...)
- GDS 라이브러리 지원 (폴백 포함)
- 성능 최적화된 Cypher 쿼리

[테스트]
- test_phase5_graph_analytics.py (8 테스트 통과)
- 모든 통합 테스트 통과

Phase 5.0-5.2 완성!
다음: API 엔드포인트 통합

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-14 11:19:43 +09:00
lasta
ff132e7e00 Phase 5.1 구현 완료: SubgraphRetriever + PatternMatcher
[SubgraphRetriever]
- retrieve_neighborhood(entity_id, hops): N-hop 이웃 추출
- retrieve_context(entity_ids): 다중 엔티티 공통 경로 검색
- retrieve_induced_subgraph(entity_ids): 유도 부분 그래프 생성
- Cypher 최적화로 2-hop 쿼리 < 200ms

[PatternMatcher]
- find_paths(start, end, max_length): 경로 탐색 (깊이 우선)
- find_cycles(min_length): 순환 의존성 감지
- find_strongly_connected_components(): SCC 분석
- find_motifs(type): 삼각형/체인/별 모티프 검출
- analyze_entity_connectivity(entity_id): 연결 메트릭

[테스트]
- test_phase5_subgraph_retriever.py (6 테스트 통과)
- test_phase5_pattern_matcher.py (10 테스트 통과)
- test_phase5_integration_graphrag.py (6 통합 테스트 통과)

Phase 5.2 (Graph Analytics) 준비 완료

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-14 11:17:51 +09:00
lasta
a13216d50d Phase 5.0 구현 완료: Neo4j 배치 처리, RDF 변환, Entity Resolver 2026-05-14 11:12:45 +09:00
lasta
80d0ee4c5c README 업데이트: Phase 0-4 빠른 시작 가이드 2026-05-14 10:37:48 +09:00
lasta
dd4a89e6ce 종합 구현 보고서: Phase 0-4 완료 정리 2026-05-14 10:36:18 +09:00
lasta
7ea8df65d8 Phase 4 구현 완료: Neo4j 벡터 검색 + 그래프 저장소 2026-05-14 10:35:31 +09:00
lasta
ec4f9a64f6 Phase 0.7 — Acceptance Gate 자동화 + LM Studio 통합 + OntoCast 버그 수정
- platform/ → ont_platform/ rename
  Python 내장 platform 모듈과 이름 충돌. numpy/scipy가 platform.machine() 호출 시
  우리 패키지를 가져와 AttributeError. ont_platform으로 변경하고 pyproject.toml,
  ont_platform/**, tests/** import 경로 모두 업데이트.

- ont_platform/config.py: lenient LLM builder 추가
  LM Studio/vLLM 등 OpenAI-호환 로컬 서버가 임의 모델 식별자(예: deepseek-r1-distill-
  qwen-7b)를 쓸 수 있도록 OntoCast의 OpenAIModel enum validation을 Pydantic
  model_construct로 우회. ToolConfig() 생성 시 충돌을 막기 위해 LLM_MODEL_NAME을
  잠시 비웠다가 lenient 인스턴스로 교체.

- ont_platform/api/deps.py: ToolBox 초기화를 asyncio.to_thread로 격리
  LLMTool.create()가 내부에서 asyncio.run()을 부르는데 lifespan/테스트가 이미
  async 컨텍스트라 이중 loop 충돌. 별도 스레드에서 sync 생성자 실행.

- 테스트 인프라 정비
  * tests/integration/test_api_smoke.py: TestClient 구버전 starlette 호환을 위해
    lifespan='off' 대신 app.router.lifespan_context = noop 패턴 적용.
  * tests/unit/test_convert_document.py, test_select_ontology.py: ontocast.agent
    __init__.py가 re-export한 함수가 서브모듈을 가리는 문제로 sys.modules에서
    실제 모듈 객체 직접 추출.
  * tests/e2e/conftest.py: .env 자동 로드 + provider별 skip 조건 (Ollama는
    LLM_API_KEY 불필요).
  * tests/e2e/test_phase0_full_pipeline.py: provider별 키 분기,
    HDBSCAN 클러스터링이 동작하도록 fixture 페이로드 16문장으로 확장.

- vendored OntoCast 버그 수정 3건 (VENDORED_MODIFICATIONS.md 기록):
  * agent/render_ontology.py: render_ontology_fresh()의 .format() 호출에 누락된
    ontology_prefix 인자 추가 (Bootstrap 단계에서 KeyError: 'ontology_prefix').
  * stategraph/node_factories.py: render_ontology/render_facts 노드의
    state.model_copy(deep=True)로 budget_tracker가 deep-copy되어 root state의
    BudgetTracker가 영원히 0인 채로 남던 버그 수정. 원본 인스턴스 공유로 변경.

- 문서 갱신
  README.md (Phase 0.7 부분완료 + ont_platform 폴더 이름),
  docs/phases/PHASE0_ACCEPTANCE_GATE.md (검증 이력 + Ollama/LM Studio 옵션),
  .env.example (LM Studio/Ollama/OpenAI 세 옵션 명시).

검증
- unit + integration 26/26 통과.
- e2e (LM Studio + Qwen3-8B / DeepSeek-R1-Distill-Qwen-7B): 워크플로우 끝까지
  실행 + 5번 LLM 호출 + LangGraph 전 노드 traceable 확인. 7-8B 로컬 모델은
  strict structured output(Turtle RDF in JSON) 한계로 ontology/facts TTL 자동
  생성 부분 성공. 클라우드 LLM 환경에서 재검증 필요.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-14 09:05:24 +09:00
LASTA_DEV01\lasta
9e88f4c7ad ontology 2026-05-13 19:57:34 +09:00
LASTA_DEV01\lasta
2e9204243d 참고소스 수정본 2026-05-12 19:40:31 +09:00
lasta
0f34a451fc test 2026-05-11 22:55:01 +09:00
LASTA_DEV01\lasta
3663734781 [버그수정] 2026-05-11 13:02:11 +09:00
LASTA_DEV01\lasta
5935c6cbe8 1 2026-05-08 17:45:28 +09:00
LASTA_DEV01\lasta
a4efec3ccf 1 2026-05-08 17:44:27 +09:00
LASTA_DEV01\lasta
7656de0cc4 [버그 수정] 2026-05-08 17:44:11 +09:00
LASTA_DEV01\lasta
0b5fb43e2c [db] 2026-05-08 17:42:36 +09:00
LASTA_DEV01\lasta
4158789869 [crawler] 2026-05-08 17:41:15 +09:00