Docent AI is designed using a high-performance, modular architecture that separates concerns into:

3.1 High-Level Flow

At a high level, the user interacts with a web frontend that communicates with a FastAPI backend. The backend orchestrates ingestion, embedding, storage, and retrieval, then delegates response generation to Groq-hosted Llama 3.3.

A conceptual flow:

  1. User submits a query and optionally uploads URLs or PDFs,
  2. Backend ingests and normalizes the data.
  3. Embeddings are generated using Google Gemini.
  4. Embeddings are stored in Pinecone.
  5. Query embeddings are used to retrieve relevant context.
  6. Context is fed into the LLM (Llama 3.3 on Groq) via a controlled prompt.
  7. The model returns a grounded, code-formatted response, streamed back to the user.

3.2 Architecture