Updated: 2026-08-10 12:26 PT
CAIF · April 1, 2026

RAG-Based Semantic Retrieval

2026 OkIP International Conference on Artificial Intelligence Frontiers (CAIF)

Mohammed Fahad
Dr. Solomon Berhe

University of the Pacific

This presentation covers a project that integrates Retrieval-Augmented Generation (RAG) with realtime APIs to improve the precision and relevance of software update and security vulnerability information.

Agenda

  1. Problem: fragmented update data
  2. RAG baseline and its limits
  3. Realtime multi-source architecture
  4. Routing and retrieval improvements
  1. Code-level contributions
  2. 30% less manual inspection
  3. 36% better correct-answer detection
  4. Lessons learned and future work

Problem: Understanding Software Updates and Risks

  • Current Linux versions?
  • Known vulnerabilities?
  • Active issues?
  • Dependency status?

Manual lookup, comparison, and summarization across sources takes significant time.

Release Note DB
GitHub · DistroLinux
↓
Community DB
Reddit · StackOverflow
↓
Vendor CVE DB
NVD · NIST

Baseline RAG System

Import Docs
CSV export from lake
→
Similarity Search
RAG non-realtime content
→
Keyword Queries
"Current Linux versions?"
→
Manual Review
Inspect all returned updates

This baseline established a working prototype, but accuracy was limited.

Baseline Limitations

Before

  • RAG used imported docs only
  • Keyword retrieval over-focused vendors
  • Many incorrect answers were returned for broad queries
  • All candidate updates still had to be reviewed manually

Need

  • Current security feeds and release feeds
  • Contextual sentence-level query understanding
  • Better routing to the right source before retrieval
  • Filtering to reduce human inspection effort

Improved Solution

Realtime APIs
CISA · NVD · GitHub
→
Routing Layer
vendor + intent + time
→
RAG Context
FAISS + sentence embeddings
→
LLM Fusion
grounded final answer
More sources Higher accuracy Less noise Lower manual effort

Architecture

User Query
→
Time Parsing
→
Vendor Extraction
→
Source Routing
OS API
Reddit API
CISA KEV
GitHub Releases
NIST NVD
Filter by vendor + date
→
FAISS Retrieval
→
Live + RAG Merge
→
Grounded Answer

Query Improvement Example

Keyword-oriented query

“Give me an update about Linux”

  • Too broad
  • High noise across unrelated results
  • Weak match to actual patch timing

Contextual query

“What is the recent Linux patch update?”

Normalized into a time-aware search:

“What is the Linux patch update on <CURRENT MONTH>?”

  • Better vendor routing
  • Better temporal filtering
  • More relevant release evidence

Technical Contribution 1: Vendor Extraction

Why it helped

  • Maps user wording to canonical vendor names.
  • Handles aliases such as k8s → kubernetes and nodejs → node.
  • Improves retrieval precision before any API call is made.
  • Supports strict routing instead of loose keyword matching.

Vendor is the key linking all data sources.

app.py · canonical vendor mapping

def extract_vendors(q: str):
    alias_map = {
        "k8s": "kubernetes",
        "docker": "docker",
        "postgresql": "postgresql",
        "linux": "linux",
        "windows": "windows",
        "nodejs": "node",
        "Linux": "windows",
    }
    found = []
    for alias, canonical in alias_map.items():
        if re.search(rf"\b{re.escape(alias)}\b", q.lower()):
            found.append(canonical)
    return list(dict.fromkeys(found))
      

Technical Contribution 2: Time-Aware Query Parsing

Why it helped

  • Transforms vague phrases (e.g., last week, this month) into concrete date windows.
  • Reduces irrelevant historical results.
  • Enables contextual search beyond keyword matching.

Rephrasing temporal wording improves similarity matching.

app.py · natural-language time windows

def parse_time_window(q: str, now=None):
    if "last week" in q.lower():
        monday = (now - timedelta(days=now.weekday() + 7)).date()
        sunday = monday + timedelta(days=6)
        return monday, sunday

    if "this month" in q.lower():
        first = now.replace(day=1).date()
        last_day = calendar.monthrange(now.year, now.month)[1]
        return first, last_day
      

Technical Contribution 3: Intelligent Source Routing

