Prompt Details
Model
Chat - (gpt-6-luna)
Token size
806
Example input
[KNOWLEDGE_SOURCES_AND_TYPES]: ```text Company HR policies in PDF/DOCX, employee handbook, leave policy, reimbursement guidelines, and an internal HR FAQ SQL database.
[DOMAIN_STRUCTURE_AND_ENTITIES]: Hierarchical policy documents containing nested sections, tabular reimbursement limits, eligibility rules, conditional exceptions, and effective dates.
[USER_QUERIES_AND_OBJECTIVES]: Employees asking: "How many casual leaves can I carry forward?", "What is the meal allowance per diem for international travel?", needing exact citations and section references.
[CURRENT_ARCHITECTURE_FAILURES_CONSTRAINTS]: Naive vector search on un-chunked PDFs. Failures: answers reference superseded 2023 policies, tables hallucinated, citations missing, no role-based access filtering.
Example output
# ποΈ PRODUCTION ENTERPRISE RAG ARCHITECTURE BLUEPRINT
### PHASE 1: FORENSIC SOURCE AUDIT & INGESTION PIPELINE
* Source Classification:
- Authoritative: HR Policies (PDF/DOCX), Employee Handbook.
- Derived/Secondary: Internal HR FAQ Database.
- Restricted Authoritative: Personal Compensation & Employee Records.
* Ingestion Guardrail: Quarantine queue isolates malformed PDFs; layout-parser preserves heading hierarchies (H1->H3) and tabular cells (Expense Limit vs Condition).
### PHASE 2: STRUCTURE-AWARE CHUNKING & METADATA PROVENANCE
* Strategy: Hierarchical Parent-Child Chunking.
- Parent: Complete Policy Clause (Context Anchor).
- Child: Atomic Rule/Condition (Retrieval Unit).
* Metadata Schema:
`{"doc_id": "POL-LEAVE-2026", "version": "3.1", "effective_date": "2026-01-01", "role_access": ["all_employees"], "section": "Casual Leave > Eligibility"}`
### PHASE 3: HYBRID INDEXING & SECURE RETRIEVAL PIPELINE
* Dual Index: Qdrant Vector (OpenAI text-embedding-3-large) + BM25 Lexical Engine.
* Security Filter: Pre-retrieval filtering restricts search queries to chunks where `role_access` matches user JWT claim.
* Reranker: Cohere Rerank v3 filters top-25 hybrid candidates down to top-5 verified evidence passages.
### PHASE 4: AGENTIC REASONING & CONFLICT RESOLUTION
* Conflict Engine: If version mismatch is detected between Handbook and FAQ, the document with the latest `effective_date` and `Authoritative` tag explicitly invalidates secondary FAQ entries.
* Hallucination Gate: If no retrieved chunk matches user eligibility criteria with cosine similarity > 0.72, return: "The current HR policies do not establish this entitlement."
### PHASE 5: TARGET ARCHITECTURE & PYTHON SKELETON
User Query βββΊ [Auth Context Extractor]
β (user_id, role)
βΌ
[Pre-Filtered Hybrid Search]
ββββββββββββ΄βββββββββββ
βΌ βΌ
[BM25 Engine] [Vector DB (Qdrant)]
ββββββββββββ¬βββββββββββ
βΌ
[Cross-Encoder Reranker]
β (Top-5 chunks)
βΌ
[Grounding & Citation Validator] βββΊ Final Answer + Section Footnotes
```python
from pydantic import BaseModel, Field
from typing import List, Optional
class ChunkMetadata(BaseModel):
doc_id: str
version: str
effective_date: str
role_access: List[str]
section_ref: str
class GroundedCitation(BaseModel):
statement: str
source_doc: str
section: str
version: str
class RAGResponse(BaseModel):
answer: str
citations: List[GroundedCitation]
is_sufficient_evidence: bool
By purchasing this prompt, you agree to our terms of service
GPT-6-LUNA
Design, audit, and refactor production-grade RAG and Agentic Knowledge systems. Solves hallucination, stale document conflicts, ingestion failures, and ACL leaks. Delivers enterprise blueprints: structure-aware chunking, hybrid retrieval, metadata RBAC, and citation validation pipelines. Perfect for AI engineers and enterprise architects building high-accuracy RAG.
...more
Added 1 week ago
