Skip to content

Commit bec851d

Browse files
committed
feat: Production-Hardened Multi-Agent Business Intelligence Platform (Final Release)
0 parents  commit bec851d

78 files changed

Lines changed: 21365 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "Python 3",
3+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
4+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
5+
"customizations": {
6+
"codespaces": {
7+
"openFiles": [
8+
"README.md",
9+
"frontend/app.py"
10+
]
11+
},
12+
"vscode": {
13+
"settings": {},
14+
"extensions": [
15+
"ms-python.python",
16+
"ms-python.vscode-pylance"
17+
]
18+
}
19+
},
20+
"updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y <packages.txt; [ -f requirements.txt ] && pip3 install --user -r requirements.txt; pip3 install --user streamlit; echo '✅ Packages installed and Requirements met'",
21+
"postAttachCommand": {
22+
"server": "streamlit run frontend/app.py --server.enableCORS false --server.enableXsrfProtection false"
23+
},
24+
"portsAttributes": {
25+
"8501": {
26+
"label": "Application",
27+
"onAutoForward": "openPreview"
28+
}
29+
},
30+
"forwardPorts": [
31+
8501
32+
]
33+
}

.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.env
2+
.env.*
3+
!.env.example
4+
.git
5+
.pytest_cache
6+
.venv
7+
venv
8+
env
9+
__pycache__
10+
*.pyc
11+
*.pyo
12+
*.db
13+
*.sqlite3
14+
chroma_data
15+
logs
16+
dist
17+
build

.env.example

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Multi-Agent BI Platform - Environment Config
2+
# Copy this file to .env for local development.
3+
# Never commit real API keys or service credentials.
4+
5+
# --- LLM Providers ---
6+
GEMINI_API_KEY=your_gemini_api_key_here
7+
GROQ_API_KEY=your_groq_api_key_here
8+
OPENROUTER_API_KEY=
9+
10+
# --- Database ---
11+
# Local Docker Compose defaults:
12+
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/agent_in
13+
DATABASE_URL_SYNC=postgresql://postgres:postgres@localhost:5432/agent_in
14+
15+
# Use "disable" for local Docker Postgres and SQLite tests.
16+
# Use "require" for managed Postgres services that require SSL.
17+
DB_SSL_MODE=disable
18+
19+
# --- Redis / Celery ---
20+
REDIS_URL=redis://localhost:6379/0
21+
22+
# --- Vector memory ---
23+
CHROMA_PERSIST_DIR=./chroma_data
24+
25+
# --- Observability ---
26+
LANGFUSE_PUBLIC_KEY=
27+
LANGFUSE_SECRET_KEY=
28+
LANGFUSE_BASE_URL=https://jp.cloud.langfuse.com
29+
30+
# --- Cost Controls ---
31+
MAX_TOKENS_PER_JOB=100000
32+
MAX_DOLLARS_PER_JOB=1.00
33+
MAX_AGENT_ITERATIONS=10
34+
35+
# --- Security ---
36+
# API Keys for authentication (comma-separated)
37+
# Leave empty to disable authentication (development mode)
38+
# Example: API_KEYS=dev-key-123,prod-key-456
39+
API_KEYS=
40+
41+
# --- Frontend ---
42+
# Frontend URL for CORS configuration
43+
# Update this when deploying to production
44+
FRONTEND_URL=http://localhost:8501
45+
46+
# --- App ---
47+
APP_ENV=development
48+
LOG_LEVEL=DEBUG
49+
50+
# --- Streamlit frontend ---
51+
# Local:
52+
BACKEND_URL=http://localhost:8000/api/v1
53+
# Hosted Streamlit should use:
54+
# BACKEND_URL=https://your-render-api.onrender.com/api/v1

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto
2+
*.py text eol=lf
3+
*.md text eol=lf
4+
*.yml text eol=lf
5+
*.yaml text eol=lf
6+
Dockerfile text eol=lf
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Sync Doppler Secrets to Render
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
sync-secrets:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Fetch Secrets from Doppler
14+
id: doppler
15+
uses: DopplerHQ/secrets-fetch-action@v1.2.0
16+
with:
17+
doppler-token: ${{ secrets.DOPPLER_TOKEN }}
18+
19+
- name: Push Secrets to Render
20+
env:
21+
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
22+
RENDER_SERVICE_ID: ${{ secrets.RENDER_SERVICE_ID }}
23+
run: |
24+
# Convert Doppler's flat JSON to Render's required format: [{"envVar": {"key": "K", "value": "V"}}]
25+
echo '${{ steps.doppler.outputs.secrets }}' | jq '[to_entries | .[] | {"envVar": {"key": .key, "value": (.value | tostring)}}]' > payload.json
26+
27+
echo "Pushing secrets to Render Service: ${RENDER_SERVICE_ID}..."
28+
29+
curl -X PUT "https://api.render.com/v1/services/${RENDER_SERVICE_ID}/env-vars" \
30+
-H "Accept: application/json" \
31+
-H "Authorization: Bearer ${RENDER_API_KEY}" \
32+
-H "Content-Type: application/json" \
33+
-d @payload.json
34+
35+
echo "Successfully synced Doppler secrets to Render."

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Environment
2+
.env
3+
.env.*
4+
!.env.example
5+
.venv/
6+
venv/
7+
env/
8+
9+
# Python
10+
__pycache__/
11+
.pytest_cache/
12+
*.py[cod]
13+
*.egg-info/
14+
dist/
15+
build/
16+
.coverage
17+
htmlcov/
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
23+
# Database
24+
*.db
25+
*.sqlite3
26+
chroma_data/
27+
test_smoke.db
28+
test_smoke_async.db
29+
test_agent_in.db
30+
31+
# Docker
32+
docker-compose.override.yml
33+
34+
# OS
35+
.DS_Store
36+
Thumbs.db
37+
38+
# Logs
39+
*.log
40+
logs/
41+
42+
# Local planning scratch files
43+
*.md
44+
!README.md
45+
46+
# Kiro
47+
.kiro/
48+

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.11

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.12-slim
2+
3+
ENV PYTHONDONTWRITEBYTECODE=1 \
4+
PYTHONUNBUFFERED=1 \
5+
PIP_NO_CACHE_DIR=1
6+
7+
WORKDIR /app
8+
9+
RUN apt-get update \
10+
&& apt-get install -y --no-install-recommends build-essential curl \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
COPY requirements.txt .
14+
RUN pip install --upgrade pip \
15+
&& pip install -r requirements.txt
16+
17+
COPY . .
18+
19+
EXPOSE 8000
20+
21+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)