Focus: Hariom's approach (PR 434)
Branch: Chatbot_Enhancements
Date: March 2025
| Document | Author | Focus |
|---|---|---|
| Project Context.pdf | Synthesis | Rationale, problems, comparison of 3 interns, proposed Federated Knowledge Sync |
| 5 hariom.pdf | Hariom Thakur | Full technical report: RAG, vision, FACT-based netlist, PyQt5 integration, automated error capture |
| 18 radhika goyal.pdf | Radhika Goyal | Rule-based fault identification, static schematic/netlist analysis, cross-validation |
| 1 Nicholas_Coutinho.pdf | Nicholas Coutinho | Conversational memory, topic discontinuity, context retention |
| Aspect | Radhika | Nicholas | Hariom |
|---|---|---|---|
| Intelligence | Proactive static analysis, rule-based | Conversational memory, topic discontinuity | FACT-based netlist, strict RAG grounding |
| UI Integration | Standard chat | Standard chat | Deep PyQt5: dock, toolbar, context menus, auto error capture |
| Multimodal | Text + image | Text + image | Text + image + voice (Vosk) |
| Tech stack | Broad | Broad | Specific: qwen2.5:3b, minicpm-v, nomic-embed-text, ChromaDB |
Project Context conclusion: Hariom's approach is best for practical deployment & user experience due to deep integration, automated error capture, and voice STT.
┌─────────────────────────────────────────────────────────────────────────┐
│ Presentation Layer (PyQt5) │
│ • Application.py: toolbar, openChatbot(), errorDetectedSignal │
│ • Chatbot.py: dock widget, chat UI, input, image/voice buttons │
│ • ProjectExplorer.py: context menu "Analyze this Netlist" │
│ • DockArea.py: createchatbotdock() │
└─────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Processing Layer (chatbot_core.py) │
│ • classify_question_type() → routing │
│ • handle_esim_question(), handle_image_query(), handle_netlist_analysis()│
│ • handle_follow_up(), handle_simple_question() │
└─────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Data Layer │
│ • knowledge_base.py: ChromaDB, search_knowledge() │
│ • image_handler.py: PaddleOCR + MiniCPM-V │
│ • Chatbot.py: FACT-based netlist detection (_detect_floating_nodes, etc) │
│ • error_solutions.py: pattern → fixes mapping │
│ • ollama_runner.py: run_ollama(), run_ollama_vision(), get_embedding() │
│ • stt_handler.py: Vosk offline STT │
└─────────────────────────────────────────────────────────────────────────┘
| Feature | Status | Location |
|---|---|---|
| Intelligent Router | ✅ | chatbot_core.py – classify_question_type() |
| RAG (ChromaDB) | ✅ | knowledge_base.py – search_knowledge() |
| FACT-based netlist | ✅ | Chatbot.py – _detect_floating_nodes, _detect_missing_models, etc. |
| Vision (PaddleOCR + MiniCPM-V) | ✅ | image_handler.py – analyze_and_extract() |
| Voice (Vosk) | ✅ (optional) | stt_handler.py |
| Project Explorer context menu | ✅ | ProjectExplorer.py – "Analyze this Netlist" |
| Automated error capture | ✅ | Application.py – errorDetectedSignal → send_error_to_chatbot |
| Dockable chat | ✅ | Chatbot.py, DockArea.py |
| Error pattern matching | ✅ | error_solutions.py – ERROR_SOLUTIONS dict |
- Model capability constraints: qwen2.5:3b struggles with complex multi-step reasoning; minicpm-v misinterprets complex topologies; 2048-token context limit.
- Performance on low-end hardware: 8GB RAM minimum; vision can take 10+ seconds on older CPUs.
- Scope limitations: No training mode; fixed knowledge base; cannot dynamically add new docs.
- PaddleOCR: Often fails on first run (no
paddlemodule) – vision falls back to partial OCR. - Netlist contract: Missing
manuals/esim_netlist_analysis_output_contract.txtin some setups.
Current: Copilot suggests fixes; user must manually edit in Spice Editor.
Proposal: Add "Apply fix" button that auto-inserts suggested fixes into .cir.out:
- Add missing
.modelstatements - Add
.options gmin=1e-12 reltol=0.01for singular matrix - Add 1G resistors for floating nodes (as comments with copy-paste snippet)
Implementation: Extend Chatbot.py – parse FACT output, generate patch, offer "Insert into netlist" action.
Current: User must open Copilot and ask.
Proposal: Optional "live hints" during schematic capture – e.g. when floating pin detected, show small tooltip: "R1 pin 2 is unconnected."
Implementation: Requires KiCad callback or periodic checks; may need eSim/KiCad integration points.
Current: One image or netlist at a time.
Proposal: Allow selecting multiple .cir.out files or pasting multiple images; run analysis in batch; report summary.
Implementation: Extend Chatbot.py – analyze_specific_netlist() accepts list; handle_image_query() can process multiple paths.
Current: knowledge_base.py returns top 4 chunks; no explicit cosine similarity filter.
Proposal: Add relevance threshold (e.g. cosine similarity > 0.3) – Hariom's report mentions this; filter out low-similarity chunks to reduce hallucination.
Implementation: ChromaDB query returns distances; filter by threshold before context assembly.
Current: Netlist analysis uses FACT blocks; contract file may be missing.
Proposal: Ensure contract is always available; bundle esim_netlist_analysis_output_contract.txt in repo; add fallback inline prompt if file missing.
Implementation: Copy contract to src/manuals/ or src/frontEnd/manuals/; ensure Chatbot.py loads from correct path.
Current: Hardcoded qwen2.5:3b, minicpm-v.
Proposal: Allow user to choose model in settings (e.g. llama3, deepseek-coder for code-heavy tasks).
Implementation: Add ollama_model config; pass to run_ollama().
Proposal: After simulation succeeds, analyze output and suggest improvements (e.g. "Add capacitor for stability").
Implementation: Parse .raw or simulation output; integrate with plotting tools; add optional "optimization" analysis mode.
Proposal: (Radhika's strength) – cross-validate schematic vs netlist before simulation; detect mismatches early.
Implementation: Hook into eSim's netlist generation; run static analysis on generated netlist before user runs simulation.
Proposal: Improve topic discontinuity detection; add reference resolution for "this", "that", "it".
Implementation: Refine _is_follow_up_question() and is_semantic_topic_switch(); use embedding similarity for pronoun resolution.
Proposal: When user fixes an error after Copilot failed, prompt: "What did you change?" – store locally; optionally sync anonymously to FOSSEE server; server clusters fixes; push updates to ChromaDB.
Implementation: Large; requires server, encryption, consent UI. Defer to long-term.
-
Autonomous design assistance: Circuit synthesis from specs.
-
Research platform: Dataset from anonymized interactions; benchmarking suite.
-
Ecosystem expansion: Port to OpenModelica, Scilab; plugin architecture.
| Priority | Enhancement | Effort | Impact |
|---|---|---|---|
| 1 | RAG relevance threshold | Low | High (reduces hallucination) |
| 2 | Netlist contract bundling | Low | Medium (fixes missing contract) |
| 3 | One-click netlist fix | Medium | High (UX) |
| 4 | Batch netlist analysis | Low | Medium |
| 5 | Model selection in settings | Low | Medium |
| 6 | Enhanced conversation memory | Medium | Medium |
| 7 | Batch image processing | Low | Low |
| 8 | Real-time KiCad hints | High | Medium |
- Add relevance threshold to
search_knowledge()– filter by distance/similarity. - Bundle netlist contract – ensure
esim_netlist_analysis_output_contract.txtis insrc/manuals/orsrc/frontEnd/manuals/and loaded correctly. - Improve error message clarity – when PaddleOCR fails, show: "Vision analysis unavailable. Text and netlist analysis still work."
- Add "Copy to clipboard" for netlist fixes – so user can paste without manual retyping.
| File | Purpose |
|---|---|
src/chatbot/chatbot_core.py |
Router, handlers, classification |
src/chatbot/knowledge_base.py |
ChromaDB, search_knowledge |
src/chatbot/ollama_runner.py |
Ollama API, embeddings |
src/chatbot/image_handler.py |
PaddleOCR, MiniCPM-V |
src/chatbot/stt_handler.py |
Vosk STT |
src/chatbot/error_solutions.py |
Error pattern → fixes |
src/frontEnd/Chatbot.py |
UI, netlist FACT detection, analyze_specific_netlist |
src/frontEnd/Application.py |
errorDetectedSignal, openChatbot |
src/frontEnd/ProjectExplorer.py |
Context menu |