Skip to content

Pipeline Flow

Dev Doshi edited this page Jun 18, 2026 · 1 revision

Pipeline Flow

1. Input Guardrail

Purpose:

  • Prompt injection detection
  • Unsafe content detection
  • Malicious query filtering

Methods:

  • Pattern Matching
  • LLM Safety Validation

2. Query Classification

Determines whether a query belongs to the knowledge domain.

Output:

question_is_relevant: bool

3. Hybrid Retrieval

Combines:

  • Semantic Search (ChromaDB)
  • Keyword Search (BM25)

4. Reciprocal Rank Fusion (RRF)

Merges rankings from:

  • ChromaDB
  • BM25

Produces:

retrieved_docs

5. Context Guardrail

Checks context size.

Maximum:

max_context_tokens = 1000

Uses:

tiktoken

6. Generate Node

Model:

gpt-4o-mini

Retries:

3 attempts

Backoff:

Exponential

7. Output Guardrail

  • PII Redaction
  • Safety Validation

8. Confidence Scoring

Self-RAG style confidence estimation.

Range:

0.0 - 1.0

Clone this wiki locally