Joaquín Borja León Projects ES

DocuChat

An assistant that answers questions about your PDFs with retrieval-augmented generation (RAG) and shows which document each answer comes from. If something is not in your documents, it says so.

Personal project2026

Period
2026
Team
Personal project
Context
Own project, deployed with Docker Compose
My role
Everything: backend, search, agent, evaluation and interface
Tech stack
  • Python
  • FastAPI
  • PostgreSQL
  • pgvector
  • Ollama
  • Gemini
  • React
  • Docker Compose
DocuChat answering what the PMBOK is, with the source documents listed below
The interface answers questions about project management notes and lists the sources.

What it does

  • Splits your PDFs, embeds them with nomic-embed-text and stores them in PostgreSQL with pgvector.
  • You ask in plain language and every answer cites its source documents.
  • It runs fully locally with Ollama or with Gemini in the cloud, switched by an environment variable.

How it is built

  • Hybrid search. Vector search failed on short questions like “What is the PMBOK?”: the right passage did not even make the top-k. Combining it with PostgreSQL full-text search and fusing both with Reciprocal Rank Fusion moved that passage to first place.
  • Tool-calling agent. For each question the model decides whether to search the documents or check the date. I compared Ollama and Gemini: both choose well; Ollama is free and private, Gemini polishes answers a little more.
  • Observability. Every query stores provider, tools, retrieved passages and latency, to measure instead of guess.

Results

recall@8: the right source shows up in the top 8 passages
60 %
questions in the evaluation set
15
model providers: local Ollama and Gemini
2

A first version of the evaluation gave 93%, but it counted generic passages that did not answer the question as hits. Once corrected, the real figure is 60%, with failures concentrated in broad conceptual questions.

Let’s talk

I’m from Seville and now live in Madrid. I like things to work end to end: designing the system, writing the code, deploying it and measuring whether it really holds up.

If you’re looking for someone for backend, data or applied AI work, write to me and I’ll get back to you.