How varunnaikr/genai-rag-predictive-semantic-caching works
This repository is a Python research simulation for predictive semantic caching in mobile edge-assisted RAG networks, not an end-to-end retrieval or language-model service. A researcher runs the experiment; the simulation models mobility and semantic demand, applies one of five cache policies, realizes requests and computes performance metrics, then supports comparative evaluation. The README documents the major strategies and evaluation capabilities. The sampled implementation is concentrated in one source file; links for unsampled internals are omitted where their wiring cannot be confirmed.
Main entry points: semantic_cache_experiment.py Simulation loop
Components 21
Network Environment
- Simulation environment
src/semantic_cache_experiment.py - User mobility
src/semantic_cache_experiment.py - Wireless links
src/semantic_cache_experiment.py
Semantic Demand
- Semantic embeddings
src/semantic_cache_experiment.py - Demand forecasts
src/semantic_cache_experiment.py - Request sampling
src/semantic_cache_experiment.py
Cache Control
- RMP-SC policy
src/semantic_cache_experiment.py - TSK-SC policy
src/semantic_cache_experiment.py - LDP-SC policy
src/semantic_cache_experiment.py - POP policy
src/semantic_cache_experiment.py - LRU policy
src/semantic_cache_experiment.py - Edge association
src/semantic_cache_experiment.py - Edge cache state
src/semantic_cache_experiment.py
Evaluation
- Experiment entry
src/semantic_cache_experiment.py - Evaluation suite
src/semantic_cache_experiment.py - Simulation loop
src/semantic_cache_experiment.py - Service metrics
src/semantic_cache_experiment.py - System utility
src/semantic_cache_experiment.py - Strategy comparison
src/semantic_cache_experiment.py - Evaluation plots
src/semantic_cache_experiment.py
Other components
- Researcher
Connections 36
- Researcher → Experiment entry: runs
- Experiment entry → Evaluation suite: dispatches
- Evaluation suite → Simulation loop: runs trials
- Simulation loop → Simulation environment: initializes
- Simulation environment → User mobility: models
- Simulation environment → Wireless links: computes links
- Simulation environment → Semantic embeddings: initializes
- Semantic embeddings → Demand forecasts: provides embeddings
- Simulation loop → RMP-SC policy: steps policy
- Simulation loop → TSK-SC policy: steps policy
- Simulation loop → LDP-SC policy: steps policy
- Simulation loop → POP policy: steps policy
- Simulation loop → LRU policy: steps policy
- RMP-SC policy → Demand forecasts: requests forecasts
- TSK-SC policy → Demand forecasts: requests forecasts
- LDP-SC policy → Demand forecasts: requests forecasts
- POP policy → Demand forecasts: requests forecasts
- RMP-SC policy → Edge association: chooses edges
- TSK-SC policy → Edge association: chooses edges
- LDP-SC policy → Edge association: chooses edges
- RMP-SC policy → Edge cache state: updates cache
- TSK-SC policy → Edge cache state: updates cache
- LDP-SC policy → Edge cache state: updates cache
- POP policy → Edge cache state: updates cache
- LRU policy → Edge cache state: updates cache
- Simulation loop → Request sampling: samples requests
- Semantic embeddings → Request sampling: supplies demand
- Simulation loop → Service metrics: evaluates service
- Edge cache state → Service metrics: serves lookups
- Edge association → Service metrics: routes users
- Wireless links → Service metrics: supplies link metrics
- Request sampling → Service metrics: provides items
- Service metrics → System utility: provides metrics
- Simulation loop → System utility: computes utility
- Evaluation suite → Strategy comparison: compares strategies
- Strategy comparison → Evaluation plots: plots results