The documents endpoint exposes the ChromaDB ingestion pipeline without requiring a server restart. When you add or update source files in a data directory, call this endpoint to re-embed and re-index them into the named ChromaDB collection. The Mesa de Ayuda IA knowledge base is organized into three collections — one per specialized agent — all persisted locally underDocumentation 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.
backend/data/chroma_db/. The endpoint validates that the source directory exists, enqueues the full ingestion pipeline as a FastAPI BackgroundTask, and returns an "accepted" status immediately while processing continues asynchronously.
POST /api/v1/documents/ingest
Triggers the document ingestion pipeline for a specific directory and ChromaDB collection. The ingestion pipeline runs the following steps in sequence:loader.py— reads all.txtand.pdffiles from the specified directory using LangChain’sTextLoadersplitter.py— splits documents into chunks of ~1 000 characters with 200-character overlap usingRecursiveCharacterTextSplitterembeddings.py— generates vector embeddings for each chunk usingGoogleGenerativeAIEmbeddings(modelmodels/gemini-embedding-001)vectorstore.py— indexes all chunks into the named ChromaDB collection, replacing any existing vectors
Request Body
The name of the ChromaDB collection to populate. Must match one of the agent’s collection names. Standard values used by the system are
col_catalogo, col_politicas, and col_proceso_ventas.Path to the directory containing the source documents. The path is resolved relative to the backend working directory. Returns HTTP 400 if the directory does not exist at the time of the request.
Response
Acknowledgement of the request. Always
"accepted" when the background task was enqueued successfully.Human-readable confirmation including the collection name, e.g.
"La ingesta para la colección 'col_catalogo' ha comenzado en background.".Example
To re-index all three collections in a single operation, use the dedicated ingestion script instead of calling this endpoint three times:The script processes all three source files (
01_Catalogo_Productos_Precios.txt, 02_Politicas_Comerciales_Descuentos_Credito.txt, 03_Proceso_Ventas_CRM.txt) and populates col_catalogo, col_politicas, and col_proceso_ventas sequentially. Run this after any change to the source documents in data/raw/.