Applied AI
Pangea Chat
Multilingual language feedback API
Returns minimal sentence corrections, structured explanations in the learner’s native language, and a CEFR difficulty label.
Architecture & evidence
Architecture
API reference

The problem
A language learner needs corrections they can understand without having every valid sentence rewritten into a different style.
System architecture
FastAPI validates the request and checks a bounded application cache before calling a schema-constrained language model. Deterministic post-processing reconciles the corrected sentence, error list, and correctness flag.
Reliability decisions
The implementation normalizes error labels, uses bounded HTTP timeouts, retries transient provider failures with exponential backoff, and preserves valid sentences. CEFR describes attempted sentence complexity separately from correctness.
Validation
The repository includes API, unit, edge-case, schema, and multilingual integration tests. Its README distinguishes structural contract checks from linguistic checks grounded in task examples and grammar references.
From a sentence to useful feedback
This request and response example comes from the project README. The learner receives a minimal correction, an explanation in English, and a separate difficulty label.
POST /feedback · example request
{
"sentence": "Yo soy fue al mercado ayer.",
"target_language": "Spanish",
"native_language": "English"
}Structured example response
{
"corrected_sentence": "Yo fui al mercado ayer.",
"is_correct": false,
"errors": [{
"original": "soy fue",
"correction": "fui",
"error_type": "conjugation",
"explanation": "You mixed two verb forms. You only need 'fui' here."
}],
"difficulty": "A2"
}Explore the implementation
Source code, setup instructions, and project documentation are available in the repository.