Case study · 2026
Strategy Sync AI
RAG · Semantic search · Knowledge graph
MSc Data Science · Information Retrieval coursework · Coventry University
The Intelligent Strategic Plan Synchronization System (ISPS): it measures how well an organisation's day-to-day action plan lines up with its long-term strategy, shows exactly which actions support which goals, and explains how to close the gaps.

- AI / IR Engineer
- 2026
- RAG
- 9 technologies
- Sentence-Transformers
- ChromaDB
- RAG
- OpenAI
- rdflib · SPARQL
- Streamlit
- Plotly
- pypdf
- Pydantic
0.90
Macro Precision@5 vs ground truth
1.00
Macro Recall@5: every relevant action found
0.88
Mean NDCG@5 (MAP 0.84)
384-d
MiniLM sentence embeddings in ChromaDB
3 tiers
Strong ≥ 0.75 · Medium ≥ 0.55 · Weak
6
Dashboard tabs, live on Hugging Face
The Streamlit dashboard
Screens from the deployed app on the sample AutoBridge strategic and action plans, as submitted in the coursework report · tap to enlarge
The problem
Strategic plans describe long-term goals in abstract language. Action plans list short-term tasks in operational language. The two are written separately, so nobody can easily prove that daily work serves the strategy. Manual reviews are slow, subjective, and don't scale to documents hundreds of pages long, and keyword matching fails because the same intent is written in different words.
Overview
Strategy Sync treats alignment as a retrieval problem. Each strategic objective and each action item becomes one semantic unit: its title, description, and KPIs (or outputs) joined into a single clean sentence. A Sentence-Transformers model (all-MiniLM-L6-v2) turns every unit into a 384-dimensional normalised vector. Actions are indexed once in a persistent ChromaDB collection, and every strategy becomes a query that retrieves its top-K most similar actions by cosine similarity.
Similarities become decisions through fixed, explainable rules. A strategy's score is the mean of its top-3 matches, labelled Strong (≥ 0.75), Medium (≥ 0.55), or Weak. The overall synchronisation score is the mean across strategies on a 0–100 scale, and coverage is the share of strategies backed by at least two Strong actions. Anything without enough support is flagged as a gap.
Gaps feed the RAG step. For each strategy, the objective, its score, and only its top-K retrieved actions go into a structured prompt (SYSTEM, CONTEXT, INSTRUCTIONS, RESPONSE_FORMAT). The LLM returns strict JSON: an explanation of the score, three new actions, two KPIs, an owner and timeline, and risks. If there's no API key or the call fails, a deterministic rule-based template answers instead, so every run still completes and stays reproducible.
Alongside the scores, the top-K links are written to an RDF knowledge graph (rdflib) and queried with SPARQL for actions per strategy, unsupported strategies, and owner workload. Retrieval is evaluated against a ground-truth map with Precision@K, Recall@K, average precision, and NDCG. Everything appears in a Streamlit dashboard, hosted on Hugging Face Spaces, with JSON, CSV, and Turtle exports. Plans can be uploaded as JSON or as PDFs, which are converted to structured JSON first.
Architecture
System architecture
A layered, pipeline design. Each layer is one module in the repo, so it can be tested on its own, and the same pipeline runs behind the dashboard and the CLI. Each layer links to its code.
- Channels
- AI agents
- Data & infra
- Service
- PDF → JSON code
Ingestion
Strategic plan
JSON array of objectives: id, title, description, KPIs, priority
Action plan
JSON array of tasks: id, title, description, owner, start and end dates, outputs
PDF → JSON
pypdf extracts the text, then an LLM in JSON mode (temperature 0) structures it. Regex heuristics take over without an API key.
Pydantic validation
StrategicObjective and ActionTask models check every record before it enters the pipeline
typed StrategicObjective[] + ActionTask[] - Preprocessing code
Processing
strategy_to_text()
title | description | KPIs, joined into one sentence, whitespace collapsed
action_to_text()
title | description | outputs, the same deterministic template
all-MiniLM-L6-v2
384-dimensional embeddings, L2-normalised so cosine similarity is a dot product. Swappable via EMBEDDING_MODEL.
upsert action vectors · query with strategy vectors - Vector store code
Storage & retrieval
Persistent collection
"actions" with an HNSW index in cosine space, stored in chroma_db/
Upsert by id
Re-runs update records instead of duplicating them. Owner and dates travel as metadata.
Top-K query
Returns the K nearest actions with similarity = 1 − cosine distance
Resilient start-up
Telemetry off. Falls back to a local client if the sqlite store is read-only (as on hosted Spaces).
matches + similarities per strategy - Engine code
Alignment & insight
AlignmentEngine
Top-3 mean per strategy, three-tier label, overall score (0–100) and coverage
RAGEngine
Grounded prompt → OpenAI (gpt-4o-mini by default) → strict JSON, with a rule-based fallback
Knowledge graph
ss:Strategy –hasAction→ ss:ActionTask in RDF, saved as Turtle and queried with SPARQL
Evaluation
Precision@K, Recall@K, AP and NDCG against a ground-truth strategy → action map
final report JSON - Dashboard code
Presentation
Streamlit dashboard
Overview, Strategy Explorer, Graph, Evaluation, RAG Suggestions, and Data Export tabs
Plotly charts
Score and coverage gauges, per-strategy bars, label pie, similarity heatmap, owner workload
CLI
python main.py full-run strategic.json action.json --ground_truth_path … --top_k 5
Hugging Face Space
Streamlit SDK hosting over HTTPS. The OpenAI key is a Space secret, never in the code.
How it works
Pipeline
- 01
Ingest
Strategic and action plans are loaded and validated. PDFs are converted to structured JSON first.
- 02
Preprocess
Title, description, and KPIs or outputs become one clean, deterministic sentence per item.
- 03
Embed
Sentence-Transformers turns each sentence into a normalised 384-d vector.
- 04
Index
Action vectors and metadata are upserted into a persistent cosine-space collection.
- 05
Retrieve
Each strategy vector queries the store for its K most similar actions.
- 06
Score
Mean of the top-3 similarities, labelled Strong (≥ 0.75), Medium (≥ 0.55), or Weak. Overall score and coverage follow.
- 07
Recommend
Strategy, score, and retrieved actions go into a structured prompt. JSON suggestions come back, or the deterministic fallback runs.
- 08
Graph
Matches become RDF triples, saved as Turtle, and queried for explainability stats.
- 09
Evaluate
Optional: rankings are compared against a ground-truth strategy → action map.
- 10
Visualise
Six-tab dashboard with charts, tables, recommendations, and downloadable reports.
How it was built
Development phases
Built incrementally, one testable phase at a time, from data preparation to end-to-end validation.
- 01
Requirements & data
Scoped the system, chose the two input documents, and fixed one JSON schema for strategies and actions.
- 02
Preprocessing
Cleaned and normalised text so formatting noise doesn't distort embeddings.
- 03
Embeddings
Generated a vector per item and kept its id and source type for traceability.
- 04
Vector storage
Indexed embeddings in ChromaDB for fast cosine search that scales with plan size.
- 05
Top-K matching
Retrieved the most similar actions for each objective and recorded the scores.
- 06
Scoring & coverage
Turned scores into Strong, Medium, and Weak labels and flagged coverage gaps.
- 07
RAG recommendations
Injected retrieved actions into the prompt to generate grounded improvement suggestions.
- 08
Dashboard
Built the interactive Streamlit and Plotly interface for technical and non-technical users.
- 09
End-to-end validation
Ran test data through the whole pipeline to confirm consistent scores, correct gaps, and relevant suggestions.
Architecture diagrams
Five diagrams drawn from the code and the coursework report: the system, one strategy traced through retrieval and generation, the data model, how scores turn into decisions, and the knowledge graph. Tap any diagram to zoom.
System architecture
Data flows left to right through five layers. Actions are embedded and stored once; strategies are embedded and used as queries. Four modules consume the ranked matches (scoring, RAG, graph, and evaluation), and they all feed the same dashboard and report.
- PDFs are an optional entry point: they're converted to the same JSON schema as direct uploads
- The LLM is used in only two places (PDF structuring and recommendations), and both have a non-LLM fallback
- The same pipeline (src/pipeline.py run_full_flow) runs behind the Streamlit app and the CLI
One strategic objective, end to end
The RAG flow for a single objective. Retrieval happens first, and only the strategy and its top-K actions (never the full documents) reach the language model. That keeps answers grounded in real plan items and limits how much company data leaves the system.
- Steps 1–4: retrieval and scoring are fully deterministic. Same input, same scores, every run
- The prompt has fixed sections and asks for strict JSON, so the output can be parsed and rendered reliably
- Step 8: if parsing fails or there's no API key, the rule-based template answers, matched to the Weak, Medium or Strong label
Data model: from JSON record to ranked match
Which fields are embedded and which ride along as metadata. Title, description, and KPIs or outputs carry the meaning. Owner and dates aren't embedded but are stored with each vector, so every match can name who owns the action and when it runs.
- Each statement is its own unit, so alignment is measured per objective and per action, not per document
- Upserting by id keeps the index consistent when the same plan is analysed again
From similarity to a decision
The real numbers from the sample run in the report. S1 averages 0.586 over its top three actions (Medium). S2 averages 0.529 (Weak). Together they give an overall synchronisation score of 55.7, and because neither has two Strong actions, coverage is 0%: both are flagged for the recommendation step.
- Averaging the top three, not just the best match, rewards strategies that several actions support
- Thresholds were chosen by looking at the observed similarity distribution, and they're configurable
Knowledge graph: alignment as RDF
The top-K matches become triples in a small ontology (ss:Strategy, ss:ActionTask, ss:hasAction, ss:ownedBy, ss:startDate, ss:endDate). SPARQL then answers the questions a manager asks: what backs each goal, what has nothing behind it, and who carries the work.
- Saved as outputs/strategy_graph.ttl, so it opens in Protégé or any triple store
- A base to extend with dependencies, risks, and strategy hierarchies (broader) in future work
Input: a strategic plan as JSON
Each objective has a unique id, a title, a description, measurable KPIs, and a priority. The sample is a logistics company (AutoBridge): reduce landed-cost variance, speed up customs clearance, and unify cost tools with anomaly detection.
Input: an action plan as JSON
Action items carry an owner (Finance Ops, Data Engineering, Operations), a start and end date, and concrete outputs. The wording deliberately differs from the strategy text, which is exactly where keyword matching breaks and embeddings don't.
Every report records its configuration
The final report stores a timestamp, top-K, the embedding model, and the thresholds used, so any result can be traced and re-run exactly.
Tools & tech
Retrieval & NLP
- Sentence-Transformers
- all-MiniLM-L6-v2 embeddings for strategies and actions
- ChromaDB
- Persistent vector store with HNSW cosine search
- NumPy · scikit-learn
- Vector handling and similarity utilities
Generation
- OpenAI API
- gpt-4o-mini for recommendations; JSON mode for PDF structuring
- pypdf
- Text extraction from uploaded PDF plans
Knowledge & evaluation
- rdflib
- RDF graph construction, Turtle serialisation, and SPARQL queries
- Custom IR metrics
- Precision@K, Recall@K, average precision, and NDCG@K
App & delivery
- Streamlit
- Six-tab dashboard with uploads, a top-K slider, and an LLM toggle
- Plotly
- Gauges, bars, pie, heatmap, and workload charts
- Pydantic · pandas
- Typed input models, tables, and CSV export
- pytest
- Smoke tests for alignment, RAG, and the full pipeline
- Hugging Face Spaces
- Public hosting, with secrets in environment variables
Results
Retrieval quality vs ground truth
Top-K = 5, macro-averaged over the strategies in the sample run
- Recall@51.00
- Precision@50.90
- NDCG@50.88
- MAP0.84
Ranking quality per strategy
S1 ranks every relevant action first; S2 finds them all but ranks some lower
- S1 · AP1.00
- S1 · NDCG@51.00
- S2 · AP0.68
- S2 · NDCG@50.76
Alignment score per strategy
Mean cosine similarity of the top-3 matches. Medium starts at 0.55, Strong at 0.75
- S1 · AutoBridge strategic plan (Medium)0.586
- S2 · Platform coverage & availability (Weak)0.529
S1: top-5 retrieved actions
Cosine similarity of each match, as ranked by ChromaDB
- A20.608
- A10.580
- A70.569
- A50.472
- AT-001 · Finance Ops0.462
Key features
- Overall synchronisation score (0–100) and coverage gauges, with per-strategy breakdowns that flag weak or unsupported goals
- Semantic matching that links actions to strategies even when they share no keywords
- Top-K slider (1–10) and an optional LLM toggle in the sidebar, plus upload of JSON or PDF plans and a ground-truth file
- RAG recommendations per strategy: an explanation, three new actions, two KPIs, an owner and timeline, and risks
- RDF knowledge graph with SPARQL stats for actions per strategy, zero-action strategies, and owner workload
- Built-in IR evaluation (Precision@K, Recall@K, AP, NDCG) when a ground-truth map is supplied
- One-click downloads: converted JSON, final report JSON, strategies CSV, matches CSV, and the Turtle graph
- Deterministic by default: no API key needed, and the same input always gives the same scores
Results & discussion
- Strategies with clear, well-documented actions scored high. Abstract, high-level strategies scored lower, which is itself a useful signal that the strategy needs sharper wording or more concrete actions.
- Coverage analysis showed most goals had some support, but a clear group lacked strong action coverage: strategic blind spots that are hard to find by hand.
- Manual review of strategy–action pairs confirmed that high-similarity matches were genuine support relationships. Low scores usually traced back to vague strategy text or overly general actions.
- RAG recommendations stayed tied to the retrieved actions, so they read as specific, practical next steps rather than generic AI advice.
Evaluation methodology
- Cosine similarity is the core metric: it measures the angle between embedding vectors and is standard in information retrieval.
- A ground-truth file maps each strategy to the actions that truly support it. Retrieved rankings are scored with Precision@K, Recall@K, average precision, and NDCG@K (binary relevance).
- The similarity summary compares the mean similarity of all retrieved actions with that of the relevant ones, to check that relevant actions really do score higher.
- Stability: repeated runs on the same input give identical scores and labels, which pytest smoke tests check for alignment, RAG, and the full pipeline.
Security & deployment
- Only the top-K retrieved actions and the strategy text are sent to the LLM, never whole documents, which keeps data exposure to a minimum.
- Prompts have fixed sections and a strict response format, which limits prompt injection and instruction overrides from document content.
- API keys live in environment variables (Space secrets), never in the repository. Similarity, thresholds, and evaluation logic run server-side and can't be changed from the client.
- Graceful degradation: if the LLM is unavailable, scores, coverage, the graph, and evaluation still work, and only the generated suggestions fall back to templates.
- Deployed on Hugging Face Spaces over HTTPS, with configuration, data, and application logic kept separate.
Limitations
- Results depend on input quality: vague strategies or overly general actions lower alignment accuracy.
- Thresholds were tuned on the observed data and may need adjusting for other industries or writing styles.
- The system measures semantic similarity. It doesn't yet model causal or temporal links between actions and outcomes.
- The reported evaluation uses a small sample dataset, so the metrics show the method works rather than how it performs at scale.
Contributions
- 01Applied retrieval-augmented generation to strategic management, an area usually handled by manual review
- 02A deterministic, explainable alignment score with transparent thresholds and coverage, suited to academic and real-world audit
- 03Recommendations grounded in retrieved action-plan context, which reduces hallucination and makes the advice traceable
- 04An end-to-end, deployable tool: PDF or JSON in, scores, graph, evaluation, and recommendations out
Future work
- A formal ontology or knowledge graph of strategic concepts, roles, and dependencies, for impact and cross-department analysis
- KPI-weighted scoring that links alignment to measurable performance outcomes
- Adaptive thresholds learned from user feedback, and multilingual document support
- A multi-user platform with authentication, audit logs, role-based dashboards, and integration with project-management tools