OpenCopilot is an AI-powered cybersecurity assistant that helps organizations enhance their security posture through intelligent document management, expert knowledge systems, and advanced chat capabilities.
- AI-Powered Chat: Intelligent conversations with cybersecurity experts
- Document Management: Advanced search and organization of security documents
- Knowledge Graph: Neo4j-powered relationships and insights
- Multi-Database Support: MongoDB, OpenSearch, and Neo4j integration
- Real-time Collaboration: WebSocket-based live interactions
- Modern UI: React-based responsive interface with Tailwind CSS
- Containerized Deployment: Docker and Docker Compose support
- Getting Started - Quick setup guide
- Development Guide - Detailed development instructions
- Architecture Overview - System design and components
- Contributing Guidelines - How to contribute
- Security Policy - Security and vulnerability reporting
- Changelog - Release notes and changes
Before you begin, ensure you have the following installed on your system:
- Docker & Docker Compose
- Node.js 18+ with npm/pnpm
- Python 3.10+
- Git
-
Clone the repository
git clone https://github.com/ZySec-AI/open-copilot.git cd open-copilot
-
Environment setup
cp .env.example .env # Edit .env with your configuration
-
Start with Docker (Recommended)
docker-compose up -d
-
Or run locally for development
# Start backend services docker-compose up -d mongodb opensearch-srv neo4j # Start backend cd api && pip install -r requirements.txt uvicorn app.main:app --reload --port 8081 # Start frontend (new terminal) cd web && npm install && npm start
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8081
- API Documentation: http://localhost:8081/docs
We welcome contributions from the community! Here's how you can help:
- π΄ Fork the repository on GitHub
- π₯ Clone your fork locally
- πΏ Create a feature branch (
git checkout -b feature/amazing-feature
) - π» Make your changes and test them
- π Commit your changes (
git commit -m 'Add amazing feature'
) - π€ Push to your fork (
git push origin feature/amazing-feature
) - π Open a Pull Request
# Fork and clone the repo
git clone https://github.com/YOUR_USERNAME/open-copilot.git
cd open-copilot
# Set up development environment
./scripts/setup-dev.sh # (if available)
# Or use VS Code Dev Containers
# Install "Dev Containers" extension, then:
# Ctrl+Shift+P -> "Dev Containers: Reopen in Container"
- π Bug fixes - Help us squash bugs
- β¨ New features - Add exciting capabilities
- π Documentation - Improve guides and examples
- π§ͺ Tests - Increase coverage and reliability
- π¨ UI/UX improvements - Enhance user experience
- π§ DevOps - Improve deployment and CI/CD
- π‘οΈ Security - Identify and fix vulnerabilities
- Development Guide - Complete development setup
- Architecture Guide - Understanding the codebase
- API Documentation - Backend API reference
- Component Library - Frontend components
Before you begin, ensure you have the following installed on your system:
- Docker
- Docker Compose
- Python 3.10+
- Node.js 20+ with pnpm
git clone https://github.com/ZySec-AI/es-copilot.git
cd es-copilot
This project requires a .env
file for configuration. If the .env
file does not exist, it will be created with sample values.
The deploy.sh
script automates the setup and installation of necessary tools and services. It includes:
- Creating the
.env
file if it doesn't exist. - Installing Node.js using nvm.
- Installing Python 3.10 and pip.
- Installing pnpm.
- Installing Docker.
- Creating necessary directories for logs and data with correct permissions.
To run the deployment script:
./deploy/deploy.sh
The run.sh
script is used to manage the startup process. It can either run the entire application using Docker Compose (containerized mode) or run the frontend and backend locally (developer mode).
To run the application in containerized mode:
./run.sh prod
To run the application locally for development purposes, use the dev
argument.
-
To start both frontend and backend:
./run.sh dev
-
To start only the frontend:
./run.sh dev fe
-
To start only the backend:
./run.sh dev be
The utils/reset_password.sh
script can be used to reset passwords for various services. Replace username
and new_password
with appropriate values.
./utils/reset_password.sh username new_password
The utils/backup.sh
and utils/restore.sh
scripts are available for backing up and restoring the database.
-
To backup the database:
./utils/backup.sh
-
To restore the database:
./utils/restore.sh backup_file
- Populate the database with initial data.
- Ensure system security settings are configured (e.g., firewalls, secure access).
- Execute tests to verify system functionality.
- Check integrations with external systems.
- Configure system monitoring.
- Set up logging for important events.
- Implement regular backups.
- Ensure recovery procedures are documented and tested.
The following environment variables are used by the application and should be set in the .env
file. Replace the sample values with actual values before running the application.
# OpenSearch Configuration
OPENSEARCH_INITIAL_ADMIN_PASSWORD=your_opensearch_password
OPENSEARCH_HOST=opensearch-srv
OPENSEARCH_PORT=9200
OPENSEARCH_USERNAME=your_opensearch_username
OPENSEARCH_PASSWORD=your_opensearch_password
FILE_INDEX_NAME=escopilot-files-v1
# MongoDB Configuration
DB_URL=mongodb+srv://your_mongo_username:your_mongo_password@datasets.1ooacdk.mongodb.net/
MONGO_INITDB_ROOT_USERNAME=your_mongo_username
MONGO_INITDB_ROOT_PASSWORD=your_mongo_password
# API Keys
HUGGINGFACE_API_KEY=your_huggingface_api_key
OPENAI_API_KEY=your_openai_api_key
# Application Secrets
SECRET_KEY=your_secret_key
# Additional Configuration
DB_NAME=your_db_name
VLLM_API_BASE=https://your_vllm_api_base
REACT_APP_API_URL=http://localhost:8081
APP_STORE_JSON_PATH=app-store.json
APPLICATIONS_JSON_PATH=applications.json
LANGCHAIN_MODEL=sentence-transformers/all-MiniLM-L6-v2
IS_HISTORY_ENABLED=True
HISTORY_MESSAGES_COUNT=3
CHUNK_SIZE=4096
CHUNK_OVERLAP=50
DEFAULT_MODEL=0
K=3
ACCESS_TOKEN_EXPIRE=2
REFRESH_TOKEN_EXPIRE=100
# Settings
ENABLE_INTERNET=True
ENABLE_CYBER_NEWS=False
ENABLE_FETCH_CONTENT=True
MODE=zysec-demo
PRIVATE_BASE_URL=
PRIVATE_SECRET_KEY=
# Neo4j Configuration
ENABLE_GRAPHDB=True
NEO4J_URI=http://localhost:7883
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_neo4j_password
- The MongoDB connection string should not include a port number when using the
mongodb+srv
scheme. - Make sure to update the sample values in the
.env
file with actual values before running the application.
If you encounter issues, check the logs of the running services:
docker-compose -f deploy/docker-compose.yml logs
For specific services, you can use:
docker-compose -f deploy/docker-compose.yml logs <service_name>
- π Documentation: Check our comprehensive guides above
- π Issues: Report bugs or request features
- π¬ Discussions: Join community discussions
- π‘οΈ Security: Report security issues to [security@yourorganization.com]
Please read our Code of Conduct to understand the standards we expect from our community.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- FastAPI for the excellent Python web framework
- React community for the amazing frontend ecosystem
- All our contributors who make this project better
β Star this repository if you find it helpful!
π Share it with others who might benefit from an AI-powered cybersecurity assistant
For example:
docker-compose -f deploy/docker-compose.yml logs web-srv
docker-compose -f deploy/docker-compose.yml logs api-srv
docker-compose -f deploy/docker-compose.yml logs mongo-srv
This project is licensed under the MIT License - see the LICENSE file for details.
### Updated Folder Structure
```markdown
.
βββ README.md
βββ api
β βββ ... (API related files and directories)
βββ deploy
β βββ README.md
β βββ deploy.sh
β βββ docker-compose.yml
βββ run.sh
βββ utils
β βββ backup.sh
β βββ restore.sh
β βββ reset_password.sh
βββ web
β βββ ... (Web related files and directories)
βββ workspace
βββ ... (Workspace related files and directories)
run.sh
script is used to start the application in different modes, while deploy.sh
is responsible for initial setup and installation. The utils
directory contains scripts for maintenance tasks like backups and password resets. This organization should help streamline the deployment and maintenance process.