Back to portfolio

Naturcor

Building and evaluating a source-backed chatbot for trails in Córdoba.

Situation

Naturcor trail information was spread across PDFs. A useful chatbot had to distinguish routes with similar names and cite its sources.

Task

I needed to build an assistant that cites retrieved documents and measure how retrieval choices affect its answers.

Action

I indexed 398 text PDFs and built a retrieval pipeline with LangChain, FAISS, and local models served through Ollama. I used the retrieved passages as answer context and returned the source information so people could check the original documents.

I compared four chunk sizes while keeping the retrieved text budget roughly constant. I then combined semantic search with BM25 and compared three weightings. I gave BM25 more weight in the chosen setup, which helps exact terms such as trail names contribute to the search.

I evaluated the system on 401 questions, saving the answers, context, and sources before scoring them with RAGAS. I tracked faithfulness, response relevancy, and context precision separately. In a later experiment I scored the same saved answers with three evaluators to see how much the choice of evaluator affected the results.

I also checked specific route answers against the source maps. For Sendero Botánico, restricting retrieval to the Los Villares map returned the documented distance of 2.2 km one way.

What I would improve

I would build a human-verified reference set and add tests for trails with similar names, compound questions, and cases where the retrieved documents do not support an answer.

Result

Across the 401-question benchmark, mean RAGAS faithfulness rose from 0.301 at baseline to 0.406 with 300-character chunks and to 0.479 with 30% semantic search and 70% BM25. The web app uses that retrieval configuration.