Magnet AI is a free, open-source, low-code platform for CRM consultants and application experts who understand the potential of Generative AI but aren't AI engineers. Magnet AI users can rapidly create AI-powered features, even without Python skills. Magnet AI solutions natively integrate with Salesforce, Siebel, and can be embedded or integrated into other applications.
- Node.js (v18+)
- Python (v3.12+)
- Docker & Docker Compose (for containerized database)
- Poetry (Python dependency manager)
Run the setup script to install all dependencies (Python API, Web Frontend, and tooling).
# Installs root dependencies, API dependencies (poetry), and Web dependencies (npm)
npm install
npm run setup-
Environment Variables: Copy the example environment file:
cp .env.example .env
Edit
.envand configure the necessary variables. For local development with Docker, the defaults usually work. -
Web Configuration: The
npm run setupcommand automatically createsmain.jsonconfiguration files for the web applications.web/apps/@ipr/magnet-admin/public/config/main.jsonweb/apps/@ipr/magnet-panel/public/config/main.json
These files are required to link the Web Frontend to the API. If you need to change the API URL or authentication settings for the frontend, edit these files.
This runs the API and Web frontend locally, and automatically starts the database in Docker (Postgres + pgvector).
npm run dev:dockerThis starts the database, API (port 8000), and Web (port 3000).
If you prefer to run the database yourself (e.g. on a remote server or local installation) instead of using Docker:
-
Prerequisites:
- PostgreSQL 16+
pgvectorextension installed and enabled (CREATE EXTENSION vector;)
-
Configuration:
- Update your
.envfile with your database connection details (DB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME).
- Update your
-
Run the App:
npm run dev
npm run dev:apior with auto-reload enabled:
npm run dev:api:reloadnpm run dev:web- Create Migration:
npm run db:migrate -- -m "message" - Apply Migrations:
npm run db:upgrade - Reset Database:
npm run db:reset(Warning: Deletes data!)
- Port Conflicts: Ensure ports 5432 (Postgres), 8000 (API), and 3000 (Web) are free.
- Windows: Use PowerShell or Git Bash. If using CMD, ensure
npmis in your PATH.
This project uses Husky to automatically run checks before you commit.
To run checks manually:
# Run all checks (API + Web)
npm run lint
# Run API checks only
npm run lint:api
# Run Web checks only
npm run lint:webWe follow the Conventional Commits specification. This allows us to automatically generate changelogs and determine semantic versioning.
Format: <type>(<scope>): <description>
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, etc)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools and libraries such as documentation generation
Examples:
feat(api): add new endpoint for user profilefix(web): resolve issue with login buttondocs: update readme with setup instructions
We use commitlint to enforce these rules. If your commit message does not follow the convention, the commit will be rejected.
See CI/CD Documentation for details.
magnet-ai/
├── api/ # Python backend (Litestar)
│ ├── src/
│ │ ├── core/ # Core domain models, DB, plugins
│ │ ├── routes/ # API endpoints
│ │ ├── services/ # Business logic
│ │ └── plugins/ # Knowledge source plugins
│ └── tests/
├── web/ # Frontend monorepo (Nx + Vue)
│ ├── apps/
│ │ ├── magnet-admin/ # Admin UI
│ │ ├── magnet-panel/ # User interface
│ │ └── magnet-docs/ # Documentation
│ └── packages/ # Shared libraries
├── .github/ # CI/CD workflows
└── docker/ # Docker configuration
Full automation configured for every commit and Pull Request:
✅ Code Quality: Ruff (Python), ESLint + Prettier (TypeScript/Vue)
✅ Type Safety: TypeScript type checking
✅ Testing: Pytest (Python), Vitest (TypeScript)
✅ Security: Safety (Python), yarn audit (npm), dependency review
✅ Docker: Image build checks
✅ Code Complexity: Radon (Python)
✅ License Compliance: Dependabot for dependency updates
- CI: Full checks on every push and PR (ci.yml)
- PR Checks: Smart checks for changed files only (pr-checks.yml)
- Code Quality: Advanced code quality analysis (code-quality.yml)
- Auto Fix: Automatic code formatting (auto-fix.yml)
- Release: Semantic versioning and automatic releases (release.yml)
- Docs: Automatic documentation deploy to GitHub Pages (deploy-docs.yml)
# Lint entire project
npm run lint
# API only
npm run lint:api
# Web only
npm run lint:webComplete documentation: .github/workflows/README.md
# Standard build
docker build -t magnet-ai .
# With custom base path (if hosted on non-root path)
docker build --build-arg WEB_BASE_PATH=/apps/magnet-ai/ -t magnet-ai .Note: WEB_BASE_PATH should start and end with / if specified.
# Run with environment file
docker run -d -p 8000:8000 --env-file=.env magnet-ai
# Run with Docker Compose
docker-compose up -dCreate a .env file based on .env.example:
# Database
DB_TYPE=postgresql
DB_HOST=localhost
DB_PORT=5432
DB_NAME=magnet_ai
DB_USER=postgres
DB_PASSWORD=your_password
# Authentication (optional for dev)
AUTH_ENABLED=false
# CORS (for local development)
CORS_OVERRIDE_ALLOWED_ORIGINS=http://localhost:5000,http://localhost:3000See .env.example for complete configuration options.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Install pre-commit hooks:
pre-commit install - Make your changes and ensure all checks pass
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- All code must pass linting, type checking, and security scans
- Add tests for new features
- Update documentation as needed
- Add Apache 2.0 license headers to new files
- Ensure all dependencies are Apache 2.0 compatible
See Contributing Guide for detailed information (if exists).
We take security seriously. Please report security vulnerabilities responsibly.
- Security Policy: See SECURITY.md
- Report Vulnerabilities: Email security@your-organization.com (update with actual)
- Security Checks: Automated scans run on every commit and weekly
- 🔒 Automated security scanning (Bandit, Safety, CodeQL, Trivy)
- 🔒 Secret detection (TruffleHog, detect-secrets)
- 🔒 Dependency vulnerability scanning
- 🔒 License compliance verification
- 🔒 Pre-commit security hooks
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
All dependencies are verified to be Apache 2.0 compatible.
- Python dependencies: See License Check workflow
- JavaScript dependencies: See License Check workflow
- Online Documentation
- Plugin System
- External Plugins Strategy
- Database Fixtures Guide
- Migration Guide
- Architecture Documentation
- Documentation: See
generated_docs/folder - Issues: GitHub Issues
- Security: SECURITY.md
Built with:
- Litestar - Python web framework
- Vue.js - Frontend framework
- PostgreSQL + pgvector - Vector database
- Nx - Monorepo tooling
Status: Active Development
Version: 1.0.0
Last Updated: November 2025