Back to projects
LLM-Powered Telecom FAQ Bot

In progress

ML / Automation Engineer

LLM-Powered Telecom FAQ Bot

A retrieval-augmented FAQ assistant for telecom documentation, procedures, and troubleshooting workflows.

Built a retrieval-augmented telecom FAQ assistant that combines local TF-IDF search, automatic web-source fallback, and optional LLM synthesis. It answers open-ended telecom questions from a dynamic, expanding corpus.

Can answer novel telecom questions even when they are not in the original static corpus, by combining retrieval enrichment with free LLM backends like Ollama.
FastAPITF-IDF RetrievalRAGHugging Face DatasetsUvicornhttpxOllama
Local TF-IDF vector search over a 60+ article telecom knowledge base
Automatic fallback enrichment from public sources (3GPP, GSMA, O-RAN, etc.) when local confidence is low
Optional RAG pipeline with free LLM backends (Ollama, Groq, OpenAI-compatible APIs) for synthesized answers
FastAPI service with playground and structured JSON responses
Expandable corpus with automatic chunking and keyword tagging

Architecture

The bot is organized as a FastAPI service with a retriever layer, a lightweight API, and room for local or hosted model backends.

FastAPI app entrypoint
Knowledge base and retrieval utilities
Response schema for FAQ answers

Repository contents

The repo now contains the first service files, dependency list, and README setup steps so the project can grow into a full assistant implementation.

API scaffold
Service layer scaffold
Project README and environment notes

Run instructions

The service can be launched locally with Uvicorn and queried through the FAQ endpoint or the document listing endpoint.

uvicorn app.main:app --reload
GET /health
POST /faq and GET /documents

How it answers open-ended questions

The FAQ bot uses a RAG pipeline instead of a static article matcher.

Local TF-IDF search over 60+ telecom articles for fast grounded answers.
Automatic fallback fetches public telecom pages if local confidence is low, then re-searches.
Optional LLM synthesis (Ollama, Groq, OpenAI, Cloudflare Workers AI) rewrites retrieved context into a fluent grounded answer.
If no LLM is configured, the bot still returns retrieval-based answers with source citations.

Sample knowledge base

The initial corpus covers core telecom topics and can be expanded dynamically through ingestion endpoints.

What is 5G? - 5G is the fifth generation of mobile networks. It improves speed, latency, and capacity.
5G Core Network - The 5GC is a cloud-native, service-based architecture with AMF, SMF, UDM, AUSF, and PCF.
Network Slicing - Creates logically isolated virtual networks tailored for eMBB, URLLC, or mMTC.
Open RAN (O-RAN) - Opens the RAN to multi-vendor interoperability with open interfaces between RU, DU, and CU.
Telecom Security - 5G security includes SUPI privacy through SUCI, mutual authentication, and encrypted user-plane traffic.

Example conversations

These examples show how the FAQ bot retrieves grounded answers from the telecom knowledge base.

Q: What is 5G? A: Retrieves the 5G article with 0.87 similarity and returns the core definition with source citation.
Q: How does network slicing work? A: Matches the slicing article and explains eMBB, URLLC, and mMTC use cases.
Q: What is Open RAN? A: Returns the O-RAN article covering RU/DU/CU separation and multi-vendor interoperability.
Q: Tell me about 5G security. A: Retrieves the security article detailing SUPI/SUCI privacy, authentication, and encryption.

Open-source data enrichment

The API includes two ingestion endpoints to expand the knowledge base with external telecom content.

POST /ingest/web - Fetches and chunks public telecom sources: 3GPP, GSMA Open RAN, O-RAN Alliance, Telecom Infra Project, and 5G-ACIA.
POST /ingest/hf - Pulls from Hugging Face datasets such as mantisnlp/gsma_prd_synthetic_qa and converts Q&A rows into searchable articles.
Chunked articles are tagged automatically with telecom keywords and appended to the live TF-IDF index.

Live API examples

Use these curl commands to interact with the running FastAPI service.

curl -X POST http://localhost:8000/faq -H "Content-Type: application/json" -d '{"question":"What is 5G?","top_k":2}'
curl "http://localhost:8000/search?q=network+slicing&top_k=3"
curl -X POST http://localhost:8000/ingest/web
curl -X POST "http://localhost:8000/ingest/hf?dataset=mantisnlp/gsma_prd_synthetic_qa&limit=50"

Live Demo

Local API Demo

Base URL: http://localhost:8000

Run the FastAPI service locally and try the FAQ endpoint against the telecom knowledge base. The bot uses local TF-IDF search, automatic fallback enrichment, and optional LLM synthesis.

GET/health

Health check for the service.

GET/documents

List the searchable telecom documents.

GET/search?q=what is 5g

Search the telecom FAQ corpus.

POST/faq

Return a grounded FAQ answer with sources. Enable ENABLE_LLM=true to synthesize answers through an LLM.

POST/ingest/web

Ingest public telecom web sources into the knowledge base.

POST/ingest/hf

Ingest a Hugging Face dataset into the knowledge base.

Request Example

# Ask a question (local retrieval only)
curl -X POST http://localhost:8000/faq \
  -H "Content-Type: application/json" \
  -d '{"question":"What is DPI?","top_k":3}'

# Enable local LLM synthesis with Ollama
ENABLE_LLM=true uvicorn app.main:app --reload

# With LLM enabled, the same request returns a synthesized grounded answer

Response Example

{
  "answer": "Deep Packet Inspection (DPI) inspects packet payloads beyond IP headers to classify traffic, enforce QoS, detect threats, and enable lawful interception. Operators use it for traffic shaping and policy enforcement.",
  "sources": [
    {
      "title": "DPI (Deep Packet Inspection)",
      "snippet": "DPI inspects packet payloads beyond IP headers...",
      "score": 0.71
    }
  ]
}

Interactive FAQ Playground

Ask the telecom FAQ bot

POST http://localhost:8000/faq

Source folder: telecom-data-portfolio/Project_3_LLM_FAQ_Bot