0
stars
1
commits
TypeScript
primary language
Nov 22, 2025
updated
Sistema de IA self-evolving de nível enterprise com aprendizado contínuo autônomo
Documentação • Instalação • Arquitetura • APIs • Deployment
AION Supreme é um sistema de IA autônomo enterprise-grade projetado para aprendizado contínuo e auto-otimização. Desenvolvido com padrões de qualidade PWC/EY/Big4, oferece:
any: Type safety absoluto┌─────────────────────────────────────────────────────────┐
│ FRONTEND (React 18) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Chat UI │ │ Admin Panel│ │ GPU Monitor │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ BACKEND (Node.js/Express) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Priority Orchestrator │ │
│ │ KB Search → Web Search → Free APIs → OpenAI │ │
│ └──────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ LLM Gateway Manager │ │
│ │ Groq | Gemini | Cerebras | OpenRouter | OpenAI │ │
│ └──────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ GPU Orchestration Service │ │
│ │ Kaggle (On-Demand) | Colab (Scheduled) │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ DATABASE (PostgreSQL/Neon) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ pgvector (IVFFlat) | Drizzle ORM | Migrations │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
any types (100% type safety)# Clone o repositório
git clone <repo-url>
cd aion-supreme
# Instale dependências (já configurado no Replit)
npm install
Crie um arquivo .env com:
# Database
DATABASE_URL=postgresql://...
PGDATABASE=...
PGHOST=...
PGPASSWORD=...
PGPORT=5432
PGUSER=...
# Authentication
SESSION_SECRET=...
COOKIE_ENCRYPTION_KEY=...
# LLM Providers
OPEN_ROUTER_API_KEY=...
OPEN_ROUTER_PROVISIONING_KEY=...
# GPU Resources (optional)
KAGGLE_USERNAME=...
KAGGLE_KEY=...
# Optional Providers
VITE_STRIPE_PUBLIC_KEY=...
TESTING_STRIPE_SECRET_KEY=...
# Criar schema inicial
npm run db:generate
# Aplicar migrations
npm run db:push
# Verificar status
npm run db:studio
# Desenvolvimento
npm run dev
# Produção
npm run build
npm run start
A aplicação estará disponível em http://localhost:5000
// server/gpu-orchestration/kaggle-orchestrator.ts
const KAGGLE_CONFIG = {
sessionLimit: 8.4, // horas (70% de 12h)
weeklyLimit: 21, // horas (70% de 30h)
idleTimeout: 600000, // 10 minutos
autoShutdown: true
};
// server/gpu-orchestration/colab-scheduler.ts
const COLAB_SCHEDULE = {
days: ['Monday', 'Wednesday', 'Friday'],
startTime: '09:00',
endTime: '19:00',
timezone: 'America/Sao_Paulo',
cooldown: 36 // horas
};
// server/services/auto-approval-service.ts
const CURATION_CONFIG = {
autoApprovalScore: 80, // ≥80% aprovação automática
maxRejectScore: 40, // <40% rejeição automática
frequencyThreshold: 3, // ≥3 usos com score ≥10%
deduplicationThresholds: {
absorb: 0.95, // Absorve conteúdo similar
delta: [0.70, 0.95], // Mescla diferenças
delete: 0.98 // Remove duplicatas exatas
}
};
// server/ai/embedder.ts
const EMBEDDING_CONFIG = {
model: 'all-mpnet-base-v2',
dimensions: 768,
provider: 'local', // 100% autônomo
batchSize: 100
};
# server/gpu-orchestration/providers/kaggle-api.ts
import threading
from flask import Flask
from pyngrok import ngrok
app = Flask(__name__)
@app.route('/health')
def health():
return {'status': 'ok'}
# Start server in background
server_thread = threading.Thread(
target=lambda: app.run(port=5000),
daemon=True
)
server_thread.start()
# Wait for server
time.sleep(5)
# Create ngrok tunnel
public_url = ngrok.connect(5000)
print(f"NGROK PUBLIC URL: {public_url}")
# Keep-alive
while True:
time.sleep(3600)
| Provider | Sessão Máx | Uso Real (70%) | Weekly Máx | Uso Real (70%) |
|---|---|---|---|---|
| Kaggle | 12h | 8.4h | 30h | 21h |
| Colab | 10h | 10h (scheduled) | - | 30h/week |
Entrada de Dados:
Curadoria Automática:
Input → PII Detection → Deduplication → Quality Score → Auto-Approval
Armazenamento:
// server/services/rag-service.ts
async function semanticSearch(query: string, limit = 10) {
const embedding = await generateEmbedding(query);
const results = await db.execute(sql`
SELECT content,
1 - (embedding <=> ${embedding}) as similarity
FROM knowledge_base
WHERE 1 - (embedding <=> ${embedding}) > 0.7
ORDER BY embedding <=> ${embedding}
LIMIT ${limit}
`);
return results;
}
// server/middleware/security.ts
- CSRF double-submit tokens
- Rate limiting progressivo
- Helmet security headers
- XSS protection
- SQL injection prevention
const RATE_LIMITS = {
auth: {
attempts: [5, 10, 20],
lockouts: ['1m', '1h', '24h']
},
api: {
rpm: 60,
burst: 100
},
upload: {
rph: 10,
maxSize: '50MB'
}
};
// Pino structured logging
{
timestamp: '2025-11-19T16:00:00.000Z',
level: 'info',
component: 'llm-gateway',
provider: 'gemini',
model: 'gemini-2.5-flash',
tokens: 1523,
latency: 234,
success: true
}
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 8080
CMD ["npm", "start"]
# Deploy
gcloud run deploy aion-supreme \
--source . \
--region us-central1 \
--allow-unauthenticated
# task-definition.json
{
"family": "aion-supreme",
"cpu": "1024",
"memory": "2048",
"containerDefinitions": [{
"name": "aion",
"image": "aion-supreme:latest",
"portMappings": [{
"containerPort": 5000
}]
}]
}
# Verificar template do worker
# Flask deve iniciar ANTES do ngrok
-- Verificar dimensões
SELECT vector_dims(embedding) FROM knowledge_base LIMIT 1;
-- Deve retornar 768
// Verificar circuit breaker status
const status = await llmCircuitBreakerManager.getStatus();
console.log(status);
# Verificar telemetria
npm run telemetry:check
any types - 100% Type Safety alcançado (111 any types eliminados em 22 arquivos)MIT License - Veja arquivo LICENSE para detalhes
Fillipe Guerra
Desenvolvido com padrões enterprise PWC/EY/Big4
AION Supreme - Self-evolving AI para o futuro enterprise 🚀
1 commits
TypeScript
95.5%
Python
2.0%
Jupyter Notebook
1.8%
0
stars
1
commits
TypeScript
primary language
Nov 22, 2025
updated
Sistema de IA self-evolving de nível enterprise com aprendizado contínuo autônomo
Documentação • Instalação • Arquitetura • APIs • Deployment
AION Supreme é um sistema de IA autônomo enterprise-grade projetado para aprendizado contínuo e auto-otimização. Desenvolvido com padrões de qualidade PWC/EY/Big4, oferece:
any: Type safety absoluto┌─────────────────────────────────────────────────────────┐
│ FRONTEND (React 18) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Chat UI │ │ Admin Panel│ │ GPU Monitor │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ BACKEND (Node.js/Express) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Priority Orchestrator │ │
│ │ KB Search → Web Search → Free APIs → OpenAI │ │
│ └──────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ LLM Gateway Manager │ │
│ │ Groq | Gemini | Cerebras | OpenRouter | OpenAI │ │
│ └──────────────────────────────────────────────────┘ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ GPU Orchestration Service │ │
│ │ Kaggle (On-Demand) | Colab (Scheduled) │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ DATABASE (PostgreSQL/Neon) │
│ ┌──────────────────────────────────────────────────┐ │
│ │ pgvector (IVFFlat) | Drizzle ORM | Migrations │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
any types (100% type safety)# Clone o repositório
git clone <repo-url>
cd aion-supreme
# Instale dependências (já configurado no Replit)
npm install
Crie um arquivo .env com:
# Database
DATABASE_URL=postgresql://...
PGDATABASE=...
PGHOST=...
PGPASSWORD=...
PGPORT=5432
PGUSER=...
# Authentication
SESSION_SECRET=...
COOKIE_ENCRYPTION_KEY=...
# LLM Providers
OPEN_ROUTER_API_KEY=...
OPEN_ROUTER_PROVISIONING_KEY=...
# GPU Resources (optional)
KAGGLE_USERNAME=...
KAGGLE_KEY=...
# Optional Providers
VITE_STRIPE_PUBLIC_KEY=...
TESTING_STRIPE_SECRET_KEY=...
# Criar schema inicial
npm run db:generate
# Aplicar migrations
npm run db:push
# Verificar status
npm run db:studio
# Desenvolvimento
npm run dev
# Produção
npm run build
npm run start
A aplicação estará disponível em http://localhost:5000
// server/gpu-orchestration/kaggle-orchestrator.ts
const KAGGLE_CONFIG = {
sessionLimit: 8.4, // horas (70% de 12h)
weeklyLimit: 21, // horas (70% de 30h)
idleTimeout: 600000, // 10 minutos
autoShutdown: true
};
// server/gpu-orchestration/colab-scheduler.ts
const COLAB_SCHEDULE = {
days: ['Monday', 'Wednesday', 'Friday'],
startTime: '09:00',
endTime: '19:00',
timezone: 'America/Sao_Paulo',
cooldown: 36 // horas
};
// server/services/auto-approval-service.ts
const CURATION_CONFIG = {
autoApprovalScore: 80, // ≥80% aprovação automática
maxRejectScore: 40, // <40% rejeição automática
frequencyThreshold: 3, // ≥3 usos com score ≥10%
deduplicationThresholds: {
absorb: 0.95, // Absorve conteúdo similar
delta: [0.70, 0.95], // Mescla diferenças
delete: 0.98 // Remove duplicatas exatas
}
};
// server/ai/embedder.ts
const EMBEDDING_CONFIG = {
model: 'all-mpnet-base-v2',
dimensions: 768,
provider: 'local', // 100% autônomo
batchSize: 100
};
# server/gpu-orchestration/providers/kaggle-api.ts
import threading
from flask import Flask
from pyngrok import ngrok
app = Flask(__name__)
@app.route('/health')
def health():
return {'status': 'ok'}
# Start server in background
server_thread = threading.Thread(
target=lambda: app.run(port=5000),
daemon=True
)
server_thread.start()
# Wait for server
time.sleep(5)
# Create ngrok tunnel
public_url = ngrok.connect(5000)
print(f"NGROK PUBLIC URL: {public_url}")
# Keep-alive
while True:
time.sleep(3600)
| Provider | Sessão Máx | Uso Real (70%) | Weekly Máx | Uso Real (70%) |
|---|---|---|---|---|
| Kaggle | 12h | 8.4h | 30h | 21h |
| Colab | 10h | 10h (scheduled) | - | 30h/week |
Entrada de Dados:
Curadoria Automática:
Input → PII Detection → Deduplication → Quality Score → Auto-Approval
Armazenamento:
// server/services/rag-service.ts
async function semanticSearch(query: string, limit = 10) {
const embedding = await generateEmbedding(query);
const results = await db.execute(sql`
SELECT content,
1 - (embedding <=> ${embedding}) as similarity
FROM knowledge_base
WHERE 1 - (embedding <=> ${embedding}) > 0.7
ORDER BY embedding <=> ${embedding}
LIMIT ${limit}
`);
return results;
}
// server/middleware/security.ts
- CSRF double-submit tokens
- Rate limiting progressivo
- Helmet security headers
- XSS protection
- SQL injection prevention
const RATE_LIMITS = {
auth: {
attempts: [5, 10, 20],
lockouts: ['1m', '1h', '24h']
},
api: {
rpm: 60,
burst: 100
},
upload: {
rph: 10,
maxSize: '50MB'
}
};
// Pino structured logging
{
timestamp: '2025-11-19T16:00:00.000Z',
level: 'info',
component: 'llm-gateway',
provider: 'gemini',
model: 'gemini-2.5-flash',
tokens: 1523,
latency: 234,
success: true
}
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 8080
CMD ["npm", "start"]
# Deploy
gcloud run deploy aion-supreme \
--source . \
--region us-central1 \
--allow-unauthenticated
# task-definition.json
{
"family": "aion-supreme",
"cpu": "1024",
"memory": "2048",
"containerDefinitions": [{
"name": "aion",
"image": "aion-supreme:latest",
"portMappings": [{
"containerPort": 5000
}]
}]
}
# Verificar template do worker
# Flask deve iniciar ANTES do ngrok
-- Verificar dimensões
SELECT vector_dims(embedding) FROM knowledge_base LIMIT 1;
-- Deve retornar 768
// Verificar circuit breaker status
const status = await llmCircuitBreakerManager.getStatus();
console.log(status);
# Verificar telemetria
npm run telemetry:check
any types - 100% Type Safety alcançado (111 any types eliminados em 22 arquivos)MIT License - Veja arquivo LICENSE para detalhes
Fillipe Guerra
Desenvolvido com padrões enterprise PWC/EY/Big4
AION Supreme - Self-evolving AI para o futuro enterprise 🚀
1 commits
TypeScript
95.5%
Python
2.0%
Jupyter Notebook
1.8%