SecOps is a professional-grade AI-powered Security Operations Copilot that combines advanced RAG (Retrieval-Augmented Generation) with security-focused extensions. It provides intelligent answers to security questions with citations, trust scores, and source validation.
- π€ Advanced RAG System: CRAG-style self-correcting synthesis with citations
- π Multi-Source Search: Vector store, web search, and CVE database integration
- β Trust Scoring: Every answer includes trust scores and source validation
- π Citation Management: Automatic citation extraction with URL health checks
- π§ Extensions Ready: Modular system for security operations
- π Auth & Storage: Full user management with Supabase
- π¨ Modern UI: Beautiful, responsive interface with Tailwind + shadcn/ui
Backend:
- FastAPI (Python 3.11+)
- Async architecture with dependency injection
- Supabase (PostgreSQL + Auth + Storage)
- Qdrant or pgvector for vector storage
- OpenAI, Anthropic, Gemini support
Frontend:
- Next.js 14
- React with TypeScript
- Tailwind CSS + shadcn/ui
- Responsive chat interface
secops/
βββ backend/ # FastAPI Backend
β βββ src/
β β βββ api/ # API routes
β β βββ rag_engine/ # Advanced RAG system
β β βββ extensions/ # Security extensions
β β βββ services/ # LLM, vector, Supabase
β β βββ utils/ # Config, logging, caching
β βββ main.py
β βββ requirements.txt
β βββ Dockerfile
β βββ schema.sql
β
βββ app/ # Next.js Frontend
β βββ app/
β β βββ page.js # Homepage
β β βββ login/ # Login page
β β βββ dashboard/ # Dashboard
β βββ components/
β β βββ Navbar.js
β β βββ Sidebar.js
β β βββ ChatUI.js
β β βββ CitationPanel.js
β βββ package.json
β
βββ README.md
- Node.js 18+
- Python 3.11+
- Supabase account (for production)
- (Optional) Qdrant for vector storage
cd app
yarn install
yarn devAccess the frontend at http://localhost:3000
cd backend
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your configuration
uvicorn main:app --reload --port 8000Access the API at http://localhost:8000 API docs at http://localhost:8000/docs
Create backend/.env from backend/.env.example:
# LLM Providers
OPENAI_API_KEY=your-key
ANTHROPIC_API_KEY=your-key
GEMINI_API_KEY=your-key
DEFAULT_LLM_PROVIDER=mock # Change to openai, anthropic, or gemini
# Supabase
SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-anon-key
SUPABASE_SERVICE_KEY=your-service-key
# Vector Store
VECTOR_STORE_TYPE=mock # Change to qdrant or supabase_pgvectorCreate app/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000- Ask security and DevOps questions in natural language
- Get detailed answers with citations and trust scores
- Automatic source validation and URL health checks
Search Phase:
- Multi-source search orchestration
- Vector similarity search
- Web and CVE database integration
Synthesis Phase:
- CRAG-style self-correcting synthesis
- Citation-aware answer generation
- Trust score calculation
Citation Phase:
- Automatic citation extraction
- Source validation
- URL health checking
Validation Phase:
- Self-correction mechanisms
- Answer quality validation
- Log Analysis: Intelligent log parsing and issue detection
- System Health: Automated health monitoring
- CVE Summary: Vulnerability analysis and summaries
- Security Recommendations: AI-powered security advice
- Cluster Config Review: Configuration validation
- Supabase authentication
- User profiles and settings
- Query history tracking
- Document upload and management
curl -X POST http://localhost:8000/api/rag/query \
-H "Content-Type: application/json" \
-d '{
"question": "What is CVE-2024-1234?",
"user_id": "user-123"
}'curl -X POST http://localhost:8000/api/extensions/analyze-logs \
-H "Content-Type: application/json" \
-d '{
"extension_type": "log_analysis",
"parameters": {
"log_data": "Error: Connection timeout..."
}
}'# Build and run backend
cd backend
docker build -t secops-backend .
docker run -p 8000:8000 --env-file .env secops-backend
# Build and run frontend
cd app
docker build -t secops-frontend .
docker run -p 3000:3000 secops-frontend- Push code to GitHub
- Connect repository to Railway
- Deploy backend and frontend as separate services
- Set environment variables in Railway dashboard
# Backend
cd backend
fly launch
fly deploy
# Frontend
cd app
fly launch
fly deploy- Create two Web Services (backend and frontend)
- Connect repository
- Configure build and start commands
- Set environment variables
- Create a new project at https://supabase.com
- Navigate to SQL Editor
- Run the SQL from
backend/schema.sql - Enable pgvector extension:
CREATE EXTENSION IF NOT EXISTS vector;
- Copy your project URL and keys to
.env
For dedicated vector storage:
# Using Docker
docker run -p 6333:6333 qdrant/qdrant
# Or use Qdrant Cloud at https://cloud.qdrant.io- Full architectural skeleton
- All class definitions and interfaces
- API route structure
- Frontend UI components
- Mock implementations for testing
- Configuration system
- Type definitions
- Database schema
- Real RAG engine logic (stubs ready)
- LLM integrations (interfaces ready)
- Search implementations (mock available)
- Citation processing logic (stubs ready)
- Extension implementations (stubs ready)
- Authentication logic (routes ready)
- Implement RAG Engine: Add advanced logic to RAG engine files
- Connect LLM Providers: Implement real LLM client logic
- Add Search Integration: Implement web search and CVE database
- Complete Citations: Add citation extraction and validation
- Build Extensions: Implement security extension logic
- Add Auth: Complete Supabase authentication
The system is designed for easy extension:
- Add LLM Provider: Implement
LLMClientProtocolinterface - Add Extension: Extend
ExtensionsOrchestrator - Add Search Source: Extend
SearchOrchestrator - Add Vector Store: Implement
VectorStoreProtocol
All interfaces and protocols are defined and ready for implementation.
The entire codebase is designed to be:
- β Self-contained
- β Docker-ready
- β Environment-configurable
- β Cloud-agnostic
- β Fully exportable
Simply clone the repository and follow the setup instructions above.
MIT License - Feel free to use for personal and commercial projects.
For issues, questions, or contributions:
- Open an issue on GitHub
- Review the API documentation at
/docs - Check the backend README at
backend/README.md
Built with β€οΈ for the security community