@@ -308,6 +308,180 @@ After 25 iterations, top-scoring nodes are deep-read using GPT-4o vision on actu
308308
309309---
310310
311+ ## Roadmap
312+
313+ - [ ] ** Adaptive MCTS**
314+ Dynamically adjust iterations based on confidence. Stop early when the tree converges, explore deeper when scores are ambiguous. Prune low-scoring branches instead of revisiting them.
315+ ```
316+ Current: Always runs 25 iterations → wastes calls on easy queries
317+ Adaptive: Easy query → 8 iterations (converged early, saved 68% cost)
318+ Hard query → 40 iterations (low confidence, kept exploring)
319+ ```
320+
321+ - [ ] ** Multi-Hop Reasoning Chains**
322+ Chain MCTS searches where each hop informs the next. The tree remembers which branches were relevant across hops.
323+ ```
324+ User: "What was Q3 budget vs the Q1 projection?"
325+
326+ Hop 1: MCTS → finds "Q3 Financial Summary" (pp.12-15) → extracts $4.2M
327+ Hop 2: MCTS → searches with context "find Q1 projection to compare with $4.2M"
328+ → finds "Q1 Forecast" (pp.3-4) → extracts $3.8M projected
329+ Answer: "Q3 actual ($4.2M) exceeded Q1 projection ($3.8M) by 10.5%"
330+ ```
331+
332+ - [ ] ** Absence Detection**
333+ Exhaustively explore the tree to prove something * doesn't* exist. Vector RAG can never confirm absence — MCTS can.
334+ ```
335+ User: "Does this contract have a non-compete clause?"
336+
337+ MCTS: Visited 47/47 sections across 25 iterations
338+ Coverage: 100% of document tree explored
339+ Matches: 0 sections with relevance > 0.3
340+ Answer: "No non-compete clause found. Searched all 47 sections
341+ with full coverage. The contract covers: IP assignment,
342+ confidentiality, termination — but no non-compete."
343+ ```
344+
345+ - [ ] ** Structural Queries**
346+ Answer questions about document * structure* , not just content. MCTS navigates the actual hierarchy — flat embeddings can't.
347+ ```
348+ User: "What comes after the methodology section?"
349+
350+ Tree traversal:
351+ Root
352+ ├── 1. Introduction
353+ ├── 2. Literature Review
354+ ├── 3. Methodology ← found
355+ ├── 4. Results & Analysis ← next sibling
356+ └── 5. Conclusion
357+
358+ Answer: "Chapter 4: Results & Analysis (pp.18-31) follows
359+ the Methodology section. It covers three subsections:
360+ 4.1 Quantitative Results, 4.2 Qualitative Findings..."
361+ ```
362+
363+ - [ ] ** Confidence-Bounded Answers**
364+ Return interpretable confidence metrics: nodes visited vs total, convergence status, and score distribution.
365+ ```
366+ User: "What were the key risks identified?"
367+
368+ Search stats:
369+ Nodes visited: 38/47 (81% coverage)
370+ Converged: Yes (iteration 19 of 25)
371+ Top matches: 3 nodes, all in Chapter 6
372+ Score spread: 0.92, 0.89, 0.85 (tight cluster = high confidence)
373+
374+ Answer: "Key risks identified (94% confidence): ..."
375+ ```
376+
377+ - [ ] ** Progressive Drill-Down**
378+ Resume the MCTS tree across follow-up queries instead of starting fresh. The tree is a persistent search state.
379+ ```
380+ User: "Give me an overview of this report"
381+ MCTS: Explores level 1 nodes → returns top-level summary
382+ Tree state saved ✓
383+
384+ User: "Tell me more about the financial section"
385+ MCTS: Resumes from saved tree → deepens into "Finance" subtree
386+ Skips already-explored branches → finds subsections
387+ Tree state updated ✓
388+
389+ User: "Specifically the Q3 projections"
390+ MCTS: Resumes → drills into Finance > Q3 > Projections leaf
391+ 3 queries, 1 tree, zero redundant exploration
392+ ```
393+
394+ - [ ] ** Streaming Responses (SSE)**
395+ Real-time answer generation with live phase indicators instead of 5-10s blank screen.
396+ ```
397+ [0.0s] ● Routing to folder "Project Zenith" (confidence: 94%)
398+ [0.8s] ● Phase 1: Selecting documents... budget.pdf ✓ proposal.pdf ✓
399+ [2.1s] ● Phase 2: Searching budget.pdf — iteration 12/25
400+ [3.4s] ● Phase 2: Searching proposal.pdf — iteration 18/25
401+ [4.2s] ● Deep reading pages 5-8 of budget.pdf...
402+ [5.8s] ● Generating answer...
403+ [6.1s] The total project cost was $812,000, broken down as...
404+ ```
405+
406+ - [ ] ** Comparative Cross-Document Analysis**
407+ Run parallel tree searches with a shared objective across multiple documents, finding the same structural section in each.
408+ ```
409+ User: "How do these three vendor contracts differ on liability?"
410+
411+ Parallel MCTS:
412+ Contract A → "Section 8: Liability" (pp.12-14) → cap at $500K
413+ Contract B → "Section 6: Liability" (pp.9-10) → uncapped
414+ Contract C → "Section 9: Liability" (pp.15-17) → cap at $1M
415+
416+ Answer:
417+ | Clause | Vendor A | Vendor B | Vendor C |
418+ |---------------|------------|------------|------------|
419+ | Liability cap | $500K | Uncapped ⚠ | $1M |
420+ | Indemnity | Mutual | One-way | Mutual |
421+ | Insurance req | $2M | None ⚠ | $5M |
422+ ```
423+
424+ - [ ] ** Query Decomposition**
425+ Automatically break complex queries into sub-queries, each targeting a specific subtree.
426+ ```
427+ User: "Compare the methodology, results, and cost of Paper A vs Paper B"
428+
429+ Decomposed into 6 parallel searches:
430+ Paper A → "Methodology" subtree ──┐
431+ Paper A → "Results" subtree ──┼── synthesize
432+ Paper A → "Cost" subtree ──┤ comparison
433+ Paper B → "Methodology" subtree ──┤
434+ Paper B → "Results" subtree ──┤
435+ Paper B → "Cost" subtree ──┘
436+
437+ Answer: Structured comparison across all three dimensions
438+ ```
439+
440+ - [ ] ** Contradiction Detection**
441+ Systematically compare claims across sections of a document. Search for the same topic in every branch, extract stated figures, flag inconsistencies.
442+ ```
443+ User: "Are there any contradictions in this report?"
444+
445+ MCTS scans all branches for overlapping claims:
446+ ⚠ Revenue conflict:
447+ Page 12 (Executive Summary): "Annual revenue: $4.2M"
448+ Page 38 (Financial Details): "Total revenue: $3.8M"
449+ ⚠ Timeline conflict:
450+ Page 5 (Overview): "Project started March 2024"
451+ Page 22 (Timeline): "Kickoff date: January 2024"
452+ ✓ Headcount consistent: 47 employees (mentioned 3 times)
453+ ```
454+
455+ - [ ] ** Multi-Provider LLM Support**
456+ Swap between OpenAI, Claude, Gemini, and local models (Ollama).
457+ ``` python
458+ # .env — just change the provider
459+ LLM_PROVIDER = anthropic # or: openai, google, ollama
460+ SEARCH_MODEL = claude- haiku- 4 - 5 # cheap model for MCTS
461+ ANSWER_MODEL = claude- sonnet- 4 - 6 # heavy model for answers
462+
463+ # Local mode — no API costs
464+ LLM_PROVIDER = ollama
465+ SEARCH_MODEL = llama3:8b
466+ ANSWER_MODEL = llama3:70b
467+ ```
468+
469+ - [ ] ** Persistent Chat History**
470+ SQLite-backed conversations with named sessions, search over past Q&A, and session continuity across restarts.
471+ ```
472+ User: "Show my recent sessions"
473+
474+ Sessions:
475+ 1. "Q3 Budget Analysis" — 12 messages, 3 docs (2h ago)
476+ 2. "Contract Review" — 8 messages, 5 docs (yesterday)
477+ 3. "Research Paper Notes" — 24 messages, 2 docs (3 days ago)
478+
479+ User: "Resume session 2"
480+ → Restores full chat history + MCTS tree states
481+ ```
482+
483+ ---
484+
311485## License
312486
313487[ MIT] ( LICENSE )
0 commit comments