Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FLASK_APP=app
FLASK_ENV=development
OLLAMA_HOST=http://localhost:11434
LLM_MODEL=llama3.2:latest
LLM_CONTEXT=4096
LLM_MAX_TOKENS=768
LLM_TEMPERATURE=0.2
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.venv/
__pycache__/
*.pyc
instance/
.env
uploads/*
!uploads/.gitkeep
*.log
.DS_Store
node_modules/
client/node_modules/
server/node_modules/
129 changes: 128 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,128 @@
# beta
# Aurora CRM Intelligence Suite

Aurora CRM Intelligence Suite is a local-first command center for predictive strategy, risk analytics, AI advisory chat, and deep document comparison. Every insight runs on your workstation through the [Ollama](https://ollama.com) runtime, so nothing ever leaves your RTX 4090 (or compatible) GPU.

> **Security reminder**
> No cloud API keys are required. Keep your model checkpoints private and stored locally.

## Project structure

```
.
├── app/ # Flask application package
│ ├── services/ # Local inference + file helper utilities
│ ├── static/ # Custom CSS and interaction scripts
│ └── templates/ # Multi-page Jinja UI
├── uploads/ # Local document catalog (created automatically)
├── app.py # Flask entry point
├── requirements.txt # Python dependencies (Flask + requests)
├── install.ps1 # Windows installer shim (PowerShell)
├── run.ps1 # Windows auto runner
├── install.bat # Convenience launcher that calls install.ps1
├── run.bat # Convenience launcher that calls run.ps1
└── README.md # You are here
```

## Prerequisites

- Python **3.10+** (tested with CPython 3.12)
- PowerShell 5.1+ (bundled with Windows 11) for the automation scripts
- NVIDIA GPU with recent drivers (4090 recommended) or enough CPU cores if you prefer CPU inference
- [Ollama for Windows](https://ollama.com/download/windows) installed and running (`ollama serve` starts automatically once installed)
- A local **GGUF** checkpoint available to Ollama (use `ollama pull llama3.2` or `ollama pull qwen2.5-coder` etc.)

## Quick start (Windows 11)

1. Install [Ollama](https://ollama.com/download/windows) if you have not already, then open **PowerShell** and pull a chat-capable model (for example Meta's Llama 3.2):
```powershell
ollama pull llama3.2
```
Ollama automatically stores the GGUF checkpoint in its managed directory and serves it to local clients.
2. Open **PowerShell** and `cd` into the project directory.
3. If this is your first time running local scripts, allow the session to run them:
```powershell
Set-ExecutionPolicy -Scope Process RemoteSigned
```
4. Run the installer:
```powershell
./install.ps1
```
The script will:
- Detect Python 3
- Create (or reuse) a `.venv` virtual environment
- Install dependencies from `requirements.txt`
5. Create your `.env` file and set the Ollama options:
```powershell
Copy-Item .env.example .env
notepad .env
```
Update `LLM_MODEL` with the model name you pulled (for example `llama3.2:latest`). Leave `OLLAMA_HOST` at the default unless you run Ollama on a different machine.
6. Launch the stack:
```powershell
./run.ps1
```
The runner activates the virtual environment, exports variables from `.env`, verifies the model path, and starts Flask in debug mode at <http://127.0.0.1:5000/>.

You can double-click `install.bat` or `run.bat` from Explorer—they simply relay to the PowerShell scripts with execution policy bypassed.

## Quick start (macOS/Linux)

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # edit with your Ollama host and model
export OLLAMA_HOST="http://localhost:11434"
export LLM_MODEL="llama3.2:latest"
flask --app app --debug run
```

Visit <http://127.0.0.1:5000/> once the server reports it is running.

## Feature tour

- **Overview dashboard** – animated chrome with catalog health, workflow readiness, and immersive storytelling.
- **Data steward** – upload TXT, MD, CSV, or JSON files and request local AI summaries with quality scoring, tags, and opportunity prompts.
- **Predictive strategy** – craft revenue scenarios, score growth outlooks, and review initiative guidance with progress dials and impact distributions.
- **Risk command** – quantify exposure, inspect mitigation cards, and monitor early warnings with visual coverage bars.
- **Advisor lounge** – chat with the embedded strategist, auto-load document summaries, and keep every conversation on device.
- **Comparison lab** – run deep comparisons between two documents to expose alignment, divergence, and actionable recommendations.

Each workflow uses structured prompts defined in `app/services/insights.py`. Responses are parsed as JSON and rendered dynamically with a custom glassmorphism UI—no external CDNs required.

## Configuration notes

- `OLLAMA_HOST` – Base URL where Ollama listens (default `http://localhost:11434`).
- `LLM_MODEL` – **required**. Model name as listed by `ollama list` (for example `llama3.2:latest`).
- `LLM_CONTEXT` – Context window supplied to Ollama (default `4096`). Increase if your model supports a larger context.
- `LLM_MAX_TOKENS` – Maximum tokens to generate per response (default `768`).
- `LLM_TEMPERATURE` – Sampling temperature (default `0.2`).
- Uploaded documents remain on disk inside the local `uploads/` folder. Delete files there to clear the catalog.

## Automation scripts

The Windows automation lives under `scripts/windows/` and is intentionally PowerShell-only—no external tooling required.

- `install.ps1` – ensures Python is present, provisions `.venv`, and installs dependencies.
- `run.ps1` – verifies the environment, loads `.env`, reminds you if Ollama variables are unset, and starts Flask using the virtual environment's interpreter.

Both scripts print friendly diagnostics (missing Python, missing model, etc.) so issues are easy to resolve.

## Validation checklist

- Flask routes use built-in templating; no frontend framework is required.
- All inference stays local by calling the Ollama HTTP API on `OLLAMA_HOST`; there are **no** outbound internet calls from the Flask app.
- File uploads are limited to text-based formats and capped at 10 MB per file to keep processing light.
- UI assets rely entirely on bundled CSS/JS with layered gradients, animated nav, and custom progress visuals.

## Troubleshooting

| Symptom | Resolution |
| --- | --- |
| "Local inference is not configured" error | Launch Ollama (it starts automatically after installation), run `ollama pull <model>`, and set `LLM_MODEL` in `.env`. |
| App loads but responses are empty | Confirm the pulled Ollama model supports chat instruction tuning and that `LLM_CONTEXT` is within the model's limit. |
| Slow responses on Windows | Verify Ollama is using your GPU (run `ollama run llama3.2 "test"` in a console and watch GPU usage). |
| PowerShell blocks the scripts | Run PowerShell as Administrator once and execute `Set-ExecutionPolicy -Scope Process RemoteSigned`. |
| Installer reports Python not found | Install Python 3.10+ from <https://www.python.org/downloads/> and tick "Add to PATH" during setup. |

Enjoy orchestrating predictive CRM intelligence locally!
6 changes: 6 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from app import create_app

app = create_app()

if __name__ == "__main__":
app.run(debug=True)
18 changes: 18 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from flask import Flask
from pathlib import Path

from dotenv import load_dotenv


def create_app() -> Flask:
load_dotenv()
app = Flask(__name__)
app.config["UPLOAD_FOLDER"] = Path(app.root_path).parent / "uploads"
app.config["UPLOAD_FOLDER"].mkdir(parents=True, exist_ok=True)
app.config["MAX_CONTENT_LENGTH"] = 10 * 1024 * 1024 # 10 MB per file
app.config["SECRET_KEY"] = app.config.get("SECRET_KEY") or "dev-secret-key"

from . import routes # noqa: WPS433

routes.register(app)
return app
Loading