How paladin316/byo-secai works
Project type and purpose
• This is a local-first AI assistant for cybersecurity research. It orchestrates a large language model (Ollama) and a web UI (OpenWebUI/Streamlit) plus custom “plugin” scripts for threat hunting, detection, and incident response. It also offers a Retrieval-Augmented Generation (RAG) ingest/query pipeline.
File structure
• Top level:
• Batch launchers (.bat) for different modes (CLI, Streamlit UI, RAG)
• config.py / config.yaml – central configuration
• data/ – sample or user data for ingestion
• docs/, CONTRIBUTING.md, LICENSE – project docs
• logs/ – runtime logs (e.g., ingestion_log.txt)
• plugin_loader.py + plugins/ – dynamic plugin architecture
• scripts/ – orchestration scripts (LLM orchestrator, RAG ingest/query, UI runner, installation helpers)
README for additional insights
• Stacks: Python 3.10, Docker, Ollama (phi model), OpenWebUI, Streamlit
• Purpose: Local security assistant with plugin-driven threat-intel lookups and RAG
Main components & their interactions
a. User Interfaces
– CLI (Launch_CLI_Assistant.bat → python scripts/llm_orchestrator_with_plugins.py)
– Streamlit RAG UI (Launch_Streamlit_UI.bat → scripts/streamlit_rag_ui.py)
– OpenWebUI (Docker container connecting to Ollama endpoint)
b. Core Orchestrator
– plugin_loader.py loads plugin modules (abuseipdb.py, urlscan.py, virustotal.py, yara_scanner.py)
– scripts/llm_orchestrator_with_plugins.py routes user prompts → plugins → LLM
c. LLM Host
– Ollama (phi model) running in Docker, exposed on localhost:11434
– OpenWebUI connects to that host for visual interface
d. RAG Pipeline
– scripts/rag_ingest_and_query.py builds vector index from data/ and docs/
– scripts/rag_safety_checklist.py supplies audit checks
– Query flow: UI or CLI → RAG query script → vector store → LLM
e. Data & Configuration
– config.yaml / config.py – define model endpoint, plugin settings
– data/ – source docs, example.txt
– logs/ – ingestion_log.txt, other logs
f. External Services
– AbuseIPDB, URLScan.io, VirusTotal (via plugins)
Architectural patterns & design principles
• Plugin architecture: plugin_loader.py dynamically imports threat-intel connectors
• Pipeline pattern: separation of ingest (index creation) vs. query
• Local-first, container-backed LLM hosting
• Single‐binary “orchestrator” microservice (Python) with distinct UI runners