TrinaxAI is an open-source project and contributions are welcome in all forms — bug reports, documentation improvements, translations, and code. This page walks through everything you need to get a working development environment, understand the project conventions, and submit a pull request.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TrinaxCode/TrinaxAI/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have the following installed:Python 3.10+
Required for the backend, CLI, and all scripts. Check with
python3 --version.Node.js 18+
Required for the React PWA frontend. Check with
node --version.Ollama
The local model runtime. Download from ollama.com and confirm with
ollama --version.Development Setup
Install the optional reranker (recommended)
The cross-encoder reranker (Once installed, enable it in
bge-reranker-v2-m3) significantly improves RAG precision. It requires roughly 2 GB of RAM but is optional..env with TRINAXAI_RERANK=1.Start the backend
https://localhost:3333. For live-reload during development:Project Structure
Coding Conventions
Python
Python style rules
- Use
pathlib.Pathfor all new file-path code (existingos.pathmay remain) - Import order: stdlib → third-party → local
- Use type hints — encouraged throughout, enforced where it matters for clarity
- Docstrings in Google or NumPy style; either Spanish or English (the project is bilingual)
- Never use bare
except Exception: pass— at minimum log the exception withprintor a logger
TypeScript (chat-pwa)
TypeScript style rules
- Strict TypeScript —
strict: trueis set intsconfig.json; do not bypass it - Use
constfor all non-reassigned bindings - Components are functional with hooks — no class components (except
ErrorBoundarywhich already exists) - i18n first — add every new user-visible string to
chat-pwa/src/i18n/translations.tsin bothesandenbefore using it in a component - CSS via Tailwind utility classes only; custom CSS goes in
index.css
Shell Scripts
All shell scripts in the repository follow these conventions:- Always include
#!/usr/bin/env bashas the shebang - Always set
set -euo pipefail— catches errors, unset variables, and pipe failures - Include a
usage()function and--helpflag - Document every environment variable the script reads
Adding a New CLI Command
The CLI lives intrinaxai_cli/commands/. Each subcommand is its own module. To add a new command:
Create the command module
Add a new file at
trinaxai_cli/commands/mycommand.py. Follow the pattern of an existing command — each command exposes a run(args) function and uses httpx for API calls and rich for terminal output.Register it in the CLI package
Open
trinaxai_cli/__init__.py (or the router module) and register your command in the subcommand dispatch table.Build Checks
Before opening a pull request, run all of the following checks and fix any failures.public_readiness.py script checks for:
- i18n completeness — all keys present in both
esanden - Hardcoded values — paths or tokens that should come from environment variables
- Required files —
LICENSE,CONTRIBUTING.md,SECURITY.md,.env.example, etc. .gitignorecoverage — sensitive files that should not be committed
Submitting a Pull Request
- Fork the repo and create a branch from
main - Make your changes, following the conventions above
- Run the full build check suite (see above)
- Sign off every commit for DCO compliance:
git commit -s - Open the pull request against
mainwith a clear description of the change and the problem it solves
Use present tense in commit messages (“Add feature” not “Added feature”), keep each commit focused on one logical change, and reference issues with
#123 when applicable.