Back

Bancada

Editora BP's editorial platform: from a PDF exam to a published commentary, with AI handling the solving and human review along the way

Private repository

About the project

Bancada produces commented answer explanations for Brazilian civil service exam (concurso) questions at scale, without giving up human review. The name plays on both ends of the process: the banca examinadora (exam board) that wrote the test, and the bancada (workbench) where each question gets solved, commented on, and reviewed. The exam comes in as a PDF, the system extracts the questions and the answer key, solves each one through a retrieval and generation pipeline, compares the computed answer against the official key, and routes the result into the editorial funnel. The funnel is the heart of the product: each commentary moves through defined states and distinct roles, from intern to professor to final approval, with concurrency guards so two reviewers don't collide on the same question, and an audit trail for every decision. There's also a per subject bibliographic source policy, so each commentary is grounded in material the publisher considers reliable, and a taxonomy that defines a strict commentary template based on the question type. On the output side, the platform publishes commented questions to Thinkr, a third party question bank, both creating new ones and updating existing ones, with idempotency control and sync status tracking. It also exports commented exams in PDF, DOCX, and PPTX, and offers a production dashboard with metrics by subject, exam board, and period.

How it works

Import extracts the PDF's content with PyMuPDF and OCR when needed, splits out the questions, aligns them with the official answer key, and caches the result so the heavy lifting isn't repeated on every attempt. Solving runs as a state graph in LangGraph: the question is classified by the taxonomy, the source policy picks the primary material for that subject, the pipeline retrieves the relevant passages, the model drafts the commentary using the template for that question type, and the system checks the computed answer against the key. Discrepancies aren't hidden, they're flagged for the reviewer. The heavy processing runs in Celery queues with Redis, outside the request cycle. Once a commentary is approved, the Thinkr client sends or updates it on the destination platform and records the sync status, allowing safe resubmission. The admin dashboard tracks questions sent, generated versus approved commentaries, and submission failures, broken down by subject, exam board, and exam, and exports the report as a PDF.

Architecture

  1. 01

    React frontend with Vite, Radix UI, and TanStack Query: review, question bank, and dashboard

  2. 02

    FastAPI backend: exams, questions, answer explanations, import, permissions, audit, and integration

  3. 03

    LangGraph solving graph: classification, retrieval, drafting, and answer key verification

  4. 04

    Extraction services: PyMuPDF, OCR, and cached answer key alignment

  5. 05

    Per subject source policy and taxonomy with a strict template per question type

  6. 06

    Celery queues with Redis for import, solving, and submission

  7. 07

    Thinkr client and mapper, with idempotency and sync status tracking

  8. 08

    MinIO for file and image storage in production

Features

  • PDF exam import with question and answer key extraction
  • Solving via a retrieval and generation graph, checked against the official answer key
  • Per subject bibliographic source policy
  • Question taxonomy with a commentary template per type
  • Role based editorial funnel, with concurrency guards and auditing
  • Publishing and updating questions on Thinkr, with idempotency control
  • Export of commented exams in PDF, DOCX, and PPTX
  • Production dashboard with metrics by subject, exam board, and period
  • Unit and end to end tests with continuous integration

Tech stack

Backend
Python · FastAPI · Celery
AI/ML
LangGraph · OpenAI · Gemini · RAG
Frontend
React 19 · Vite · TypeScript · Radix UI
Tools
PyMuPDF · Playwright · Vitest
Database
Supabase
Infrastructure
Redis · MinIO · Docker