Cognix

Core Multimodal Agentic Architecture

Hybrid Knowledge Base, Agentic Swarm Validation, and S3 Image Integration

2026-02-17
architecturecoremultimodalagentic

0. Evolution from Initial Architecture

The system architecture presented here represents a vital evolution from our Initial AI System Design. The first iteration strictly relied on extracting templates from past NEET papers, which led to critical bottlenecks:

To understand the full, detailed reasoning for this architectural pivot, please read the Critical Flaws in Phase 1 Architecture Report. The resulting Multimodal Agentic Architecture detailed below directly solves these issues by introducing an Object Store, shifting to a Hybrid Database (PostgreSQL + pgvector), and utilizing an adversarial validation swarm.

1. High-Level System Architecture

The system separates synchronous client requests from the heavy, asynchronous AI generation pipeline. Pre-generated daily exams are served instantly from PostgreSQL, while custom topic-wise requests (up to 10 questions) trigger the Celery background workers. MinIO acts as our self-hosted S3 bucket for all structural and generated images.

Rendering diagram...

2. Hybrid Knowledge Base ERD (Ingestion & Source Data)

This diagram illustrates how raw textbooks and past papers are ingested. We DO NOT store questions as strict templates anymore. Instead, we store Theory Chunks (textbooks) and Images with AI-generated semantic captions. Past questions are stored purely as Reference_Questions for stylistic prompting.

Rendering diagram...

3. Generated Question & Exam Storage Schema

Once the Swarm generates questions, they must be stored immutably. A single generated question can belong to a Daily Full Paper, but can also be dynamically queried by Subject, Topic, or Concept for future practice sets.

Rendering diagram...

4. Multimodal Agentic Swarm Sequence (Per Question)

This is the core engine ensuring zero hallucinations. For every single question, the system queries the hybrid DB for context, generates a draft, and uses an Adversarial Solver Agent to blind-solve the question. Only if the Generator and Solver agree does the question get saved.

Rendering diagram...

5. API Layer Contracts

RESTful interfaces supporting instant delivery of pre-computed daily mocks, and asynchronous creation of custom 10-question topic quizzes.

A. Fetch Today's Daily Exam

GET /api/v1/exams/daily -- Sync (Cached)

{
  "exam_id": "uuid-daily-10-24",
  "title": "NEET Full Mock - Oct 24",
  "total_questions": 180,
  "questions": [
    {
      "id": "q-1234",
      "subject": "Physics",
      "topic": "Semiconductors",
      "stem_markdown": "Identify the logic gate shown in the circuit below: ![gate](minio://bucket/images/gate.jpg)",
      "options": [
        { "key": "A", "text": "AND Gate" },
        { "key": "B", "text": "OR Gate" },
        { "key": "C", "text": "NAND Gate" },
        { "key": "D", "text": "NOR Gate" }
      ],
      "correct_key": "C",
      "explanation_markdown": "The diagram shows an AND gate followed by a NOT bubble, making it a NAND gate."
    }
  ]
}

B. Request Custom Topic Practice (Limit 10)

POST /api/v1/practice/generate -- Async Trigger

{
  "topic_id": "uuid-botany-photosynthesis",
  "question_count": 10,
  "difficulty": "Hard"
}

Response (Returns job ID for polling):

{
  "job_id": "job-8899-abcd",
  "status": "PROCESSING",
  "message": "Agentic swarm is compiling and validating your questions.",
  "eta_seconds": 45
}