Architecture at a glance구조 한눈에 보기
Ingest with provenance출처를 기록하며 수집
Parse documents and sections; retain origin, version and retrieval records.문서와 절을 파싱하고 원출처·버전·수집 기록을 보존합니다.
Plan and retrieve검색 범위를 정하고 조회
Apply reviewed source and section constraints to the retrieval request.검수된 출처·절 제약을 검색 요청에 적용합니다.
Check the evidence근거 적격성 검사
Check identity, approval and source eligibility; remove duplicate passages.식별 정보·승인 상태·출처 적격성을 검사하고 중복 구절을 제거합니다.
Compose within scope확인한 범위에서 답변
Return a source-linked explanation, clarification or handoff.출처가 연결된 설명, 추가 질문 또는 전문가 연결로 응답합니다.
1. The problem: a similar passage can still be wrong1. 문제: 비슷한 문장도 잘못된 근거일 수 있습니다
In LocalMate, I implemented document-grounded AI within an application that also handles user communication and administration. The retrieval problem extended beyond finding a paragraph with similar wording. Different documents can share section numbers, have different authority, or contain material that has not been reviewed for use.LocalMate에서는 사용자 소통과 운영 기능을 갖춘 서비스 안에 문서 기반 AI를 구현했습니다. 검색의 과제는 표현이 비슷한 문단을 찾는 데서 끝나지 않았습니다. 서로 다른 문서가 같은 절 번호를 쓰거나, 권위가 다르거나, 서비스에 사용하기 위한 검수를 아직 거치지 않았을 수 있기 때문입니다.
I connected ingestion, embeddings and vector retrieval with a structured evidence layer. Each answer needed a clear path back to an eligible source. When the required evidence was missing, the response needed to preserve that gap and offer a useful clarification or handoff.문서 수집·임베딩·벡터 검색에 구조화된 근거 계층을 연결했습니다. 각 답변은 사용할 수 있는 출처까지 추적 가능해야 했습니다. 필요한 근거가 없을 때는 그 빈자리를 유지하면서 도움이 되는 추가 질문이나 전문가 연결을 제공하도록 구성했습니다.
2. Four implementation decisions2. 구현에서 선택한 네 가지
I separated the ingestion contract from the runtime retrieval contract. Ingestion records document structure and provenance; retrieval decides which reviewed material is eligible for the current request. Semantic ranking operates within those constraints.문서 수집 계약과 실행 시 검색 계약을 분리했습니다. 수집 단계에서는 문서 구조와 출처 이력을 기록하고, 검색 단계에서는 검수된 자료 중 현재 요청에 사용할 수 있는 것을 결정합니다. 의미 기반 순위는 그 제약 안에서 적용됩니다.
- Separate the issuing authority, official publisher and actual retrieval provider. An API delivery channel does not determine who issued a document.문서를 발행한 주체, 공식 제공처, 실제 수집 제공자를 구분했습니다. API로 전달받았다는 사실만으로 문서의 발행 주체를 판단하지 않습니다.
- Keep document and section identifiers as exact pairs. This prevents a permitted section from being attached to the wrong permitted document.문서와 절 식별자를 정확한 쌍으로 유지했습니다. 허용된 절이 다른 허용 문서에 잘못 연결되는 것을 막기 위한 선택입니다.
- Check source and chunk approval, allowed origin, usage metadata and deleted provisions before accepting evidence. A ranker may reorder candidates but cannot introduce or rewrite them.근거를 채택하기 전에 출처·청크의 승인, 허용된 원출처, 사용 관련 메타데이터와 삭제된 조항 여부를 검사했습니다. 순위기는 후보 순서를 바꿀 수 있지만 후보를 추가하거나 내용을 고칠 수는 없습니다.
- Stage newly collected material with content hashes and review-required status. Discovery, ingestion and approval remain distinct steps.새로 수집한 자료는 내용 해시와 검수대기 상태로 적재했습니다. 자료의 발견, 수집, 승인은 각각 다른 단계로 유지했습니다.
3. A small identity example3. 출처 식별의 작은 예
Exact source and section constraints determine which passages may enter ranking. Similarity then orders the eligible candidates.문서와 절의 정확한 쌍 조건으로 순위 계산에 사용할 구절을 먼저 정합니다. 그다음 적격한 후보 사이에서 유사도에 따라 순서를 정합니다.
The document and section travel together문서와 절을 하나의 쌍으로 검사
An invented retrieval plan permits Document A §2 and Document B §7. Assume every candidate passes the other source checks. The table isolates the exact-pair check; it does not report a search result.가상의 검색 계획이 문서 A §2와 문서 B §7을 허용한다고 가정합니다. 모든 후보가 나머지 출처 검사는 통과한 상태에서, 정확한 쌍 검사만 살펴보는 예시입니다. 실제 검색 결과를 보고하는 표가 아닙니다.
Scroll the table sideways to read all columns.표를 좌우로 움직이면 모든 열을 볼 수 있습니다.
| Candidate passage후보 구절 | Pair check문서·절 쌍 검사 | Decision처리 |
|---|---|---|
| Document A §2문서 A §2 | The exact pair is permitted.이 쌍이 허용 목록에 있습니다. | Eligible for ranking.순위 계산에 사용할 수 있습니다. |
| Document B §7문서 B §7 | The exact pair is permitted.이 쌍이 허용 목록에 있습니다. | Eligible for ranking.순위 계산에 사용할 수 있습니다. |
| Document B §2문서 B §2 | The document and section each appear elsewhere, but this pair is absent.문서 B와 §2는 각각 등장하지만 이 조합은 없습니다. | Exclude, even if the wording is highly similar.문장 유사도가 높아도 제외합니다. |
| Document A §7문서 A §7 | The section belongs to the other permitted pair.§7은 다른 허용 쌍에 속합니다. | Exclude; do not recombine separate allowlists.제외합니다. 문서와 절 목록을 임의로 조합하지 않습니다. |
Similarity orders eligible evidence. It does not make a different source pair eligible.유사도는 사용할 수 있는 근거의 순서를 정합니다. 다른 출처 쌍을 사용할 자격을 만들지는 않습니다.
4. How I verify the boundaries4. 경계를 검증하는 방법
The implementation includes tests for source hierarchy, section identity, missing approval, deleted provisions and duplicate evidence. Adversarial ranker tests check whether a ranking step injects, duplicates or mutates candidates. Mode tests distinguish a shadow comparison that preserves the existing response from an active retrieval failure that returns no eligible evidence.구현에는 출처 계층, 절 식별, 승인 누락, 삭제된 조항, 근거 중복에 대한 검사가 포함되어 있습니다. 순위기 반례 검사에서는 순위 단계가 후보를 추가·복제·변경하는지 확인합니다. 모드 검사에서는 기존 응답을 유지하는 병행 비교와, 적격한 근거를 반환하지 않는 활성 검색 실패를 구분합니다.
I also keep answer-generation provenance separate from retrieval provenance. An accepted model response, a deterministic evidence fallback and an empty retrieval are different outcomes. A model name in a log does not establish which path produced the final text.답변 생성 이력도 검색 이력과 별도로 구분했습니다. 채택된 모델 응답, 결정론적 근거 기반 대체 응답, 검색 결과 없음은 서로 다른 결과입니다. 로그에 모델 이름이 있다는 사실만으로 최종 문장이 어떤 경로에서 나왔는지 판단할 수는 없습니다.
5. What this case study establishes5. 이 사례가 보여 주는 범위
The implementation makes source eligibility and answer provenance inspectable. Coverage depends on available, current and reviewed material, so each new domain needs suitable sources and policies. The contract tests check defined retrieval behavior. Assessing answer quality additionally requires reviewed questions and independently established expected evidence. Current production coverage and performance require a separate measurement.이 구현은 출처 적격성과 답변 생성 경로를 확인할 수 있도록 합니다. 지원 범위는 사용 가능한 최신 검수 자료에 달려 있으므로 새로운 도메인마다 적합한 출처와 정책이 필요합니다. 계약 검사는 정의된 검색 동작을 확인합니다. 답변 품질을 평가하려면 검수된 질문과 독립적으로 확정한 기대 근거가 추가로 필요합니다. 현재 운영의 지원 범위와 성능은 별도로 측정해야 합니다.