Elamur Research⌕
☰
home / papers / 2026 / Social-RAG: A Retrieval-Augmented Generation Pipeline for Computational Social Science Research on Telegram

Social-RAG: A Retrieval-Augmented Generation Pipeline for Computational Social Science Research on Telegram

Paper · 2026 · Leonardo Nascimento, Eric Brasil, Arthur Lima et al.

Summary

Huge, fast-changing collections of digital traces, such as public Telegram messages, are beyond what social scientists can read closely. Yet automated tools can hide how conclusions were reached. The authors build Social-RAG, a modular retrieval-augmented generation pipeline that supports qualitative, interpretive analysis while keeping each claim tied to retrievable source messages. Every Telegram post becomes one chunk in a vector index. A query then passes through four steps:

  • embedding-based semantic retrieval;
  • an Adaptive-K rule that decides how much context to keep;
  • MMR re-ranking to reduce redundancy;
  • structured instructions that limit the model to the retrieved evidence.

The pipeline was tested on two thematic subsets of public Telegram messages: vaccine discourse and debates on Brazil's Lei Rouanet cultural funding law. Each subset had hermeneutic and factual question blocks. Three models were compared: a local open-weight, a cloud open-weight and a closed commercial one. LLM judges and a human judge scored the answers. The larger models did well on both task types. The local model helped with exploratory synthesis but was weaker at exact extraction, negation and attribution. The work offers an auditable, reproducible template for computational social science.

Key points

  • The core design consists of "one post = one chunk" indexing, Adaptive-K context cutoff, MMR diversity re-ranking and evidence-constrained prompting.
  • The stack is built in Python with LangChain, Ollama (local models), the OpenAI API, ChromaDB, pandas, FastAPI and a Streamlit interface with logs. It was refined over eight months of human-in-the-loop development with domain specialists.
  • Evaluation used ChatGPT/GPT-5 and Gemini Pro as blinded LLM judges (three rounds each) plus one human judge. Model ranking stayed the same across judges and corpora: C first, B close behind, A last. Gemini Pro scored more leniently overall.
  • Gaps between models were larger on the more voluminous and heterogeneous vaccine corpus, especially for hermeneutic questions. They narrowed on the more repetitive Rouanet discourse.
  • Social-RAG is not meant for counts or descriptive statistics. Its outputs are evidence samples, not exhaustive measurements. Planned work covers scalability, more domains and knowledge-graph modules.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Fields, topics and concepts

Cite

Cite as Leonardo Nascimento, Eric Brasil, Arthur Lima, Gabriel Andrade, Ricardo Sodré Andrade and Tarssio Barreto. 2026. Social-RAG: A Retrieval-Augmented Generation Pipeline for Computational Social Science Research on Telegram. Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 2.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{nascimento2026social,
  title = {{Social-RAG: A Retrieval-Augmented Generation Pipeline for Computational Social Science Research on Telegram}},
  author = {Leonardo Nascimento, Eric Brasil, Arthur Lima, Gabriel Andrade, Ricardo Sodré Andrade and Tarssio Barreto},
  booktitle = {Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026) - Vol. 2},
  year = {2026},
  doi = {10.31235/osf.io/wmc2q\_v1},
  url = {https://doi.org/10.31235/osf.io/wmc2q_v1}
}

References

