Commit Graph
5 Commits
Author SHA1 Message Date
Dushnilin 3ead229264 feat(fuzzer): add RAG knowledge base and LLM-powered strategy synthesizer 2026-08-26 22:50:12 +03:00
Dushnilin 421a4fd796 feat: add RAG (Retrieval-Augmented Generation) for AI Doctor
New files:
- tools/rag_build_index.sh: build-time ingestion pipeline
  Chunks docs/knowledge-base/*.md into 2000-char chunks with 200-char overlap
  Produces rag_index.json (39 chunks, ~74KB) for runtime embedding
- tachyon/files/usr/lib/diagnostics/rag.uc: runtime RAG module
  Embeds chunks via same LLM provider API (OpenAI-compatible /v1/embeddings)
  Cosine similarity search, top-3 retrieval, 24h cache in /tmp
  Graceful fallback if embedding API unavailable
- tachyon/files/usr/lib/tachyon/rag_index.json: pre-built chunk index

Modified files:
- runtime.uc: integrated RAG into ai_doctor() function
  Retrieves relevant docs based on user query or diagnostic context
  Injects 'Relevant Documentation' section into LLM prompt
- renderAdvancedSettings.ts: added 'Enable RAG' toggle in AI Doctor settings
- tachyon config: added enable_rag option (default '1')
- build.sh: added rag_build_index.sh step

Architecture:
- Provider-agnostic: uses same API key/provider as LLM for embeddings
- Embedding model: text-embedding-3-small (OpenAI), nomic-embed-text (Ollama),
  local-model (LMStudio), deepseek-embedding (DeepSeek)
- Cache: embeddings cached in /tmp/tachyon_rag_embeddings.json (24h TTL)
- Fallback: if embedding fails, AI Doctor works without RAG (as before)
- 39 chunks from 14 docs, ~66K chars, cosine search <1ms

623 tests pass (101 backend + 522 frontend)
2026-08-20 10:27:56 +03:00
Dushnilin 7a10fc9486 installer: inline TUI, remove tools dir, remove installer_tui.sh 2026-08-03 14:55:02 +03:00
Dushnilin 7345515902 fix(po2lmo): исправлена хеш-функция sfh_hash в po2lmo.js 2026-08-01 18:43:22 +03:00
Dushnilin 1c535dd1b9 fix: исправлены переводы описаний AI Watchdog в LuCI settings.js 2026-08-01 17:11:23 +03:00