Merged
Conversation
Agent가 DB를 직접 탐색할 때 사용하는 4개 메서드 정의. list_tables / get_ddl / sample_data / execute_read_only. DDL에 이미 있는 정보는 별도 메서드 없음, 관계 추론은 LLM에 위임.
SQLite는 sqlite_master에서 원본 DDL 그대로 반환. 그 외 dialect는 CreateTable.compile()으로 FK/PK 포함 DDL 생성. execute_read_only는 prefix guard + rollback-always 이중 방어. from_engine() classmethod로 기존 SQLAlchemyDB engine 공유 가능.
DB URL 하나로 SQLAlchemyExplorer 생성하는 편의 함수. schema 파라미터로 특정 스키마 범위 지정 가능.
PEP 562 __getattr__ lazy import 적용. FAISSVectorStore, PGVectorStore, DataHubCatalogLoader를 lazy 전환해 baseline flow 실행 시 FAISS INFO 로그 출력 문제 함께 수정.
list_tables / get_ddl / sample_data / execute_read_only 전체 검증. write 거부(INSERT, DROP), from_engine 공유, SQLAlchemyDB 동시 사용 포함. SQLite in-memory DB 사용, 외부 의존 없음.
build_explorer_from_url 기본 사용, 전체 테이블 루프, PostgreSQL/MySQL 연결, from_engine 재사용, 쓰기 거부 예시 추가.
Add VectorRetriever.save() and VectorRetriever.load() for FAISS-backed file persistence. save() writes the vector index and a .registry JSON sidecar; load() restores both. InMemoryVectorStore raises NotImplementedError. Add 3 tests (save/load roundtrip, registry integrity, InMemory raises).
Accept vectorstore: VectorStorePort as a parameter instead of instantiating FAISSVectorStore internally. components/ no longer imports from integrations/. Store restoration is the caller's responsibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
📝 요약(Summary)
DBExplorerPortProtocol과SQLAlchemyExplorer구현체를추가했습니다.
build_explorer_from_url편의 함수로 URL 하나만으로 Explorer를 생성할 수 있으며, PEP 562 lazyimport로 기존 FAISS INFO 로그 출력 문제도 함께 수정했습니다.
VectorRetriever에save()/load()persistence를 추가해 FAISS 인덱스를 파일로 저장·복원할 수있습니다.
💬 To Reviewers (선택)
execute_read_only의 이중 방어 로직 (prefix guard + rollback-always) 이 충분한지 검토 부탁드립니다.sqlite_master에서 원본 DDL을 반환하고, 그 외 dialect는CreateTable.compile()로재구성합니다. dialect별 DDL 품질 차이가 있을 수 있어 확인 부탁드립니다.
PR Checklist
DBExplorerPort—list_tables/get_ddl/sample_data/execute_read_only4개 메서드Protocol 정의
SQLAlchemyExplorer구현 및from_engine()classmethod로 기존 engine 공유 지원build_explorer_from_urlfactory 함수 추가 (schema파라미터로 범위 지정 가능)__init__.pylazy import 전환 (PEP 562) — baseline flow FAISS INFO 로그 문제 수정 포함VectorRetriever.save()/load()FAISS persistence 추가 및 테스트 3케이스