55 references, 5 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Andrew Abbott. 2000. Reflections on the future of sociology. Contemporary Sociology, 29(2):296. find
  2. Ming Cheng, Yang Luo, Jianguo Ouyang, and 1 others. 2025. A survey on knowledge-oriented retrieval-augmented generation. Preprint, arXiv:2503.10677. — [arXiv:2503.10677](https://arxiv.org/abs/2503.10677) find
  3. Asad Afzal, Ashwin Kowsik, Reza Fani, and Florian Matthes. 2024. Towards optimizing and evaluating a retrieval augmented QA chatbot using LLMs with human in the loop. Preprint, arXiv:2407.05925. find
  4. Rosaria Conte, Nigel Gilbert, Guido Bonelli, and 1 others. 2012. Manifesto of computational social science. The European Physical Journal Special Topics, 214(1):325–346. find
  5. Enrica Amaturo and Biagio Aragona. 2019. Per un’epistemologia del digitale: Note sull’uso di big data e computazione nella ricerca sociale. Quaderni di Sociologia, 81. find
  6. Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, and Hannaneh Hajishirzi. 2023. Self-RAG: Self-reflective retrieval augmented generation. find
  7. Earl R. Babbie. 2013. The Practice of Social Research, 13 edition. Wadsworth, Cengage Learning. find
  8. Gustavo Matias Soares Balbino and Renato Pinto Venâncio. 2020. Políticas culturais e arquivos públicos: o caso da Lei Rouanet. ÁGORA: Arquivologia em debate, 30(60):57–74. find
  9. Juliet Corbin and Anselm Strauss. 2008. Basics of Qualitative Research: Techniques and Procedures for Developing Grounded Theory, 3 edition. SAGE Publications. find
  10. Ross-Helen Ferguson. 2017. Offline ‘stranger’ and online lurker: Methods for an ethnography of illicit transactions on the darknet. Qualitative Research, 17(6):683–698. find
  11. Katja Filippova. 2020. Controlled hallucinations: Learning to generate faithfully from noisy data. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 864–870. find
  12. Monica J. Barratt and Alexia Maddox. 2016. Active engagement with stigmatised communities through digital ethnography. Qualitative Research, 16(6):701– 719. find
  13. Rohith Gangavarapu, Abhinav R. A. Srinivasan, and Venkatesh Moparthi. 2025. Evaluating accuracy in large language models: Benchmarking corrective RAG vs. naive retrieval augmented generation approach. In 2025 IEEE International Conference on AI and Data Analytics (ICAD), pages 1–7. find
  14. Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. 2021. On the dangers of stochastic parrots: Can language models be too big? In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT ’21, pages 610–623. find
  15. Luyu Gao, Xueguang Ma, Jimmy Lin, and Jamie Callan. 2023. Precise zero-shot dense retrieval without relevance labels. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1762–1777. danah boyd and Kate Crawford. 2012. Critical ques…
  16. Flavius Brontes, Janus Genesis, Zephyrine Noa, and Stavros Nymphodoros. 2025. Learning to retrieve, generate, and compress: A unified view of efficient RAG. find
  17. Jaime Carbonell and Jade Goldstein. 1998. The use of MMR, diversity-based reranking for reordering documents and producing summaries. In Proceedings of the 21st Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 335–336. find
  18. Mark Carrigan. 2014. An agenda for digital sociology. find
  19. Timnit Gebru, Jamie Morgenstern, Briana Vecchione, and 1 others. 2021. Datasheets for datasets. Preprint, arXiv:1803.09010. find
  20. J. Amos Hatch. 2010. Doing Qualitative Research in Education Settings. SUNY Press. find
  21. James Howison, Andrea Wiggins, and Kevin Crowston. 2011. Validity issues in the use of social network analysis with digital trace data. Journal of the Association for Information Systems, 12(12). find
  22. Andreas Jungherr. 2015. Analyzing Political Communication with Digital Trace Data: The Role of Twitter Messages in Social Science Research. Springer. find
  23. Klaus H. Krippendorff. 2004. Content Analysis: An Introduction to Its Methodology, 2 edition. Sage Publications. find
  24. Jong Hyuk Lee, Ghulam Ali, and Jeong-In Hwang. 2025. A retrieval-augmented generation system for accurate and contextual historical analysis. Computer Animation and Virtual Worlds, 36(4):e70048. find
  25. Patrick Lewis, Ethan Perez, Aleksandra Piktus, and 1 others. 2021. Retrieval-augmented generation for knowledge-intensive NLP tasks. Preprint, arXiv:2005.11401.
  26. Richard Rogers. 2013. Digital Methods. MIT Press. find
  27. Jathan Sadowski. 2019. When data is capital: Datafication, accumulation, and extraction. Big Data & Society, 6(1). find
  28. Matthew J. Salganik. 2018. Bit by Bit: Social Research in the Digital Age. Princeton University Press. find
  29. Stine Lomborg, Lina Dencik, and Hallvard Moe. 2020. Methods for datafication, datafication of methods: Introduction to the special issue. European Journal of Communication. find
  30. Deborah Lupton. 2015. Digital Sociology. Routledge. find
  31. Yury A. Malkov and Dmitry A. Yashunin. 2016. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. Preprint, arXiv:1603.09320.
  32. Noortje Marres. 2017. Digital Sociology: The Reinvention of Social Research. Polity Press. find
  33. Joshua Maynez, Shashi Narayan, Bernd Bohnet, and Ryan McDonald. 2020. On faithfulness and factuality in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1906–1919.
  34. Song Mengmeng, Liu Zhibin, Wang Qingwei, Huang Man, and Xu Feiyang. 2024. An effective retrieval method to improve RAG performance. In 2024 7th International Conference on Data Science and Information Technology (DSIT), pages 1–5. find
  35. Leonardo F. Nascimento, Taciana Barreto, Leticia Cesarino, Vânia Mussa, and Priscila Fonseca. 2023. Públicos refratados: Grupos de extrema-direita brasileiros na plataforma Telegram. Internet & Sociedade. find
  36. Leonardo Fernandes Nascimento. 2016. A sociologia digital: Um desafio para o século XXI. Sociologias, 18:216–241. find
  37. Akhere Josephine Oche, Adegboyega G. Folashade, Tirthankar Ghosal, and Arindam Biswas. 2025. A systematic review of key retrieval-augmented generation (RAG) systems: Progress, gaps, and future directions. Preprint, arXiv:2507.18910. — [arXiv:2507.18910](https://arxiv.org/abs/2507.18910) find
  38. Janna Joceli Omena. 2019. Métodos Digitais: Teoria-Prática-Crítica. ICNOVA. find
  39. OpenAI. 2024. text-embedding-3-large model. find
  40. OpenAI. 2025. GPT-5 mini model. find
  41. Bernhard Rieder and Theo Röhle. 2017. Digital methods. In Mirko Tobias Schäfer and Karin van Es, editors, The Datafied Society, pages 109–124. Amsterdam University Press. find
  42. Marcos L. Scheren, Vinícius S. Rodrigues, Guilherme D. López Zamora, and 1 others. 2024. Métodos mistos para a antropologia digital: Um relato de experiência sobre a análise de grupos bolsonaristas na plataforma Telegram. Horizontes Antropológicos, 30:e680407. find
  43. Silke Schwandt. 2022. Opening the black box of interpretation: Digital history practices as models of knowledge. History and Theory, 61(4):77–85. find
  44. Aditi Singh, Abul Ehtesham, Saket Kumar, and Tala Talaei Khoei. 2025. Agentic retrieval-augmented generation: A survey on agentic RAG. Preprint, arXiv:2501.09136. — [arXiv:2501.09136](https://arxiv.org/abs/2501.09136) find
  45. Clare Southerton. 2020. Datafication. In Laurie A. Schintler and Connie L. McNeely, editors, Encyclopedia of Big Data, pages 1–4. Springer International Publishing. find
  46. Streamlit Inc. 2021. Streamlit — a faster way to build and share data apps. find
  47. Jiajie Sun, Xin Zhong, Shirui Zhou, and Jiawei Han. 2025. DynamicRAG: Leveraging outputs of large language model as feedback for dynamic reranking in retrieval-augmented generation. Preprint, arXiv:2505.07233. — [arXiv:2505.07233](https://arxiv.org/abs/2505.07233) find
  48. TacticalTechVideos. 2014. Smari McCarthy, making data speak. find
  49. Chihiro Taguchi, Saku Maekawa, and Nikita Bhutani. 2025. Efficient context selection for long-context QA: No tuning, no iteration, just adaptive-k. Preprint, arXiv:2506.08479. find
  50. Robert Topinka, Alan Finlayson, and Camille Osborne-Carey. 2021. The trap of tracking: Digital methods, surveillance, and the far right. Surveillance & Society, 19(3):384–388. find
  51. José van Dijck. 2014. Datafication, dataism and dataveillance: Big Data between scientific paradigm and ideology. Surveillance & Society, 12(2):197– 208. find
  52. Ruijie Xie, Junxiong Wang, Paul Rosu, and 1 others. 2025. Language models (mostly) know when to stop reading. Preprint, arXiv:2502.01025. — [arXiv:2502.01025](https://arxiv.org/abs/2502.01025) find
  53. Wei Zhang and Jing Zhang. 2025. Hallucination mitigation for retrieval-augmented large language models: A review. Mathematics, 13(5). find
  54. Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, and 1 others. 2023. Judging LLM-as-a-judge with MT-Bench and chatbot arena. Preprint, arXiv:2306.05685.
  55. Yucheng Zhou, Xiubo Geng, Tao Shen, and 1 others. 2023. Thread of thought unraveling chaotic contexts. Preprint, arXiv:2311.08734. — [arXiv:2311.08734](https://arxiv.org/abs/2311.08734) find

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/nascimento-2026-social-rag-retrieval-augmented-generation/