Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/geremyjampiersalasgarcia-eng/Caso_Practico_Semillero_IA/llms.txt

Use this file to discover all available pages before exploring further.

The Mesa de Ayuda IA FastAPI backend exposes a versioned REST API under /api/v1. Every request and response body uses JSON. You can explore and test all endpoints interactively through the Swagger UI automatically generated by FastAPI at http://localhost:8000/docs. The API requires no authentication in the current development configuration — simply send well-formed JSON requests to the relevant path.

Base URL

http://localhost:8000/api/v1
All endpoint paths in this documentation are relative to this base URL. The frontend Next.js application uses http://127.0.0.1:8000/api/v1 as its API_BASE_URL constant (see frontend/lib/api.ts).

Content Type

All POST requests must include the following HTTP header:
Content-Type: application/json
GET and DELETE requests do not require a body or content-type header.

Endpoint Summary

MethodPathDescription
POST/chat/Send a question to the LangGraph multi-agent orchestrator
GET/conversations/List recent conversation sessions
GET/conversations/{conversation_id}Retrieve full message history for a conversation
DELETE/conversations/{conversation_id}Permanently delete a conversation and its messages
GET/health/Service health check (database and LLM connectivity)
POST/documents/ingestTrigger background document ingestion into a ChromaDB collection
GET/metrics/costsAggregated Gemini token cost metrics, grouped by intent

Error Responses

FastAPI returns structured error responses for all failure cases. The most common HTTP error codes you will encounter are:
StatusMeaning
400 Bad RequestInvalid input — e.g., question exceeds 2 000 characters or matches an injection pattern, or the target ingestion directory does not exist
404 Not FoundThe requested resource (conversation, document) does not exist
422 Unprocessable EntityRequest body failed Pydantic schema validation (missing required fields, wrong type, etc.)
500 Internal Server ErrorUnexpected server-side error
A validation error (422) from FastAPI looks like this:
{
  "detail": [
    {
      "type": "missing",
      "loc": ["body", "question"],
      "msg": "Field required",
      "input": {},
      "url": "https://errors.pydantic.dev/2.0/v/missing"
    }
  ]
}
A business-logic error (400) looks like this:
{
  "detail": "Input rechazado: Pregunta demasiado larga"
}
A not-found error (404) looks like this:
{
  "detail": "Conversation not found"
}

Endpoint Pages

POST /chat

Send a natural language question — with optional image and confirmation flag — to the multi-agent orchestrator.

GET/DELETE /conversations

List, retrieve, and delete conversation sessions stored in PostgreSQL.

POST /documents/ingest

Trigger background document ingestion into a named ChromaDB collection.

GET /metrics/costs

Retrieve Gemini API cost metrics aggregated by intent over a configurable time window.

GET /health

Check the connectivity status of PostgreSQL and the Gemini LLM client.

Swagger UI

Interactive API explorer automatically generated by FastAPI.
The Swagger UI at http://localhost:8000/docs lets you send real requests directly from the browser. It reflects the exact Pydantic schemas used in production and is the fastest way to explore request/response shapes without writing any code.

Build docs developers (and LLMs) love