Why it helped

  • Routes query → correct data source.
  • Separates security, updates, and user issues.
  • Reduces noise and improves response speed.

Routing improves performance and accuracy.

app.py · routing logic

def route(query):
    return {
        "cve": "vulnerability" in query or "cve" in query,
        "release": "update" in query or "version" in query,
        "community": "issue" in query or "reddit" in query
    }
      

Technical Contribution 4: Realtime Fetching

Why it helped

  • Uses live release data instead of static documents.
  • Improves accuracy for recent updates.
  • Keeps responses current and relevant.

On-request fetch improves accuracy.

app.py · GitHub API

def fetch_releases(repo):
    return requests.get(
        f"https://api.github.com/repos/{repo}/releases"
    ).json()[:5]
      

Technical Contribution 5: Live + RAG Fusion

Why it helped

  • Live vendor-routed results remain the primary source of truth.
  • RAG adds background context instead of overriding current facts.
  • This reduced hallucination risk and improved final answer quality.
app.py · grounded answer composition

def combine_live_and_rag(user_q, live_answer, rag_answer):
    prompt = f"""
    - Prefer live vendor-routed results as the primary source.
    - Use RAG only to add helpful context.
    - If live results exist, summarize them confidently.
    - Do not say unavailable unless both are empty.
    """
    resp = _gem.invoke(prompt)
    return getattr(resp, "content", str(resp))
            

30% Reduction in Manual Inspection Effort

30%

Less manual inspection

  • We filter results before human review.
  • The analyst inspects fewer invalid updates.
  • The query count stayed constant, but answer quality improved.

Interpretation

  • Before: 15 queries against RAG with broader, noisier results.
  • After: 15 queries, but routed through better sources and filters.
  • Same amount of querying, lower amount of manual checking.
  • Accuracy improvement translated into less review effort.

Manual Inspection: Before vs After

Baseline

  • Imported MongoDB CSV only
  • Similarity search over non-realtime content
  • Keyword retrieval such as vendor-name search
  • Many incorrect answers
  • Review all updates manually

Improved

  • Realtime APIs: CISA, NVD feeds, GitHub
  • Contextual whole-sentence search
  • Temporal query normalization
  • More data sources added into the evidence path
  • Filtered results reduce manual inspection by 30%

36% Detection of Correct Answer

36%

Improvement in detection of the correct answer

  • Better source selection
  • Better freshness
  • Better context alignment

Interpretation

  • The improvement reflects higher precision in final answers.
  • Realtime evidence helped resolve update questions more reliably.
  • RAG remained useful, but it performed best when grounded by live feeds.

System Evaluation Summary

1,200

Software version updates

248

Reddit discussions

312

CVE / NVD records

  • Two-year observation window.
  • Baseline comparison used keyword heuristics and TF-IDF style retrieval.
  • Evaluation focused on relevance, detection timeliness, and manual effort reduction.

Prototype Overview

  • Streamlit interface for interactive querying
  • FAISS vector store for semantic retrieval
  • Sentence-transformer embeddings
  • Live source badges for grounded answers
  • LLM answer synthesis with source preference rules
FAISS
Sentence Transformers
GitHub API
CVE Feed
Reddit Feed
Gemini Flash

The system combines traditional retrieval discipline with modern LLM synthesis, which remains a reliable pattern when current data quality matters.

Lessons Learned

  • Combining RAG with realtime APIs improves accuracy
  • Semantic retrieval is stronger than plain keyword lookup
  • Routing is essential to avoid unnecessary data
  • Caching and query filtering improve system speed
  • Realtime evidence matters when answering update questions
  • Static document stores remain useful for background context

Limitations and Future Work

Limitations

  • API latency can still affect responsiveness
  • External sources may change format
  • LLM interpretation still requires grounding safeguards
  • Rate limits remain a practical constraint

Future Work

  • More robust API routing and caching strategies
  • Additional security and package feeds
  • Larger-scale evaluation
  • Multi-agent orchestration and parallel fetching

Thank you

  • RAG + realtime → better answers
  • Smarter routing → better answers
  • 30% less manual inspection
  • 36% better detection

Project Repository:
ReleaseNotesRec-Agent (GitHub)

Live Demo:
Streamlit Application

Contact:
Mohammed Fahad
m_lnu18@u.pacific.edu