feat(core): initial commit unified architecture (scud_ai v2.5 with modular web_api)

This commit is contained in:
2026-08-14 15:01:50 +03:00
commit cc12397e29
59 changed files with 11031 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import os
from core.database import get_all_rules_from_db, add_rule_to_db
def load_knowledge_base():
"""
Загружает актуальные правила Базы Знаний компании напрямую из базы данных SQLite.
"""
rules = get_all_rules_from_db()
return {
"rules": rules if rules else [],
"fio_corrections": {}
}
def add_rule_to_kb(new_rule):
"""
Добавляет новое принятое человеком правило в SQLite таблицу ai_knowledge_base.
"""
if not new_rule or not new_rule.strip():
return
add_rule_to_db(new_rule.strip(), added_by="Human")
print(f"[✓] База знаний SQLite успешно обновлена! Новое правило: {new_rule.strip()}")