Cognix

Critical Flaws in Phase 1 Architecture

Analysis of the critical flaws and limitations in the initial template-based system design (Design 1) for NEET question generation.

2026-02-14
architectureflawscritiquephase-1design-review

1. The "Template-Only" Fallacy & Wasted Content

The initial architecture (Design 1) heavily relied on extracting "templates" from past NEET questions and using Python mathematical mutators to generate new questions.

The Issues:

The Correction (Implemented in Design 2): Past papers must primarily be used as Few-Shot Examples in the system prompt to teach the AI the "NEET Style" (difficulty, trickiness of options, structure). The actual foundation of generation must be Knowledge Chunks—raw theory extracted from textbooks. The system should retrieve a concept chunk and invent a completely original question governed by the style of past papers.


2. The Missing Elephant: Images

Design 1 treated the problem as a purely text and math-based system, which is a massive oversight for an exam like NEET.

The Issues:

The Correction (Implemented in Design 2): Incorporation of an Object Store (like AWS S3/MinIO) and multimodal pipelines. Images are extracted, semantically captioned (via vision models), embedded, and stored alongside theory. Generation agents can now pull an image and ask the user to identify specific labels, matching the true NEET pattern.


3. Database Constraints (Pure SQL vs. Hybrid)

The Design 1 schema relied exclusively on a structured relational database (PostgreSQL) to map logic and templates deterministically.

The Issues:

The Correction (Implemented in Design 2): Adoption of a Hybrid Database. Using PostgreSQL enhanced with the pgvector extension allows the system to enforce strict relational hierarchies (Exam -> Subject -> Topic) via standard SQL, while simultaneously utilizing Vector Similarity Search to grab semantically rich chunks of theory based on the exact subject matter context required.


4. Validating the Agentic Swarm Approach

Design 1 relied on "deterministic Python mathematical mutators paired with the Gemini API."

The Issues:

The Solution: Given the infrastructure constraint that this generation runs as an offline, nightly batch job (taking 10-30 minutes), real-time API latency is a non-issue. This definitively validates the use of a Multi-Agent Swarm Protocol:

  1. Context Agent: Gathers strict theory and past paper stylistic examples.
  2. Generator Agent: Drafts the question and highly tricky distractors based on the context.
  3. Adversarial / Cross-Check Agent (Crucial): Blindly attempts to solve the generated question without seeing the answer key or explanation. If the adversarial agent arrives at a different answer, or proves two options are correct, the question is instantly rejected and forced back into a rewrite.
  4. Explanation Agent: Drafts detailed step-by-step solutions only after the rigorous cross-validation succeeds.