Final project, Artificial Intelligence, FI UNAM 2027-1

A Telegram bot that cites AI papers

It answers questions on RAG and AI agents in Spanish, using 1,210 papers as sources and linking every citation to arXiv. With no backing, it does not answer.

Papers in the library
1,210
Similarity threshold
0.52
Correct routing
26 of 26
The bot’s Telegram reply to “Que es reflexion?”, with numbered citations, the source list linking to arXiv and one button per cited paper.
Question 02similarity 0.596
Answers citing Reflexion

No paper, no answer

If no paper reaches 0.52 similarity to the question, the bot refuses before the model is called and offers a web search.

  • ¿Cómo funciona Self-RAG?0.826 · answers
  • ¿Qué es la fotosíntesis?0.540 · the model refuses
  • Dame una receta de tamales0.469 · refused, no model

The 26 evaluation questions

An illustrative interface with real data: the 26 evaluation questions, their result and similarity, and the start of a real bot answer.

See the full results

The bot’s tools

The assignment asked for an automation platform, an LLM, a database and a social network. Everything runs on free tiers.

  • n8n
  • Gemini
  • Qdrant Cloud
  • Google Sheets
  • Telegram
  • Docker
  • cloudflared
  • Tavily
  • arXiv
  • Semantic Scholar
  • OpenAlex

Automation

n8n in Docker

Two workflows: W1 adds papers every day at 8:00 and W2 is the bot.

LLM

Gemini Flash Lite

Writes the answers; gemini-embedding-2 turns each text into a vector.

Database

Qdrant Cloud and Sheets

Qdrant stores the vectors; Google Sheets keeps a readable copy and the log.

Social network

Telegram

The bot only answers allow-listed chats, through a cloudflared tunnel.

What the bot does. Four features, in real Telegram and n8n screenshots.

Answers from the full text

With /profundizar it downloads the paper’s PDF and cites each chunk by number, such as F2 or F31.

Answer about Reflexion’s benchmarks from the full text, citing chunks F2, F7, F8, F31 and F34.

Shows each paper’s similarity

With /fuentes on it lists the five retrieved papers and each one’s score.

Answer followed by the five retrieved papers and their similarity.

Searches the web when it cannot answer

It offers a Tavily search and marks that answer as not verified.

Off-topic question refused, then answered from the web with a not-verified warning.

Runs on one n8n workflow

One workflow takes the message, searches, answers and logs the query to Google Sheets.

The W2 workflow canvas in n8n with its routing, search, answer and logging branches.

How a question is answered

Telegram hands the message to n8n, which finds the five closest papers in Qdrant. If the best is under 0.52, it refuses right there. Otherwise Gemini writes the answer citing each paper, and the query is logged to Google Sheets.

2.6 s median per answer in real use

3072-dimension embeddings

Indexing a new paper takes 34 to 55 s

Read the W2 workflow

Evaluation with 26 questions

Spanish questions on classic papers, topics, comparisons, off-topic and full text. An LLM judge gave 5 of 5 to everything, so its scores were checked by hand.

  • Correct routing26 of 26
  • Expected paper ranked first14 of 17
  • Expected paper in the top 517 of 17
  • Mean reciprocal rank0.88
  • Cites the expected paper17 of 17
  • Exact facts with /profundizar2 of 3
  • Median latency2.6 s
  • Off-topic questions refused6 of 6
  • Answers with at least one citation20 of 20
The queries tab in Google Sheets: date, blurred chat ID, question, result, best similarity, papers, citations, answer and latency.

Questions

What people tend to ask about Radar RAG.

Alexisvop/Radar-RAGOpen the repository

Can I try the bot?

Not publicly: it only answers allow-listed chats. The README explains how to run it with Docker.

What if it cannot find a paper?

If the best similarity is under 0.52, it refuses without calling the model and offers a web search marked as not verified.

How much does the bot cost to run?

Nothing: n8n runs in Docker, and Gemini, Qdrant Cloud, Google Sheets and Tavily are on free tiers.

Where do the 1,210 papers come from?

810 recent arXiv papers (cs.CL, cs.AI, cs.IR) and 400 highly cited works since 2020 from Semantic Scholar and OpenAlex.

What are the bot’s limits?

Gemini’s free tier allows 15 requests a minute, and the tunnel URL changes on every restart.