Skip to content

Commit 11e1379

Browse files
authored
Merge pull request #215 from CausalInferenceLab/docs/v2-migration
Docs/v2 migration
2 parents cc01853 + 8137ff0 commit 11e1379

5 files changed

Lines changed: 253 additions & 321 deletions

File tree

docs/BaseFlow_ko.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,58 @@ for e in hook.events:
129129

130130
---
131131

132+
## SequentialFlow의 알려진 제한
133+
134+
`SequentialFlow``value = step(value)` 단일 값 전달 방식으로 동작합니다.
135+
이 설계는 단순한 변환 체인에는 적합하지만, NL2SQL 파이프라인에서 다음 한계가 있습니다.
136+
137+
### 문제 1: 컨텍스트 소실
138+
139+
파이프라인이 진행되면서 초기 입력(`query`)이 중간 단계 출력으로 대체되어 사라집니다.
140+
141+
```python
142+
flow.run("주문 내역 확인")
143+
144+
retriever("주문 내역 확인") → list[CatalogEntry]
145+
146+
generator(list[CatalogEntry]) # ← 여기서 original query가 없음
147+
148+
TypeError 또는 잘못된 결과
149+
```
150+
151+
### 문제 2: 다중 인자 컴포넌트와 호환 불가
152+
153+
`SQLGenerator.run(query, schemas)`처럼 2개 이상의 인자를 받는 컴포넌트는
154+
`SequentialFlow`의 단일 값 전달로 연결할 수 없습니다.
155+
156+
```python
157+
# ❌ 동작하지 않음 — generator는 (query, schemas) 2개 인자가 필요
158+
flow = SequentialFlow(steps=[retriever, generator, executor])
159+
flow.run("주문 내역") # TypeError: run() missing 1 required positional argument: 'schemas'
160+
```
161+
162+
### 해결 방법
163+
164+
NL2SQL 파이프라인은 `SequentialFlow` 대신 **전용 Flow**를 사용하세요.
165+
전용 Flow는 내부에서 다중 인자 와이어링을 올바르게 처리합니다.
166+
167+
```python
168+
# ✅ KeywordRetriever 기반
169+
pipeline = BaselineNL2SQL(catalog=catalog, llm=llm, db=db)
170+
171+
# ✅ Keyword + Vector 기반
172+
pipeline = HybridNL2SQL(catalog=catalog, llm=llm, db=db, embedding=embedding)
173+
174+
# ✅ Gate + 프로파일링 + 보강 포함 풀 파이프라인
175+
pipeline = EnrichedNL2SQL(catalog=catalog, llm=llm, db=db, embedding=embedding)
176+
177+
rows = pipeline.run("주문 내역")
178+
```
179+
180+
`SequentialFlow`는 단일 값 변환 체인(예: 텍스트 전처리, 단계별 필터링)에 적합합니다.
181+
182+
---
183+
132184
## FAQ
133185

134186
### Q. BaseFlow가 필수인가?

docs/RunContext_ko.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)