mirror of
https://github.com/onestardao/WFGY.git
synced 2026-05-19 16:31:07 +00:00
| .. | ||
| pattern_bootstrap_deadlock.md | ||
| pattern_hallucination_reentry.md | ||
| pattern_memory_desync.md | ||
| pattern_query_parsing_split.md | ||
| pattern_rag_semantic_drift.md | ||
| pattern_symbolic_constraint_unlock.md | ||
| pattern_vectorstore_fragmentation.md | ||
| README.md | ||
Patterns — Failure Catalog (Problem Map 2.0)
This folder is a field guide to recurring failures in RAG and multi-stage LLM pipelines.
Each pattern is actionable: fast signals, root causes, a minimal repro, a deterministic fix, and links to hands-on examples (SDK-free, stdlib-only).
How to use this folder
- Start with the symptom you’re seeing.
- Open the matching pattern and run the Minimal Repro + Standard Fix.
- Wire the acceptance criteria into CI (see Example 08) so the fix stays fixed.
Quick Index
| Pattern | Problem Map No. | Symptoms you’ll see | Fix entrypoint |
|---|---|---|---|
RAG Semantic Drift (pattern_rag_semantic_drift.md) |
No.1 | Plausible but ungrounded answers; citations don’t contain the claim | Example 01 (guarded template), Example 03 (intersection + rerank) |
Memory Desync (pattern_memory_desync.md) |
— (State/Context) | Old names/IDs reappear; agents disagree across turns | Snapshot mem_rev/hash at ingress + echo + gate (Ex.04) |
Vector Store Fragmentation (pattern_vectorstore_fragmentation.md) |
No.3 | Recall flips across envs; score scales change; rank inversions | Manifest validation + normalize both sides + score correlation (Ex.05) |
Hallucination Re-Entry (pattern_hallucination_reentry.md) |
— (Provenance) | Model’s prior text shows up as “evidence”; non-corpus sources cited | Provenance filter + split indices + auditor rule (Ex.06) |
Bootstrap Deadlock (pattern_bootstrap_deadlock.md) |
No.14 | /readyz stuck/flapping; circular waits at startup |
DAG toposort + single warmup owner + sentinel-based readiness (Ex.07) |
Query Parsing Split (pattern_query_parsing_split.md) |
— (Parsing) | Multi-intent prompts answered partially or mixed | Deterministic split + per-role contracts + handoff gate (Ex.03/04) |
Symbolic Constraint Unlock (SCU) (pattern_symbolic_constraint_unlock.md) |
No.11 (Symbolic collapse) | “Must/Only/Never” rules vanish mid-pipeline; impossible states | Lock + echo constraints at every stage; contradiction gate (Ex.03/04/08) |
Legend: Problem Map numbers refer to root categories used across the repo. “—” means cross-cutting (not a single number).
Pick-a-Pattern in 30 Seconds (Triage Flow)
- Grounding first — Run Example 01 on a few failing questions.
- If refusal behavior or citations fail ⇒ go to Semantic Drift.
- Context/state sanity — Check
context_id/mem_rev/hash.- Mismatch ⇒ Memory Desync.
- Index parity — Validate
index_out/manifest.jsonvs runtime.- Drift or score scale shift ⇒ Vector Store Fragmentation.
- Provenance — Inspect
sourcefor cited ids.- Any
model|chat|tmp:⇒ Hallucination Re-Entry.
- Any
- Startup — If the first minute after deploy is flaky ⇒ Bootstrap Deadlock.
- Query shape — If the prompt mixes “compare… then draft…” ⇒ Query Parsing Split.
- Logic rules — If answers cross “must/only/never” boundaries ⇒ SCU.
Standard Acceptance Gates (copy to CI)
- Guarded Output: either exact refusal token
not in contextor JSON withclaim+citations:[id,…]scoped to retrieved ids. - Provenance: all citations pass the corpus-only filter (no
chat:/draft:/tmp:). - Context Consistency: if used,
context_id.mem_rev/hashechoes the turn snapshot. - Constraint Integrity (SCU):
constraints_echo≡ locked set; no contradiction patterns matched. - Quality Gates (Ex.08): precision≥0.80, under-refusal≤0.05, citation hit rate≥0.75.
File Layout
pattern_rag_semantic_drift.md— How to stop plausible-but-wrong answers with hard grounding.pattern_memory_desync.md— One snapshot per turn; bind and echo across agents.pattern_vectorstore_fragmentation.md— Keep embeddings/metrics/chunkers aligned.pattern_hallucination_reentry.md— Keep model/session text out of evidence.pattern_bootstrap_deadlock.md— Deterministic startup ordering and readiness.pattern_query_parsing_split.md— Deterministically split multi-intent prompts.pattern_symbolic_constraint_unlock.md— Lock+echo constraints; gate contradictions.
See ../examples/ for runnable, stdlib-only code referenced in each pattern.
Contributing (tight process)
- Propose a new pattern via issue labels:
pattern-proposal, with minimal repro + acceptance gate. - Stabilize with an example (Python or Node, stdlib-only).
- Add to this README only after approval.
- Guard with Example 08 metrics before shipping a pattern-driven fix.
🧭 Explore More
| Module | Description | Link |
|---|---|---|
| WFGY Core | Standalone semantic reasoning engine for any LLM | View → |
| Problem Map 1.0 | Initial 16-mode diagnostic and symbolic fix framework | View → |
| Problem Map 2.0 | RAG-focused failure tree, modular fixes, and pipelines | View → |
| Semantic Clinic Index | Expanded failure catalog: prompt injection, memory bugs, logic drift | View → |
| Semantic Blueprint | Layer-based symbolic reasoning & semantic modulations | View → |
| Benchmark vs GPT-5 | Stress test GPT-5 with full WFGY reasoning suite | View → |
👑 Early Stargazers: See the Hall of Fame —
Engineers, hackers, and open source builders who supported WFGY from day one.
⭐ Help reach 10,000 stars by 2025-09-01 to unlock Engine 2.0 for everyone ⭐ Star WFGY on GitHub