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
|
| 2 |
+
**Last updated:** April 22, 2026
|
| 3 |
+
**Version:** Post-feasibility audit, pre-implementation
|
| 4 |
+
**Purpose:** Single source of truth for all RECON v2 development. Paste this into any new Claude session (Claude.ai or Claude Code). Supersedes the original RECON_MASTER_CONTEXT.md for all v2 work. The v1 doc remains the reference for the existing codebase.
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## Part 1 β Project Identity
|
| 9 |
+
|
| 10 |
+
RECON is a multi-agent RAG system built with LangGraph that treats **temporal supersession** as a first-class retrieval failure mode in scientific literature. No existing RAG system or evaluation framework (RAGAS, ARES, TREC RAG) measures or targets this.
|
| 11 |
+
|
| 12 |
+
**The philosophical claim:** Every RAG system asks "what is relevant?" RECON asks "what should I trust, right now, and why?" That is a different kind of question. RECON is a prototype of a **temporal epistemology layer** for AI retrieval.
|
| 13 |
+
|
| 14 |
+
**Key links:**
|
| 15 |
+
- GitHub: https://github.com/MukulRay1603/project-recon
|
| 16 |
+
- HF Space (live, Gradio): https://huggingface.co/spaces/MukulRay/recon
|
| 17 |
+
- NASA KG Dataset: https://huggingface.co/datasets/nasa-gesdisc/nasa-eo-knowledge-graph
|
| 18 |
+
- NASA GNN Model: https://huggingface.co/nasa-gesdisc/edgraph-gnn-graphsage
|
| 19 |
+
- NASA Publications Dataset: https://huggingface.co/datasets/nasa-gesdisc/es-publications-researchareas
|
| 20 |
+
|
| 21 |
+
**Owner:** Mukul Ray (MukulRay1603 on GitHub, MukulRay on HF)
|
| 22 |
+
**Collaborator:** Prof. Armin Mehrabian, NLP researcher, NASA GES-DISC
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## Part 2 β Where v1 Stands (Audit-Verified)
|
| 27 |
+
|
| 28 |
+
### What is built and working
|
| 29 |
+
- Full 6-node LangGraph state machine: session_loader β planner β retriever β critic β synthesizer (with retry_retriever loop)
|
| 30 |
+
- 4 core agents: planner, retriever, critic, synthesizer
|
| 31 |
+
- Hybrid scoring: semantic_sim Γ 0.5 + recency Γ 0.3 + authority Γ 0.2
|
| 32 |
+
- Three decay configs: none, linear, log
|
| 33 |
+
- Eval harness: 5 architectures Γ 130 questions, LLM-as-judge, crash-resume
|
| 34 |
+
- Deployed on HF Spaces (Gradio UI)
|
| 35 |
+
- SQLite session memory with verdict logging
|
| 36 |
+
|
| 37 |
+
### Eval results (honest, source-verified)
|
| 38 |
+
| Architecture | Staleness Catch Rate | Position Accuracy |
|
| 39 |
+
|---|---|---|
|
| 40 |
+
| Single-pass RAG (baseline) | 0% | 32.3% |
|
| 41 |
+
| RECON no decay | 42% | 38.1% |
|
| 42 |
+
| RECON log decay | 38% | 36.7% |
|
| 43 |
+
| **RECON linear decay** | **52%** | **43.9%** |
|
| 44 |
+
|
| 45 |
+
- Contradiction catch rate: **0%** β honest result, caused by live bug (see below)
|
| 46 |
+
- Benchmark: 130 questions from real ML survey paper supersession chains
|
| 47 |
+
|
| 48 |
+
### Known bugs and integrity issues
|
| 49 |
+
|
| 50 |
+
**BUG 1 β STALE fires before CONTRADICTED (LIVE, PRODUCTION)**
|
| 51 |
+
In `critic_node`, the verdict checks are sequential and first-match-wins. STALE (check 4: mean age > 24 months) fires before CONTRADICTED (check 5: LLM pairwise comparison). Any question with papers older than 2 years exits at STALE and never reaches the contradiction check. This is why contradiction catch rate is 0%. This is not an eval artifact β it happens to real users on the HF Space.
|
| 52 |
+
|
| 53 |
+
**INTEGRITY β patch_contradiction.py still exists**
|
| 54 |
+
`eval/patch_contradiction.py` was documented as "dropped" in the original blueprint. It still exists and is fully functional. It includes a keyword-heuristic boost (`position_acknowledges_debate`) that can override an LLM verdict. If any reported numbers were generated with this file active, that is a research integrity risk. Must be archived before any paper submission. The 0% contradiction catch rate is the honest number.
|
| 55 |
+
|
| 56 |
+
**BUG 2 β Claim confidence is LLM-generated, not computed**
|
| 57 |
+
The `_extract_claims()` function sends text to a second LLM call. The LLM assigns confidence based on rules ("high = multiple recent 2022+ papers agree") but actual `hybrid_score` values are never passed in. Confidence is an LLM judgment, not a numeric derivation. Not a bug per se, but must be described accurately in any paper.
|
| 58 |
+
|
| 59 |
+
**Inaccuracies corrected in v1 audit:**
|
| 60 |
+
- `retry_count` is incremented in critic, not retry_retriever
|
| 61 |
+
- Retriever is sequential, not parallel
|
| 62 |
+
- `verdict_log` schema had 4 wrong fields in original doc (corrected in v1 master context)
|
| 63 |
+
|
| 64 |
+
### What is described but NOT built
|
| 65 |
+
- OpenAlex integration (no `search_openalex()` function exists)
|
| 66 |
+
- Edge reliability scoring (formula designed, no code)
|
| 67 |
+
- `network_reliability` field in synthesizer output
|
| 68 |
+
- CrossRef API for DOI fill-in
|
| 69 |
+
- 130Q benchmark uploaded as public HF dataset
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
## Part 3 β The Publishability Problem
|
| 74 |
+
|
| 75 |
+
### Why v1 cannot survive peer review
|
| 76 |
+
|
| 77 |
+
The 52% staleness catch rate is real but the mechanism is vulnerable to a single devastating critique:
|
| 78 |
+
|
| 79 |
+
> "Your STALE verdict fires when mean paper age exceeds 24 months. Any script that checks `if avg_age > 2: return 'stale'` achieves the same result. Where is the intelligence in your system?"
|
| 80 |
+
|
| 81 |
+
This is correct. The STALE check is a metadata threshold. It does not distinguish between a foundational 2003 paper with 10,000 citations and a forgotten 2020 preprint with 5 citations. Both get the same treatment based on age alone.
|
| 82 |
+
|
| 83 |
+
CONTRADICTED is the verdict that adds real intelligence (LLM content comparison), but it never fires due to Bug 1.
|
| 84 |
+
|
| 85 |
+
### What makes it publishable
|
| 86 |
+
|
| 87 |
+
The system must demonstrate that it can:
|
| 88 |
+
1. Flag a 2019 paper with low centrality as stale (correct detection)
|
| 89 |
+
2. Keep a 2003 foundational paper with high centrality as reliable (correct non-detection)
|
| 90 |
+
3. Explain WHY each verdict was assigned (explainability)
|
| 91 |
+
4. Use content analysis, not just age (via the coherence signal)
|
| 92 |
+
|
| 93 |
+
This requires: Bug 1 fix + edge reliability formula + trust summary in output.
|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## Part 4 β Prof. Armin Mehrabian β Full Context
|
| 98 |
+
|
| 99 |
+
### Who he is
|
| 100 |
+
NLP researcher at NASA GES-DISC. Main contributor on the `nasa-eo-knowledge-graph` dataset (150K+ nodes, 7 entity types, trained GraphSAGE GNN). Currently Mukul's professor. Shared the dataset link in class.
|
| 101 |
+
|
| 102 |
+
### The relationship timeline
|
| 103 |
+
1. **In class:** Prof. shared the HF dataset link
|
| 104 |
+
2. **First email from Mukul:** Explained RECON, proposed connecting staleness signal to his graph at the edge level, mentioned OpenAlex, promised slides
|
| 105 |
+
3. **Prof's response (email, April 2026):** Tried the HF Space, gave five specific points of feedback (see below), closed with "looking forward to seeing the slides"
|
| 106 |
+
4. **Status now:** Active, willing collaborator. Expects slides as next artifact.
|
| 107 |
+
|
| 108 |
+
### His five feedback points β decoded
|
| 109 |
+
|
| 110 |
+
1. **"I couldn't assess the validity of the results"**
|
| 111 |
+
β Explainability problem. Output shows verdict but not reasoning. Needs per-paper trust summary showing which signal drove the verdict.
|
| 112 |
+
|
| 113 |
+
2. **"Are you analyzing content for contradiction, or mostly metadata?"**
|
| 114 |
+
β Honest question. STALE is metadata-driven. CONTRADICTED uses LLM on abstracts but barely fires (Bug 1). Answer must be honest.
|
| 115 |
+
|
| 116 |
+
3. **"Recency is not validity. Older papers can be foundational."**
|
| 117 |
+
β The sharpest critique. Pure age decay is too blunt. A 2003 paper with 10K citations is not stale. This is the core methodological gap.
|
| 118 |
+
|
| 119 |
+
4. **"Think in terms of edge reliability rather than staleness"**
|
| 120 |
+
β He renamed the concept. Better framing, stronger paper title, survives the foundational paper objection. This is the pivot.
|
| 121 |
+
|
| 122 |
+
5. **"Have you considered PageRank or citation centrality?"**
|
| 123 |
+
β He is pointing at `pagerank_global`, which already exists on every node in his graph. He is telling Mukul the answer to his own question #3.
|
| 124 |
+
|
| 125 |
+
### What he expects next
|
| 126 |
+
- Slides showing RECON's architecture, the staleness metric, and how it maps to his graph
|
| 127 |
+
- Visible progress in the HF Space (trust summary, better output)
|
| 128 |
+
- Concrete technical direction, not just plans
|
| 129 |
+
|
| 130 |
+
### Authorship and collaboration structure
|
| 131 |
+
- **Paper 1 (solo arXiv cs.IR):** Mukul only. RECON standalone with edge reliability using open citation data (OpenAlex cited_by_count). Acknowledge Armin for suggesting the reframe. Edge reliability on his graph = Future Work.
|
| 132 |
+
- **Paper 2 (joint):** Armin leads, Mukul co-authors. Edge reliability applied to NASA KG using `pagerank_global`. GNN edge weighting. Earth science benchmark. Target venue: Armin's preference (ECIR, SIGIR workshop, AGU, ESIP).
|
| 133 |
+
- **The boundary between papers:** Paper 1 uses publicly available citation centrality from OpenAlex. Paper 2 uses graph-native PageRank from his proprietary graph. This boundary is clean, honest, and strategically sound.
|
| 134 |
+
|
| 135 |
+
### Communication principles
|
| 136 |
+
- Never ask him for something before showing him something
|
| 137 |
+
- Every ask (endorsement, KG access) comes after demonstrated progress
|
| 138 |
+
- Conversational, question-driven approach β not formal pitches
|
| 139 |
+
- Endorsement ask happens when the draft is ready, attached to the slides
|
| 140 |
+
|
| 141 |
+
---
|
| 142 |
+
|
| 143 |
+
## Part 5 β The v2 Architecture
|
| 144 |
+
|
| 145 |
+
### From v1 to v2: what changes
|
| 146 |
+
|
| 147 |
+
```
|
| 148 |
+
v1 (current):
|
| 149 |
+
session_loader β planner β retriever β critic β synthesizer β END
|
| 150 |
+
β
|
| 151 |
+
retry_retriever
|
| 152 |
+
|
| 153 |
+
v2 (target):
|
| 154 |
+
session_loader β planner β retriever β critic β synthesizer β explorer β END
|
| 155 |
+
β
|
| 156 |
+
retry_retriever
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
**New agent: Explorer (Agent 5)**
|
| 160 |
+
A Socratic exploration agent that reads the completed synthesis, identifies blind spots the user's query didn't cover, runs targeted searches for those angles, and returns findings the user didn't know to ask about. No published agentic RAG system does this β Speculative RAG pre-fetches anticipated follow-ups but doesn't generate novel questions.
|
| 161 |
+
|
| 162 |
+
**Upgraded agent: Critic (Agent 3)**
|
| 163 |
+
Moves from single-threshold metadata checks to three-signal edge reliability scoring. No longer short-circuits; runs STALE and CONTRADICTED checks in parallel and combines signals.
|
| 164 |
+
|
| 165 |
+
**Upgraded agent: Synthesizer (Agent 4)**
|
| 166 |
+
Adds per-paper trust summary showing reliability score, dominant signal, and one-line reasoning.
|
| 167 |
+
|
| 168 |
+
**Upgraded: Retriever (Agent 2)**
|
| 169 |
+
Adds OpenAlex as a second source alongside Semantic Scholar. Merged by DOI deduplication.
|
| 170 |
+
|
| 171 |
+
**Upgraded: Follow-up System**
|
| 172 |
+
Context inheritance for follow-up queries. Paper accumulation with bounds. Verdict evolution tracking.
|
| 173 |
+
|
| 174 |
+
### New state fields (additions to ResearchState)
|
| 175 |
+
|
| 176 |
+
```python
|
| 177 |
+
# Edge reliability
|
| 178 |
+
paper_reliability_scores: dict # {paper_id: ReliabilityScore}
|
| 179 |
+
reliability_dominant_signals: dict # {paper_id: "FOUNDATIONAL" | "CURRENT" | "DECLINING" | "SUPERSEDED"}
|
| 180 |
+
|
| 181 |
+
# Explorer
|
| 182 |
+
explore_mode: bool # User toggle, default False
|
| 183 |
+
explorer_findings: list[ExplorerFinding]
|
| 184 |
+
|
| 185 |
+
# Follow-up
|
| 186 |
+
is_followup: bool # Detected by planner
|
| 187 |
+
previous_papers: list[Paper] # Carried from prior turn
|
| 188 |
+
previous_verdict: str # For verdict evolution
|
| 189 |
+
previous_claims: list[Claim] # For context
|
| 190 |
+
turn_number: int # Session turn counter
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
### New dataclasses
|
| 194 |
+
|
| 195 |
+
```python
|
| 196 |
+
@dataclass
|
| 197 |
+
class ReliabilityScore:
|
| 198 |
+
score: float # [0, 1]
|
| 199 |
+
centrality: float # Normalized cited_by_count
|
| 200 |
+
recency: float # Linear decay
|
| 201 |
+
coherence: float # LLM content check
|
| 202 |
+
dominant_signal: str # FOUNDATIONAL / CURRENT / DECLINING / SUPERSEDED
|
| 203 |
+
reason: str # One-line explanation
|
| 204 |
+
|
| 205 |
+
@dataclass
|
| 206 |
+
class ExplorerFinding:
|
| 207 |
+
question: str # The blind spot question
|
| 208 |
+
answer: str # One-paragraph answer
|
| 209 |
+
sources: list[Paper] # Supporting papers
|
| 210 |
+
relevance_score: float # Cosine sim to original query
|
| 211 |
+
```
|
| 212 |
+
|
| 213 |
+
### New files (minimizes merge conflicts with v1)
|
| 214 |
+
|
| 215 |
+
```
|
| 216 |
+
src/openalex_utils.py β OpenAlex API integration
|
| 217 |
+
src/reliability.py β Edge reliability scorer
|
| 218 |
+
src/agents/explorer.py β Explorer agent
|
| 219 |
+
eval/archived/ β Directory for archived eval files
|
| 220 |
+
eval/archived/patch_contradiction.py β Moved here with README
|
| 221 |
+
```
|
| 222 |
+
|
| 223 |
+
### Files edited (minimal, surgical changes)
|
| 224 |
+
|
| 225 |
+
```
|
| 226 |
+
src/agents/critic.py β Reorder verdicts, use reliability scores
|
| 227 |
+
src/agents/synthesizer.py β Add trust summary block
|
| 228 |
+
src/agents/planner.py β Add follow-up detection
|
| 229 |
+
src/agents/retriever.py β Add OpenAlex calls alongside S2
|
| 230 |
+
src/retriever_utils.py β Add OpenAlex merge/dedup logic
|
| 231 |
+
src/state.py β Add new fields
|
| 232 |
+
graph.py β Add explorer node + edge
|
| 233 |
+
app.py β Add explorer toggle + trust summary display
|
| 234 |
+
```
|
| 235 |
+
|
| 236 |
+
---
|
| 237 |
+
|
| 238 |
+
## Part 6 β Edge Reliability Scoring (The Core Upgrade)
|
| 239 |
+
|
| 240 |
+
### The formula
|
| 241 |
+
|
| 242 |
+
```
|
| 243 |
+
edge_reliability(paper, query) =
|
| 244 |
+
(citation_centrality Γ 0.4)
|
| 245 |
+
+ (recency_signal Γ 0.3)
|
| 246 |
+
+ (content_coherence Γ 0.3)
|
| 247 |
+
```
|
| 248 |
+
|
| 249 |
+
### Signal definitions
|
| 250 |
+
|
| 251 |
+
**citation_centrality** (w1 = 0.4)
|
| 252 |
+
Paper 1: `min(1.0, log1p(cited_by_count) / log1p(10000))` β from OpenAlex
|
| 253 |
+
Paper 2: normalized `pagerank_global` from NASA KG β graph-native centrality
|
| 254 |
+
High centrality = foundational = high reliability regardless of age.
|
| 255 |
+
|
| 256 |
+
**recency_signal** (w2 = 0.3)
|
| 257 |
+
RECON's existing linear decay: `max(0, 1 - age/20)`
|
| 258 |
+
Now one of three inputs, not the entire signal.
|
| 259 |
+
|
| 260 |
+
**content_coherence** (w3 = 0.3)
|
| 261 |
+
LLM check: given 3 recent papers on the same topic (from last 3 years via OpenAlex search), ask "Does [older paper]'s central claim still represent current scientific understanding, or has it been superseded?"
|
| 262 |
+
Returns: float [0, 1] where 1 = fully current, 0 = fully superseded.
|
| 263 |
+
Batched: one LLM call for all papers being scored, not one per paper.
|
| 264 |
+
|
| 265 |
+
### Dominant signal labels
|
| 266 |
+
|
| 267 |
+
| Score Range | Label | Meaning |
|
| 268 |
+
|---|---|---|
|
| 269 |
+
| reliability β₯ 0.70 AND centrality β₯ 0.6 | FOUNDATIONAL | Old but highly cited, still current |
|
| 270 |
+
| reliability β₯ 0.60 AND recency β₯ 0.7 | CURRENT | Recent and well-supported |
|
| 271 |
+
| reliability 0.35β0.60 | DECLINING | Losing relevance, use with caution |
|
| 272 |
+
| reliability < 0.35 | SUPERSEDED | Outdated, newer work has replaced this |
|
| 273 |
+
|
| 274 |
+
### The foundational paper test (MUST PASS)
|
| 275 |
+
|
| 276 |
+
**Test case 1:** A 2003 paper with 10,000 citations on the same topic.
|
| 277 |
+
Expected: centrality = ~0.92, recency = 0.0 (age 23), coherence = 0.8 (still cited approvingly)
|
| 278 |
+
Reliability = 0.92Γ0.4 + 0.0Γ0.3 + 0.8Γ0.3 = 0.368 + 0 + 0.24 = **0.608 β CURRENT**
|
| 279 |
+
Correctly NOT flagged as stale despite extreme age.
|
| 280 |
+
|
| 281 |
+
**Test case 2:** A 2020 paper with 5 citations, contradicted by a 2023 paper.
|
| 282 |
+
Expected: centrality = ~0.12, recency = 0.7 (age 6), coherence = 0.1 (superseded)
|
| 283 |
+
Reliability = 0.12Γ0.4 + 0.7Γ0.3 + 0.1Γ0.3 = 0.048 + 0.21 + 0.03 = **0.288 β SUPERSEDED**
|
| 284 |
+
Correctly flagged despite being only 6 years old.
|
| 285 |
+
|
| 286 |
+
This test case pair is what makes the paper defensible. If the formula passes both, the metadata critique dies.
|
| 287 |
+
|
| 288 |
+
### Revised critic logic
|
| 289 |
+
|
| 290 |
+
```
|
| 291 |
+
OLD (v1):
|
| 292 |
+
1. FORCED_PASS if retry_count >= 2
|
| 293 |
+
2. INSUFFICIENT if len(papers) < 3
|
| 294 |
+
3. INSUFFICIENT if < 3 papers with hybrid_score >= 0.40
|
| 295 |
+
4. STALE if mean_age > 24 months β fires first, blocks #5
|
| 296 |
+
5. CONTRADICTED if LLM detects conflict β never reached
|
| 297 |
+
6. PASS
|
| 298 |
+
|
| 299 |
+
NEW (v2):
|
| 300 |
+
1. FORCED_PASS if retry_count >= 2
|
| 301 |
+
2. INSUFFICIENT if len(papers) < 3
|
| 302 |
+
3. INSUFFICIENT if < 3 papers with hybrid_score >= 0.40
|
| 303 |
+
4. Compute reliability scores for all papers
|
| 304 |
+
5. Run contradiction check (regardless of age)
|
| 305 |
+
6. Run reliability check (regardless of contradictions)
|
| 306 |
+
7. COMBINE:
|
| 307 |
+
- Both fire β CONTRADICTED (stronger signal)
|
| 308 |
+
- Only contradiction β CONTRADICTED
|
| 309 |
+
- Only low reliability β STALE
|
| 310 |
+
- Neither β PASS
|
| 311 |
+
```
|
| 312 |
+
|
| 313 |
+
No more short-circuiting. Both checks always run. The richer signal wins.
|
| 314 |
+
|
| 315 |
+
---
|
| 316 |
+
|
| 317 |
+
## Part 7 β Explorer Agent (The New Agent)
|
| 318 |
+
|
| 319 |
+
### What it does
|
| 320 |
+
|
| 321 |
+
After the synthesizer completes, the explorer reads the synthesis and asks: "What did this answer miss that a thorough researcher would want to know?"
|
| 322 |
+
|
| 323 |
+
### Behavior
|
| 324 |
+
|
| 325 |
+
1. **Input:** synthesized_position + retrieved_papers + original_query
|
| 326 |
+
2. **LLM call 1:** Identify 2-3 blind spots β angles, contradictions, or related phenomena the query didn't cover but the evidence touches on
|
| 327 |
+
3. **Relevance gate:** Score each blind spot question against the original query using the embedding model (all-MiniLM-L6-v2). Drop any with cosine similarity < 0.3.
|
| 328 |
+
4. **For each blind spot:** Run targeted search (S2 + OpenAlex, 3 papers each)
|
| 329 |
+
5. **LLM call 2-3:** One-paragraph answer per blind spot with citations
|
| 330 |
+
6. **Output:** 2-3 ExplorerFinding objects appended to output
|
| 331 |
+
|
| 332 |
+
### Example
|
| 333 |
+
|
| 334 |
+
User query: "What are the latest approaches to KV Cache compression in large language models?"
|
| 335 |
+
|
| 336 |
+
Explorer finds:
|
| 337 |
+
- "How does KV cache compression interact with speculative decoding?"
|
| 338 |
+
- "Are there hardware-specific optimization approaches (GPU memory hierarchy) not covered in algorithmic papers?"
|
| 339 |
+
- "The 2024 paper by Zhang et al. claims 4Γ compression with no quality loss β has this been independently replicated?"
|
| 340 |
+
|
| 341 |
+
### Design constraints
|
| 342 |
+
|
| 343 |
+
- **Optional:** Toggle in Gradio UI, default OFF
|
| 344 |
+
- **Append-only:** Explorer CANNOT modify the synthesis. If it finds contradicting evidence, it flags it but does not alter the main output.
|
| 345 |
+
- **Bounded:** Max 2-3 blind spots. Max 3-4 LLM calls.
|
| 346 |
+
- **Progressive output:** Main synthesis shows immediately. Explorer findings stream in below as they complete.
|
| 347 |
+
- **Light model option:** Use Llama 3.1 8B for question generation (cheaper, 14,400 RPD on Groq). Use 70B only for answer synthesis.
|
| 348 |
+
|
| 349 |
+
### Why this is novel
|
| 350 |
+
|
| 351 |
+
Searched the agentic RAG landscape thoroughly. Speculative RAG pre-fetches anticipated follow-ups. Self-RAG reflects on retrieval quality. CRAG corrects bad retrievals. None generate novel questions that the user didn't ask, search for answers, and present unexpected but relevant findings. This is a genuinely new agent pattern in the RAG taxonomy.
|
| 352 |
+
|
| 353 |
+
---
|
| 354 |
+
|
| 355 |
+
## Part 8 β Follow-Up System Upgrade
|
| 356 |
+
|
| 357 |
+
### Current state (v1)
|
| 358 |
+
- session_turns stores query + position + claims
|
| 359 |
+
- Planner injects last 3 prior queries to avoid repetition
|
| 360 |
+
- Follow-up queries start essentially fresh β papers from prior turns are gone
|
| 361 |
+
|
| 362 |
+
### Target state (v2)
|
| 363 |
+
|
| 364 |
+
**Step 1 β Follow-up detection**
|
| 365 |
+
Planner classifies incoming query as "new topic" or "follow-up" via LLM classification.
|
| 366 |
+
Signals: pronouns ("what about..."), topic overlap, explicit references ("you mentioned...").
|
| 367 |
+
Output: `is_followup` boolean in state.
|
| 368 |
+
|
| 369 |
+
**Step 2 β Context inheritance**
|
| 370 |
+
On follow-up: carry forward top 8 papers, previous verdict, previous claims as planner context.
|
| 371 |
+
Planner generates sub-questions targeting the GAP the follow-up implies, not rediscovering the whole topic.
|
| 372 |
+
On new topic: clean slate (current behavior).
|
| 373 |
+
|
| 374 |
+
**Step 3 β Paper accumulation with bounds**
|
| 375 |
+
Follow-up merges new papers with carried-forward papers, deduped by paper_id.
|
| 376 |
+
Cap total at 15 papers (top by hybrid_score). Prevents context overflow.
|
| 377 |
+
|
| 378 |
+
**Step 4 β Verdict evolution**
|
| 379 |
+
If previous verdict exists and new evidence changes the picture, critic explains what changed:
|
| 380 |
+
"Previous: PASS. Updated: STALE β new retrieval found primary source has been superseded."
|
| 381 |
+
|
| 382 |
+
**Step 5 β Sliding window**
|
| 383 |
+
Last 3 turns: full context (papers, claims, verdict).
|
| 384 |
+
Older turns: compressed to query + verdict + top 3 claims only.
|
| 385 |
+
Prevents token limit issues in sessions with 4+ turns.
|
| 386 |
+
|
| 387 |
+
---
|
| 388 |
+
|
| 389 |
+
## Part 9 β Feasibility Audit (Verified April 22, 2026)
|
| 390 |
+
|
| 391 |
+
### OpenAlex API β FEASIBILITY: GREEN (with caveat)
|
| 392 |
+
|
| 393 |
+
**Caveat: API key is now REQUIRED.** As of Feb 13, 2026, the polite pool / mailto parameter is deprecated. You must create a free account at openalex.org and use an API key.
|
| 394 |
+
|
| 395 |
+
**Free tier ($1/day):**
|
| 396 |
+
| Action | Daily Limit | Notes |
|
| 397 |
+
|---|---|---|
|
| 398 |
+
| Singleton lookup (by DOI) | Unlimited | This is what RECON needs most |
|
| 399 |
+
| List + filter | 10,000 calls | Searching by topic, year, etc. |
|
| 400 |
+
| Search (full-text) | 1,000 calls | Keyword/semantic search |
|
| 401 |
+
| Content download | 100 PDFs | Not needed for RECON |
|
| 402 |
+
|
| 403 |
+
**For RECON's use case:** Each query triggers ~3-6 OpenAlex searches (one per sub-question) + DOI lookups for enrichment. At 1,000 searches/day, RECON can handle ~166-333 queries/day. More than enough for both real-time use and full 130Q eval in a single day.
|
| 404 |
+
|
| 405 |
+
**Academic researchers:** Can request higher limits for free by emailing support@openalex.org. Worth doing once RECON is active.
|
| 406 |
+
|
| 407 |
+
**Implementation note:** Add `api_key` parameter to all requests. Store key in `.env` as `OPENALEX_API_KEY`. On HF Spaces, add as a secret.
|
| 408 |
+
|
| 409 |
+
### Semantic Scholar API β FEASIBILITY: GREEN
|
| 410 |
+
|
| 411 |
+
**Current RECON approach:** Uses `requests.get()` directly, likely unauthenticated.
|
| 412 |
+
**Recommendation:** Get a free API key for dedicated 1 RPS rate (vs shared pool).
|
| 413 |
+
**Rate limits:** Unauthenticated = shared pool ~100 req/5min. Authenticated = 1 RPS dedicated.
|
| 414 |
+
**RECON's current `sleep(1)` between calls:** Already respects the 1 RPS limit. No changes needed.
|
| 415 |
+
|
| 416 |
+
### Groq LLM API β FEASIBILITY: YELLOW (binding constraint)
|
| 417 |
+
|
| 418 |
+
**Free tier (April 2026):**
|
| 419 |
+
| Constraint | Llama 3.3 70B | Llama 3.1 8B |
|
| 420 |
+
|---|---|---|
|
| 421 |
+
| Requests/minute | 30 | 30 |
|
| 422 |
+
| Tokens/minute | 6,000 | 6,000 |
|
| 423 |
+
| Requests/day | 1,000 | 14,400 |
|
| 424 |
+
|
| 425 |
+
**LLM calls per query in v2:**
|
| 426 |
+
| Agent | Calls | Model |
|
| 427 |
+
|---|---|---|
|
| 428 |
+
| Planner | 1 | 70B |
|
| 429 |
+
| Critic | 1 | 70B |
|
| 430 |
+
| Synthesizer | 2 (synthesis + claims) | 70B |
|
| 431 |
+
| Reliability coherence (batched) | 1 | 70B or 8B |
|
| 432 |
+
| Explorer (if enabled) | 3-4 | 8B for questions, 70B for answers |
|
| 433 |
+
| **Total without explorer** | **5** | |
|
| 434 |
+
| **Total with explorer** | **8-9** | |
|
| 435 |
+
|
| 436 |
+
**Impact on daily limits:**
|
| 437 |
+
- Without explorer: 1,000 RPD Γ· 5 calls = **200 queries/day** on 70B
|
| 438 |
+
- With explorer (using 8B for light tasks): 1,000 RPD on 70B handles ~200 queries. 8B handles the explorer question generation separately (14,400 RPD).
|
| 439 |
+
- **For eval runs:** 130 questions Γ 5-9 calls = 650-1,170 calls. Fits within 1,000 RPD for 70B if explorer is disabled during eval. If not, split eval across 2 days.
|
| 440 |
+
|
| 441 |
+
**TPM constraint:** 6,000 TPM is tight. Each call uses ~800-2,000 tokens. 5 calls back-to-back could require 4,000-10,000 tokens, exceeding the per-minute budget. Mitigation: the existing `sleep(1)` between retriever calls creates natural spacing. Add similar spacing between LLM calls if 429s appear.
|
| 442 |
+
|
| 443 |
+
**Mitigation strategies:**
|
| 444 |
+
1. Use 8B for lighter tasks (explorer question generation, coherence checks)
|
| 445 |
+
2. Batch content coherence into one call (all papers at once, not per-paper)
|
| 446 |
+
3. Cache reliability scores β same paper in same session gets cached score
|
| 447 |
+
4. Existing backoff logic in eval handles 429s β extend to all LLM calls
|
| 448 |
+
5. Developer tier (free with credit card): up to 10x higher limits
|
| 449 |
+
|
| 450 |
+
### HF Spaces β FEASIBILITY: GREEN
|
| 451 |
+
|
| 452 |
+
Free tier: 2 vCPU, 16GB RAM. All LLM inference is on Groq, not local. Local compute: only embedding model (all-MiniLM-L6-v2) + retriever logic. Well within limits.
|
| 453 |
+
|
| 454 |
+
HF Space deploys from `main` branch. The `v2-edge-reliability` branch does not affect the live deployment until explicitly merged.
|
| 455 |
+
|
| 456 |
+
### Embedding Model β FEASIBILITY: GREEN
|
| 457 |
+
|
| 458 |
+
`all-MiniLM-L6-v2` is loaded once globally. Used for: semantic similarity in hybrid scoring + relevance gate in explorer. No additional model needed. Inference is local, fast, and free.
|
| 459 |
+
|
| 460 |
+
---
|
| 461 |
+
|
| 462 |
+
## Part 10 β Risk Matrix and Fallback Plan
|
| 463 |
+
|
| 464 |
+
### Risk 1: Explorer generates irrelevant questions
|
| 465 |
+
- **Probability:** Medium-High
|
| 466 |
+
- **Impact:** Low (explorer is append-only, doesn't touch synthesis)
|
| 467 |
+
- **Fallback:** Relevance gate using cosine similarity to original query (drop < 0.3). Cap at 2-3 findings. Toggle is the ultimate fallback β if consistently bad, default to OFF.
|
| 468 |
+
- **Design principle:** Explorer CANNOT modify the synthesis. If it fails, core output is intact.
|
| 469 |
+
|
| 470 |
+
### Risk 2: OpenAlex API unreliable
|
| 471 |
+
- **Probability:** Low (well-funded, 1.5B calls/month infrastructure)
|
| 472 |
+
- **Impact:** Medium (no cited_by_count for centrality signal)
|
| 473 |
+
- **Fallback:** OpenAlex is additive, not replacing S2. If down, fall back to S2's `citationCount` field. Wrap every call in try/except with 5s timeout. Cache results alongside S2 cache.
|
| 474 |
+
|
| 475 |
+
### Risk 3: Edge reliability changes hurt eval numbers
|
| 476 |
+
- **Probability:** Medium
|
| 477 |
+
- **Impact:** High (paper's headline number could drop)
|
| 478 |
+
- **Fallback:** Run both v1 and v2 scoring in parallel. Record both metrics. If v2 catch rate drops because foundational papers correctly stopped being flagged, that is a PRECISION improvement β the paper argues this. Worst case: report both and frame as "v2 trades recall for precision in temporal assessment."
|
| 479 |
+
|
| 480 |
+
### Risk 4: Branch diverges too far from main
|
| 481 |
+
- **Probability:** Low (if new-files strategy is followed)
|
| 482 |
+
- **Fallback:** New functionality in new files. Minimal edits to existing files. Merge Phase 1 to main early to reduce divergence. Do NOT refactor existing code while adding features.
|
| 483 |
+
|
| 484 |
+
### Risk 5: Explorer adds too much latency
|
| 485 |
+
- **Probability:** High (3-4 extra LLM calls + API calls)
|
| 486 |
+
- **Impact:** Medium (users on HF Space may not wait)
|
| 487 |
+
- **Fallback:** Explorer is opt-in (default OFF). Show synthesis immediately, explorer streams in below. Cap at 2 blind spots. Use 8B for question generation (faster, higher RPD).
|
| 488 |
+
|
| 489 |
+
### Risk 6: Groq rate limits hit more often
|
| 490 |
+
- **Probability:** Medium-High
|
| 491 |
+
- **Impact:** Medium (429 errors, degraded experience)
|
| 492 |
+
- **Fallback:** Extend existing eval backoff to all LLM calls. Batch coherence checks. Cache reliability scores. Split eval across 2 days. Consider Developer tier (free with credit card, 10x limits).
|
| 493 |
+
|
| 494 |
+
### Risk 7: Follow-up context exceeds token limits
|
| 495 |
+
- **Probability:** Medium (after 3-4 turns)
|
| 496 |
+
- **Impact:** Medium (degraded synthesis quality)
|
| 497 |
+
- **Fallback:** Sliding window: full context for last 3 turns, compressed for older. Paper cap at 15. Explorer findings not carried forward. Hard limit: if estimated context > 80% of model window, force summary and reset.
|
| 498 |
+
|
| 499 |
+
### Risk 8: Critic rewrite breaks passing tests
|
| 500 |
+
- **Probability:** Medium
|
| 501 |
+
- **Impact:** High (regression in existing results)
|
| 502 |
+
- **Fallback:** Run 130Q benchmark before AND after every critic change. Diff verdicts question by question. Keep v1 logic as a function for A/B testing. Log all disagreements between v1 and v2 critic.
|
| 503 |
+
|
| 504 |
+
### Risk 9: Explorer contradicts synthesizer
|
| 505 |
+
- **Probability:** Low-Medium
|
| 506 |
+
- **Impact:** This is a FEATURE, not a bug
|
| 507 |
+
- **Handling:** Explorer findings are labeled supplementary. If contradicting, flag it: "Note: this finding presents evidence that differs from the main synthesis." Do NOT auto-update synthesis.
|
| 508 |
+
|
| 509 |
+
---
|
| 510 |
+
|
| 511 |
+
## Part 11 β Publication Strategy (Path C)
|
| 512 |
+
|
| 513 |
+
### Paper 1 β RECON Standalone (solo arXiv cs.IR)
|
| 514 |
+
|
| 515 |
+
**Title direction:** "RECON: Edge Reliability Scoring for Temporally-Aware Scientific Retrieval"
|
| 516 |
+
|
| 517 |
+
**Core argument:** Temporal supersession is a first-class retrieval failure mode. RECON detects it using a three-signal reliability formula (citation centrality + recency + content coherence) that distinguishes foundational from stale papers. The explorer agent proactively discovers blind spots in retrieved evidence.
|
| 518 |
+
|
| 519 |
+
**Centrality signal:** OpenAlex `cited_by_count` (publicly available, anyone can reproduce)
|
| 520 |
+
**NOT:** `pagerank_global` from the NASA KG (reserved for Paper 2)
|
| 521 |
+
|
| 522 |
+
**Sections:**
|
| 523 |
+
1. Introduction β the temporal flatness problem in RAG
|
| 524 |
+
2. Related Work β CRAG, TG-RAG, T-GRAG, DEAN (all confirmed non-overlapping)
|
| 525 |
+
3. System Architecture β 7-node LangGraph, 5 agents
|
| 526 |
+
4. Edge Reliability Scoring β three-signal formula, foundational paper test
|
| 527 |
+
5. Explorer Agent β Socratic blind spot discovery
|
| 528 |
+
6. Evaluation β staleness catch rate, contradiction catch rate, position accuracy, calibration
|
| 529 |
+
7. Limitations β honest: single-domain benchmark, LLM-dependent coherence
|
| 530 |
+
8. Future Work β graph-native extension with heterogeneous KGs using pagerank_global
|
| 531 |
+
|
| 532 |
+
**Acknowledgment:** "We thank Prof. Armin Mehrabian (NASA GES-DISC) for suggesting the edge reliability reframe and for discussions on citation centrality that shaped the three-signal formula."
|
| 533 |
+
|
| 534 |
+
**Ask from Armin:** arXiv endorsement (first-time submitter)
|
| 535 |
+
|
| 536 |
+
### Paper 2 β Joint with Prof. Armin
|
| 537 |
+
|
| 538 |
+
**Title direction:** "Edge Reliability Scoring for Heterogeneous Scientific Knowledge Graphs"
|
| 539 |
+
|
| 540 |
+
**Centrality signal upgrade:** Replace `cited_by_count` with `pagerank_global` from NASA KG. Graph-native centrality is structurally richer than flat citation counts.
|
| 541 |
+
|
| 542 |
+
**Contributions:**
|
| 543 |
+
1. Edge reliability scorer applied to all Dataset β Publication edges in NASA KG
|
| 544 |
+
2. Staleness-weighted GraphSAGE training (edge weights in message passing, PyG SAGEConv supports natively)
|
| 545 |
+
3. Earth science supersession benchmark from dataset version chains (MERRA-2 v5 β v6, etc.)
|
| 546 |
+
4. Evaluation: weighted vs unweighted GNN on Dataset β ScienceKeyword link prediction
|
| 547 |
+
|
| 548 |
+
**Authorship:** Armin first, Mukul second. Clean split: he brings dataset, GNN, domain expertise, venue. Mukul brings the entire mechanism, code, eval harness, benchmark.
|
| 549 |
+
|
| 550 |
+
**Target venue:** Armin's preference β ECIR, SIGIR workshop, AGU, ESIP, or AI for Earth Science workshop.
|
| 551 |
+
|
| 552 |
+
### Papers 3+ (branching, future)
|
| 553 |
+
- Multi-domain benchmark suite (medical guidelines, legal precedent, climate policy)
|
| 554 |
+
- Predictive supersession (citation trajectory analysis β detect papers becoming stale before recognized)
|
| 555 |
+
- Temporal embedding fine-tuning (train `recon-temporal-mpnet` where year is a first-class embedding signal)
|
| 556 |
+
|
| 557 |
+
---
|
| 558 |
+
|
| 559 |
+
## Part 12 β Novelty Assessment (Verified via Literature Search)
|
| 560 |
+
|
| 561 |
+
### Genuinely novel in RECON v2
|
| 562 |
+
- **Edge reliability scoring** as a three-signal composite for RAG temporal assessment β no published system combines citation centrality + recency + LLM content coherence for trust scoring
|
| 563 |
+
- **Explorer agent** β proactive blind spot discovery in agentic RAG. No published system generates novel questions the user didn't ask and searches for answers
|
| 564 |
+
- **Staleness catch rate** as a formal RAG evaluation metric β no framework measures temporal supersession
|
| 565 |
+
- **Four-verdict taxonomy with failure-mode-specific query rewriting** β CRAG has relevance-based verdicts, not temporal ones
|
| 566 |
+
- **130-question superseded-claims benchmark** β no public benchmark targets this
|
| 567 |
+
|
| 568 |
+
### Not novel (don't claim)
|
| 569 |
+
- Multi-agent LangGraph pipelines
|
| 570 |
+
- Hybrid retrieval scoring (semantic + recency + authority)
|
| 571 |
+
- LLM-as-judge for RAG evaluation
|
| 572 |
+
- Using OpenAlex or S2 for paper retrieval
|
| 573 |
+
|
| 574 |
+
### Closest related work (all confirmed non-overlapping)
|
| 575 |
+
|
| 576 |
+
| Paper | What it does | Why RECON v2 is different |
|
| 577 |
+
|---|---|---|
|
| 578 |
+
| CRAG (Jan 2024) | Corrective RAG, relevance evaluator | No temporal supersession, no reliability scoring |
|
| 579 |
+
| TG-RAG (Oct 2025) | Temporal GraphRAG | Requires pre-existing edge timestamps β RECON infers them |
|
| 580 |
+
| T-GRAG (Aug 2025) | Dynamic GraphRAG temporal conflicts | Same timestamp requirement |
|
| 581 |
+
| DEAN (Feb 2024) | Outdated fact detection in KGs | Structural only, no LLM critic, no RAG, no citation centrality |
|
| 582 |
+
| FOS Benchmark (Nov 2025) | Temporal scientific graph benchmark | Predicts field pairings, not paper supersession |
|
| 583 |
+
| Speculative RAG | Pre-fetches anticipated follow-ups | Doesn't generate novel questions or discover blind spots |
|
| 584 |
+
|
| 585 |
+
---
|
| 586 |
+
|
| 587 |
+
## Part 13 β Implementation Checklist (Full, Ordered by Dependency)
|
| 588 |
+
|
| 589 |
+
### Phase 0 β Branch Setup (30 min)
|
| 590 |
+
```
|
| 591 |
+
β‘ Create branch v2-edge-reliability from main
|
| 592 |
+
β‘ Verify HF Space deploys from main only
|
| 593 |
+
β‘ Add CHANGELOG.md to branch
|
| 594 |
+
β‘ Copy this document to the branch as reference
|
| 595 |
+
```
|
| 596 |
+
|
| 597 |
+
### Phase 1 β Integrity + Critic Fix (3 days)
|
| 598 |
+
```
|
| 599 |
+
β‘ 1.1 Archive patch_contradiction.py β eval/archived/ with README
|
| 600 |
+
β‘ 1.2 Fix critic: run STALE + CONTRADICTED in parallel, combine signals
|
| 601 |
+
(see Part 6, "Revised critic logic")
|
| 602 |
+
β‘ 1.3 Re-run 130Q eval with fixed critic, record both catch rates
|
| 603 |
+
β‘ 1.4 Merge Phase 1 to main (safe β improves live system)
|
| 604 |
+
|
| 605 |
+
GATE: patch_contradiction archived, contradiction catch rate nonzero
|
| 606 |
+
```
|
| 607 |
+
|
| 608 |
+
### Phase 2 β Edge Reliability (2 weeks)
|
| 609 |
+
```
|
| 610 |
+
β‘ 2.1 Create src/openalex_utils.py
|
| 611 |
+
- search_openalex(query) β list of papers
|
| 612 |
+
- get_openalex_by_doi(doi) β enriched paper
|
| 613 |
+
- API key from env var OPENALEX_API_KEY
|
| 614 |
+
- try/except with 5s timeout, return empty on failure
|
| 615 |
+
β‘ 2.2 Integrate OpenAlex into retriever.py (merge with S2, dedup by DOI)
|
| 616 |
+
β‘ 2.3 Create src/reliability.py (three-signal scorer)
|
| 617 |
+
- Must pass foundational paper test (Part 6)
|
| 618 |
+
β‘ 2.4 Rewire critic to use reliability scores (Part 6, revised logic)
|
| 619 |
+
β‘ 2.5 Add trust summary to synthesizer output (per-paper block)
|
| 620 |
+
β‘ 2.6 Update Gradio UI for trust summary display
|
| 621 |
+
β‘ 2.7 Full 130Q eval with edge reliability system
|
| 622 |
+
β‘ 2.8 Test on 20 Earth science queries (Armin's domain)
|
| 623 |
+
|
| 624 |
+
GATE: foundational paper test passes, trust summary visible in UI
|
| 625 |
+
```
|
| 626 |
+
|
| 627 |
+
### Phase 3 β Explorer Agent (2 weeks)
|
| 628 |
+
```
|
| 629 |
+
β‘ 3.1 Create src/agents/explorer.py (Part 7)
|
| 630 |
+
- LLM call for blind spots
|
| 631 |
+
- Relevance gate (cosine sim > 0.3)
|
| 632 |
+
- Targeted search per blind spot
|
| 633 |
+
- LLM answer synthesis
|
| 634 |
+
β‘ 3.2 Add ExplorerFinding to state.py
|
| 635 |
+
β‘ 3.3 Wire explorer into graph.py (conditional on explore_mode)
|
| 636 |
+
β‘ 3.4 Add toggle to Gradio UI ("Deep exploration mode")
|
| 637 |
+
β‘ 3.5 Update export_md for explorer findings
|
| 638 |
+
|
| 639 |
+
GATE: explorer generates relevant findings, toggle works, non-redundant with synthesis
|
| 640 |
+
```
|
| 641 |
+
|
| 642 |
+
### Phase 4 β Follow-Up System (1 week)
|
| 643 |
+
```
|
| 644 |
+
β‘ 4.1 Follow-up detection in planner (LLM classification)
|
| 645 |
+
β‘ 4.2 Context inheritance (papers, verdict, claims from prior turn)
|
| 646 |
+
β‘ 4.3 Paper accumulation with cap (max 15)
|
| 647 |
+
β‘ 4.4 Verdict evolution (explain what changed)
|
| 648 |
+
β‘ 4.5 Sliding window (full context for 3 turns, compressed for older)
|
| 649 |
+
|
| 650 |
+
GATE: follow-ups build on prior context, no token overflow after 4+ turns
|
| 651 |
+
```
|
| 652 |
+
|
| 653 |
+
### Phase 5 β Paper 1 + Benchmark (3 weeks)
|
| 654 |
+
```
|
| 655 |
+
β‘ 5.1 Upload 130Q benchmark to HF as public dataset with card
|
| 656 |
+
β‘ 5.2 Test with second LLM backbone (Mixtral or similar)
|
| 657 |
+
β‘ 5.3 Write Paper 1 (6-8 pages, cs.IR)
|
| 658 |
+
β‘ 5.4 Email Armin with draft + updated HF Space link
|
| 659 |
+
(see Part 14 for email template)
|
| 660 |
+
β‘ 5.5 Request arXiv endorsement
|
| 661 |
+
β‘ 5.6 Submit to arXiv cs.IR
|
| 662 |
+
|
| 663 |
+
GATE: paper submitted, benchmark public, Armin endorses
|
| 664 |
+
```
|
| 665 |
+
|
| 666 |
+
### Phase 6 β Paper 2 with Armin (6-8 weeks)
|
| 667 |
+
```
|
| 668 |
+
β‘ 6.1 Get KG access from Armin
|
| 669 |
+
β‘ 6.2 Replace cited_by_count with pagerank_global
|
| 670 |
+
β‘ 6.3 Score all Dataset β Publication edges
|
| 671 |
+
β‘ 6.4 Pipe edge weights into GraphSAGE training
|
| 672 |
+
β‘ 6.5 Build Earth science supersession benchmark
|
| 673 |
+
β‘ 6.6 Write Paper 2 jointly
|
| 674 |
+
β‘ 6.7 Submit to venue Armin selects
|
| 675 |
+
|
| 676 |
+
GATE: paper submitted to agreed venue
|
| 677 |
+
```
|
| 678 |
+
|
| 679 |
+
### Phase 7 β Branching Out (ongoing)
|
| 680 |
+
```
|
| 681 |
+
β‘ 7.1 Multi-domain benchmark suite
|
| 682 |
+
β‘ 7.2 Predictive supersession (citation trajectory)
|
| 683 |
+
β‘ 7.3 Temporal embedding fine-tune
|
| 684 |
+
β‘ 7.4 RECON as drop-in critic layer (packaged module)
|
| 685 |
+
```
|
| 686 |
+
|
| 687 |
+
---
|
| 688 |
+
|
| 689 |
+
## Part 14 β Email to Armin (Send After Phase 2 Complete)
|
| 690 |
+
|
| 691 |
+
**Subject:** Re: RECON β progress update + slides incoming
|
| 692 |
+
|
| 693 |
+
```
|
| 694 |
+
Hi Prof. Armin,
|
| 695 |
+
|
| 696 |
+
Quick update on where things stand. I took your feedback
|
| 697 |
+
seriously and made real changes to the system, not just plans.
|
| 698 |
+
|
| 699 |
+
What's different since you last tried it:
|
| 700 |
+
|
| 701 |
+
β’ The staleness signal now uses three inputs instead of
|
| 702 |
+
just age: citation centrality (from OpenAlex), recency
|
| 703 |
+
decay, and an LLM content check. A highly cited older
|
| 704 |
+
paper keeps its reliability score. The "foundational
|
| 705 |
+
paper problem" you flagged is fixed.
|
| 706 |
+
|
| 707 |
+
β’ Every paper in the output now shows a trust summary β
|
| 708 |
+
reliability score, dominant signal, and a one-line
|
| 709 |
+
reason. You said you couldn't assess the validity of
|
| 710 |
+
the results last time. Try it again and tell me if
|
| 711 |
+
this helps.
|
| 712 |
+
|
| 713 |
+
β’ OpenAlex is in the retriever now alongside Semantic
|
| 714 |
+
Scholar, merged by DOI. Better Earth science coverage.
|
| 715 |
+
|
| 716 |
+
β’ I also added an exploration mode β the system
|
| 717 |
+
identifies angles the query didn't cover and searches
|
| 718 |
+
for those too. Optional toggle.
|
| 719 |
+
|
| 720 |
+
The HF Space is updated:
|
| 721 |
+
huggingface.co/spaces/MukulRay/recon
|
| 722 |
+
|
| 723 |
+
I'm writing this up as a paper for arXiv (cs.IR). The
|
| 724 |
+
edge reliability reframe you suggested is central to
|
| 725 |
+
the contribution, acknowledged in the paper. As a
|
| 726 |
+
first-time submitter I'll need an endorsement β would
|
| 727 |
+
you be open to that once you've seen the draft?
|
| 728 |
+
|
| 729 |
+
Also putting together the slides you asked for. Will
|
| 730 |
+
send those over separately so you can look through
|
| 731 |
+
them before we next talk.
|
| 732 |
+
|
| 733 |
+
Best,
|
| 734 |
+
Mukul
|
| 735 |
+
```
|
| 736 |
+
|
| 737 |
+
---
|
| 738 |
+
|
| 739 |
+
## Part 15 β Tech Stack Reference
|
| 740 |
+
|
| 741 |
+
| Component | Technology | Version/Notes |
|
| 742 |
+
|---|---|---|
|
| 743 |
+
| Orchestration | LangGraph | State machine, 7 nodes in v2 |
|
| 744 |
+
| LLM (primary) | Llama 3.3 70B via Groq | Planner (t=0.2), Critic (t=0.1), Synthesizer (t=0.3) |
|
| 745 |
+
| LLM (light tasks) | Llama 3.1 8B via Groq | Explorer question gen, coherence checks |
|
| 746 |
+
| Embeddings | all-MiniLM-L6-v2 | sentence-transformers, loaded once globally |
|
| 747 |
+
| Paper API 1 | Semantic Scholar | ~220M papers, API key recommended |
|
| 748 |
+
| Paper API 2 | OpenAlex | ~271M papers, API key REQUIRED, free account |
|
| 749 |
+
| Web search | DuckDuckGo (primary) | ddgs library, Tavily fallback |
|
| 750 |
+
| Database | SQLite | Sessions, turns, verdict log |
|
| 751 |
+
| Deployment | HF Spaces | Gradio UI, 2 vCPU, 16GB RAM |
|
| 752 |
+
| Version control | GitHub | main = live, v2-edge-reliability = dev branch |
|
| 753 |
+
| Eval | Custom harness | 5 architectures, 130Q, LLM-as-judge, crash-resume |
|
| 754 |
+
|
| 755 |
+
### Environment variables needed for v2
|
| 756 |
+
```
|
| 757 |
+
GROQ_API_KEY=... # Existing
|
| 758 |
+
OPENALEX_API_KEY=... # NEW β get from openalex.org/settings/api
|
| 759 |
+
S2_API_KEY=... # RECOMMENDED β get from semanticscholar.org/product/api
|
| 760 |
+
RECON_CACHE_DIR=/tmp/recon_cache # Existing (HF Spaces)
|
| 761 |
+
```
|
| 762 |
+
|
| 763 |
+
---
|
| 764 |
+
|
| 765 |
+
## Part 16 β The NASA EO Knowledge Graph (Prof's Dataset)
|
| 766 |
+
|
| 767 |
+
### What it is
|
| 768 |
+
150,351-node heterogeneous knowledge graph of NASA's Earth Observation ecosystem.
|
| 769 |
+
|
| 770 |
+
### Seven node types
|
| 771 |
+
| Node | Count (approx) | Key Fields |
|
| 772 |
+
|---|---|---|
|
| 773 |
+
| Dataset | Varies | globalId, doi, pagerank_global |
|
| 774 |
+
| Publication | ~12K | title, authors, year, doi, abstract, url, pagerank_global |
|
| 775 |
+
| ScienceKeyword | Varies | GCMD-controlled vocabulary |
|
| 776 |
+
| Instrument | Varies | AIRS, MODIS, etc. |
|
| 777 |
+
| Platform | Varies | Aqua, Terra, etc. |
|
| 778 |
+
| Project | Varies | MERRA-2, etc. |
|
| 779 |
+
| DataCenter | Varies | NASA DAACs |
|
| 780 |
+
|
| 781 |
+
### Critical schema facts
|
| 782 |
+
- Every node has: `globalId`, `doi`, `pagerank_global` plus type-specific fields
|
| 783 |
+
- **Relationship properties are null across all edge types** β no timestamps, no weights
|
| 784 |
+
- This is the core gap: all edges are treated as equally current
|
| 785 |
+
- The GNN trains on all edges equally β a 2008 paper and a 2024 paper contribute the same
|
| 786 |
+
|
| 787 |
+
### The GNN model
|
| 788 |
+
- Architecture: Heterogeneous GraphSAGE (PyTorch Geometric)
|
| 789 |
+
- Base embeddings: `nasa-impact/nasa-smd-ibm-st-v2` (fine-tuned)
|
| 790 |
+
- Task: Link prediction for missing Dataset β ScienceKeyword edges
|
| 791 |
+
- `pagerank_global` already on every node β key for Paper 2's edge reliability work
|
| 792 |
+
|
| 793 |
+
### Access
|
| 794 |
+
- HF dataset is public for download
|
| 795 |
+
- Formats: JSON (JSONL), GraphML, Cypher
|
| 796 |
+
- KG credentials for direct access need to come from Armin
|
| 797 |
+
|
| 798 |
+
---
|
| 799 |
+
|
| 800 |
+
## Part 17 β Coordination Model with Armin
|
| 801 |
+
|
| 802 |
+
| Phase | Interaction | What Mukul Shows | What Mukul Asks |
|
| 803 |
+
|---|---|---|---|
|
| 804 |
+
| Phase 1-2 | Solo work, no coordination | Slides + updated HF Space after Phase 2 | Nothing yet |
|
| 805 |
+
| Phase 5 | One touchpoint | Paper 1 draft | arXiv endorsement |
|
| 806 |
+
| Phase 6 | Real collaboration begins | Full mechanism, code, eval harness | KG access, domain guidance, venue selection |
|
| 807 |
+
| Phase 7+ | Independent again | Papers 3+ | Co-authorship if interested |
|
| 808 |
+
|
| 809 |
+
**Core principle:** Never ask before showing. Every ask comes after demonstrated progress.
|
| 810 |
+
|
| 811 |
+
---
|
| 812 |
+
|
| 813 |
+
## Part 18 β How To Use This Document
|
| 814 |
+
|
| 815 |
+
### In Claude.ai (web chat)
|
| 816 |
+
Paste this at the start of a new conversation:
|
| 817 |
+
> "Read RECON_V2_MASTER_CONTEXT.md. This is the complete context for the RECON v2 project. It supersedes the v1 master context for all upgrade work. Use this as ground truth for what's built, what's planned, what the risks are, and what order to build things. When you reference anything, cite the Part number."
|
| 818 |
+
|
| 819 |
+
### In Claude Code
|
| 820 |
+
Place this file in the repo root. Reference it at session start:
|
| 821 |
+
> "Read RECON_V2_MASTER_CONTEXT.md before doing anything."
|
| 822 |
+
|
| 823 |
+
### What this document does NOT cover
|
| 824 |
+
- Line-by-line code walkthrough (see the v1 RECON_MASTER_CONTEXT.md for that)
|
| 825 |
+
- The full conversation history with Armin (summarized in Part 4)
|
| 826 |
+
- Alternative approaches that were considered and rejected (documented in prior Claude conversations)
|
| 827 |
+
|
| 828 |
+
---
|
| 829 |
+
|
| 830 |
+
## Part 19 β Version History
|
| 831 |
+
|
| 832 |
+
| Date | Change |
|
| 833 |
+
|---|---|
|
| 834 |
+
| April 22, 2026 | Initial v2 master context created. Incorporates: v1 code audit findings, Armin's 5-point feedback, edge reliability formula, explorer agent design, follow-up system plan, full feasibility audit (OpenAlex API key requirement, Groq rate limits, S2 limits), risk matrix with 9 identified risks, publication strategy (Path C: two papers with clean boundary), and complete implementation checklist across 7 phases. |
|