Pratica que Passa

A study tutor for Brazilian public-service exams that answers from past papers and statutes, citing the page.

Case 04 · Product

The problem

A candidate gets a question wrong and cannot tell why. A generic chatbot explains with confidence and no source, and the statute the exam cites may have changed since.

What the system does

  • Searches the library of past papers and statutes before every answer

  • Cites document and page in its answers

  • Reads scanned PDFs with a vision model

  • Builds the question bank with human review and the official answer key

  • Flags a question as suspect when its statute changes

  • Explains a mistake by comparing the chosen option with the right one

  • Brings each mistake back for review after 1, 3, 7, 15, 30 and 60 days

Architecture in three steps

  1. Indexes past papers and statutes

    Text comes out of the PDF, scanned pages go through a vision model and the administrator confirms the metadata.

  2. Searches before it answers

    The agent's graph forces a library search on every question. The specialist receives the excerpts with document and page.

  3. Explains the mistake with its source

    The tutor compares the chosen option with the right one and schedules review after 1, 3, 7, 15, 30 and 60 days.

Security controls

  • Passwords hashed with argon2id; the database keeps only the session token's hash

  • HttpOnly, Secure session cookie with CSRF protection

  • Retrieved text treated as data, not as an instruction to the model

  • Usage limits per user and per IP

  • Google login with PKCE and id_token validation

  • Data export and account deletion, as Brazil's LGPD requires

Stack. Backend: FastAPI, SQLAlchemy, Alembic · Agent: LangGraph, OpenAI · Search: PostgreSQL, pgvector · Frontend: Next.js, React · Tests: 130 backend files, 28 end-to-end scenarios · Infrastructure: Fly.io

Open praticaquepassa.com.br

See the next case