convez.ai
MCP ServerAutomaçãoAvançado
canfieldjuan

ATLAS: Plataforma Multi-Modal de IA para Automação e Inteligência B2B

canfieldjuan/ATLAS

Cérebro IA multi-modal com automação, vendas B2B e voz integrados

Ver no GitHub
InicialPluginScore · de 0 a 100

Sistema centralizado que combina automação pessoal, controle por voz, inteligência de vendas B2B e análise de produtos em uma única plataforma. Roda como servidor Brain com LLMs locais, 8 servidores MCP (130+ ferramentas), 57 tarefas autônomas agendadas, stack completo de telefonia, 4 dashboards web e 500+ endpoints REST/WebSocket.

Instalação

$npx convez-ai canfieldjuan/ATLAS

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
3
Forks
1
Acompanhando
1
Saúde
28%
Último commit
há 3 dias
Versão
—
Issues abertas
107
Contribuidores
3

Casos de uso

  • Automação de processos de vendas B2B com análise de churn
  • Assistente de voz pessoal com controle de calendário e lembretes
  • Inteligência de negócios e detecção de anomalias em tempo real
  • Call center inteligente com roteamento de intenção e receptionist bot

Veredito

Projeto ambicioso e bem arquitetado para automação empresarial em escala. Exige expertise em LLMs, LangGraph e infraestrutura, mas oferece framework pronto para inteligência B2B com voz e workflows autônomos.

README

A tradução para o português deste README ainda está na fila.

Atlas

A multi-modal AI platform that combines personal automation, voice control, B2B sales intelligence, and consumer product analytics into a single extensible system. Atlas runs as a central "Brain" server backed by local LLMs, with edge nodes for distributed sensing, 4 web dashboards, 8 MCP servers (130+ tools), 57 autonomous scheduled tasks, a full telephony stack, and 500+ REST/WebSocket API endpoints.


System Overview

┌──────────────────────────────────────────────────────────────────────┐
│                          ATLAS BRAIN                                  │
│                   (FastAPI · 500+ API endpoints)                    │
│                                                                       │
│  ┌────────────┐  ┌────────────┐  ┌────────────┐  ┌──────────────┐   │
│  │  LLM Pool  │  │    STT     │  │    TTS     │  │   Intent     │   │
│  │ Ollama     │  │ Nemotron   │  │ Piper      │  │   Router     │   │
│  │ vLLM       │  │ SenseVoice │  │ Kokoro     │  │ (Embeddings) │   │
│  │ Claude     │  └────────────┘  └────────────┘  └──────────────┘   │
│  │ OpenRouter │                                                       │
│  └────────────┘                                                       │
│                                                                       │
│  ┌──────────────────────────────────────────────────────────────┐    │
│  │                    12 LangGraph Workflows                     │    │
│  │  Voice · Email · Calendar · Booking · Reminder · Call         │    │
│  │  Security · Presence · Receptionist · Home · Streaming        │    │
│  └──────────────────────────────────────────────────────────────┘    │
│                                                                       │
│  ┌──────────────────────────────────────────────────────────────┐    │
│  │                  57 Autonomous Tasks (APScheduler)            │    │
│  │  Enrichment · Campaigns · Briefings · Intelligence · Alerts   │    │
│  │  Memory Sync · Pattern Learning · Anomaly Detection           │    │
│  └──────────────────────────────────────────────────────────────┘    │
│                                                                       │
│  ┌──────────────────────────────────────────────────────────────┐    │
│  │                  8 MCP Servers (130+ tools)                   │    │
│  │  CRM · Email · Twilio · Calendar · Invoicing                 │    │
│  │  Intelligence · B2B Churn (61 tools) · Memory                 │    │
│  └──────────────────────────────────────────────────────────────┘    │
│                                                                       │
│  ┌────────────────┐  ┌────────────────┐  ┌──────────────────┐       │
│  │  PostgreSQL    │  │  Neo4j         │  │  68 Skill Docs   │       │
│  │  (50+ tables)  │  │  (GraphRAG)    │  │  (LLM Prompts)   │       │
│  └────────────────┘  └────────────────┘  └──────────────────┘       │
└──────────────────────────────────────────────────────────────────────┘
         │                    │                    │
         ▼                    ▼                    ▼
┌──────────────┐   ┌──────────────┐   ┌──────────────────────┐
│  Edge Node   │   │  Telephony   │   │    4 Web Dashboards   │
│  Orange Pi   │   │  Twilio      │   │  Main · Intel · Churn │
│  RK3588      │   │  SignalWire  │   │  Admin Ops            │
│  YOLO·Piper  │   │  Call/SMS    │   │  React + Next.js      │
└──────────────┘   └──────────────┘   └──────────────────────┘

What Atlas Does

Personal AI Assistant

  • Voice interface — Wake word ("Hey Atlas"), streaming STT, semantic intent routing, TTS response. Works via brain server or edge node.
  • Device control — "Turn off the TV", "dim the bedroom lights to 30%". Parses natural language into structured intents, dispatches to Home Assistant (WebSocket) or MQTT devices.
  • Multi-turn workflows — Booking appointments (slot checking, confirmation), composing emails (draft → review → send), setting reminders, querying calendar — all as stateful LangGraph conversations.
  • Telephony — Inbound/outbound calls via Twilio or SignalWire. Call transcription, receptionist routing, business-hours logic, multi-context phone numbers, SMS auto-reply via LLM.
  • Morning briefings — Autonomous daily digest: calendar, weather, unread email triage, device health, security events, proactive actions.

B2B Sales Intelligence

  • Review scraping — Ingests from 16 sources (G2, Capterra, TrustRadius, Reddit, Gartner, GetApp, GitHub, HackerNews, PeerSpot, ProductHunt, Quora, StackOverflow, TrustPilot, Twitter/X, YouTube, RSS).
  • LLM enrichment — Each review extracted for pain categories, urgency scores, churn intent, company signals, budget pressure, competitive mentions, buying stage.
  • Churn signal aggregation — Per-vendor metrics: churn intent rate, NPS proxy, decision-maker churn rate, price complaint rate. Classified into archetypes (pricing_shock, feature_gap, acquisition_decay, support_collapse, etc.) with risk levels (imminent → stable).
  • Evidence pools — Deterministic intermediate representations (Evidence Vault, Segment Intelligence, Temporal Intelligence, Account Intelligence, Displacement Dynamics, Category Dynamics) computed once and consumed by all downstream artifacts.
  • Displacement graph — Vendor A → Vendor B competitive flows with mention counts, signal strength, primary switch drivers, velocity tracking, and source distribution.
  • Reasoning synthesis — Claude-powered compression of evidence pools into structured reasoning contracts (vendor core, displacement, category, account reasoning) with schema validation and citation tracing.
  • Battle cards — Pairwise competitive positioning generated from reasoning contracts and displacement evidence.
  • Campaign generation — Opportunity scoring (role weight + buying stage + urgency + seat count + pain categories), calibrated from real CRM outcomes. Auto-generates personalized cold email, follow-up, and LinkedIn variants.
  • Score calibration — Closed-loop: CRM events (deal_won, deal_lost, meeting_booked) feed back into opportunity scoring weights via score_calibration_weights table.
  • Blog generation — Auto-writes vendor alternatives, migration guides, pricing reality checks, vendor showdowns, switching stories from churn intelligence. Role-aware topic boosting (CFO → pricing, CTO → migration).
  • Vendor briefings — Email-delivered intelligence packages pulling from 10 data sources (signals, evidence vaults, product profiles, reasoning synthesis, segment/temporal intelligence, displacement dynamics).
  • Product profiles — Per-vendor knowledge cards: strengths, weaknesses, pain addressed, use cases, typical company size/industry, top integrations, commonly compared/switched-from vendors.
  • Account resolution — Matches reviews to canonical company identities. Builds witness packets with decision-maker counts, contract end dates, seat counts, buying stage, org pressure signals.
  • CRM integration — Ingests events from HubSpot, Salesforce, Pipedrive. Matches to campaign sequences. Webhook dispatch to external CRMs with retry logic.

Consumer Product Intelligence

  • Amazon review pipeline — Deep enrichment of product reviews (pain categories, product names, alternatives, proof quotes).
  • Brand health scoring — Review aggregation by brand with safety signals and risk scoring.
  • Complaint analysis — Customer complaint classification, content generation, competitive flow visualization.
  • Market reports — Category-level intelligence and ecosystem mapping.

Strategic Intelligence (Chase Hughes Framework)

  • Risk sensors — Alignment, urgency, and rigidity detection with correlation analysis.
  • SORAM classification — Behavioral risk classification on entities.
  • Intelligence reports — Report orchestration, intervention pipelines, narrative architecture.
  • Simulation — Simulated evolution of entity behavior under pressure.

Project Structure

atlas_brain/                    # Core server (FastAPI, 500+ endpoints)
├── api/                        # REST + WebSocket endpoints
│   ├── query/                  #   Text inference
│   ├── devices/                #   Device control + intent dispatch
│   └── ...                     #   B2B, campaigns, email, calendar, blog, admin
├── agents/graphs/              # 12 LangGraph workflow state machines
├── autonomous/                 # 57 scheduled tasks (APScheduler)
│   ├── scheduler.py            #   Cron/interval task orchestration
│   ├── runner.py               #   Execution engine + ntfy notifications
│   └── tasks/                  #   Task implementations
├── capabilities/               # Device control system
│   ├── backends/               #   Home Assistant (WebSocket), MQTT
│   ├── devices/                #   Lights, switches, media players
│   └── intent_parser.py        #   NL → structured intent
├── mcp/                        # 8 MCP servers (130+ tools)
│   ├── b2b/                    #   B2B churn (14 domain files, 61 tools)
│   ├── memory_server.py        #   GraphRAG memory (13 tools)
│   ├── crm_server.py           #   CRM (10 tools)
│   ├── email_server.py         #   Email (8 tools)
│   ├── twilio_server.py        #   Telephony (10 tools)
│   ├── calendar_server.py      #   Calendar (8 tools)
│   ├── invoicing_server.py     #   Invoicing (15 tools)
│   └── intelligence_server.py  #   Intelligence (17 tools)
├── memory/                     # RAG client, quality detection, embeddings
├── reasoning/                  # Evidence engine, archetypes, narrative synthesis
├── pipelines/                  # Generalized pipeline registry + LLM routing
├── services/                   # Business logic layer
│   ├── b2b/                    #   Account resolution, product matching, PDF render
│   ├── scraping/               #   16-source review scraper
│   ├── embedding/              #   Sentence transformer embeddings
│   ├── recognition/            #   Face/gait recognition
│   ├── speaker_id/             #   Speaker identification
│   ├── llm_router.py           #   Multi-model LLM routing
│   ├── crm_provider.py         #   Direct asyncpg CRM
│   ├── email_provider.py       #   Gmail + Resend + IMAP
│   ├── calendar_provider.py    #   Google Calendar + CalDAV
│   └── mcp_client.py           #   MCP tool consumer (stdio subprocesses)
├── skills/                     # 68 injectable LLM prompt documents
│   ├── digest/                 #   46 analysis/synthesis skills
│   ├── email/                  #   7 email composition skills
│   ├── call/                   #   4 call handling skills
│   ├── invoicing/              #   3 billing skills
│   ├── intelligence/           #   6 strategic analysis skills
│   └── ...
├── storage/                    # PostgreSQL (50+ tables, asyncpg)
│   └── migrations/             #   Versioned SQL migrations
├── voice/                      # End-to-end voice pipeline
│   ├── pipeline.py             #   Main voice loop
│   ├── vad/                    #   Dual VAD (WebRTC + Silero)
│   └── launcher.py             #   Pipeline lifecycle
└── tools/                      # Registered tool implementations

atlas_edge/                     # Edge node (Orange Pi RK3588 / Jetson)
├── capabilities/               #   Local HA device control
├── pipeline/                   #   Voice pipeline (Piper TTS, SenseVoice STT)
├── intent/                     #   Local intent parsing
├── skills/                     #   Offline skills (time, timer, math)
└── brain/                      #   Brain server connection + offline fallback

atlas_comms/                    # Telephony system
├── providers/                  #   Twilio + SignalWire backends
├── services/                   #   Scheduling, context routing
└── api/                        #   Call/SMS/webhook endpoints

atlas_video-processing/         # Distributed vision
├── devices/                    #   Webcam, RTSP, mock cameras
├── processing/                 #   YOLO detection, tracking
└── communication/              #   MQTT device discovery

atlas-ui/                       # Main conversational UI (React + Vite)
atlas-intel-ui/                 # Consumer intelligence dashboard (React)
atlas-churn-ui/                 # B2B churn intelligence dashboard (React)
atlas-admin-ui/                 # Operations dashboard (React)
atlas-intel-next/               # Next.js B2B dashboard (migration in progress)
atlas-mobile/                   # Mobile app

graphiti-wrapper/               # GraphRAG backend (FastAPI + Neo4j)
├── query_utils.py              #   Query decomposition, expansion, temporal detection
├── reranker.py                 #   BM25 + cross-encoder reranking
└── embedder_factory.py         #   OpenAI / local embedder selection

tests/                          # Test suite
scripts/                        # Data import, backfill, setup utilities

Voice Pipeline

End-to-end voice interaction, works on both the brain server and edge nodes:

Microphone
  → Wake Word Detection (OpenWakeWord: "Hey Atlas")
  → Voice Activity Detection (WebRTC VAD + Silero dual-gate)
  → Audio Capture (buffered PCM frames, 16kHz)
  → ASR (Nemotron 0.6B streaming, or SenseVoice on edge)
  → Semantic Intent Router (all-MiniLM-L6-v2 embeddings, cosine similarity)
  → Route Decision:
      ├─ Device command → Intent Parser → Home Assistant action
      ├─ Parameterless tool → Direct execution (time, weather, calendar)
      ├─ Workflow trigger → LangGraph state machine (booking, email, etc.)
      └─ Conversation → LLM with tool access (CRM, calendar, email, telephony)
  → TTS (Piper on edge, Kokoro on brain)
  → Speaker Output

The edge node runs offline-capable local skills (time, timer, math, status) without brain round-trip. When the brain is reachable, queries route there for full LLM + tool access.


LLM Routing

Atlas uses multiple models for different workloads:

WorkloadModelWhere
Conversation, intent, remindersqwen3:14bLocal (Ollama)
Business workflows (booking, email)minimax-m2:cloudOllama cloud relay
Email draftsClaude SonnetAnthropic API
Email triageClaude HaikuAnthropic API
B2B reasoning synthesisClaude / OpenRouterCloud
B2B enrichmentQwen3-30B-A3BLocal (vLLM)
Edge node (offline)SenseVoice (STT) + Piper (TTS)Orange Pi RK3588

The intent router uses all-MiniLM-L6-v2 (384-dim, CPU) for fast semantic classification before any LLM call. Parameterless tools (get_time, get_weather, etc.) execute without touching the LLM at all.


Autonomous Tasks

57 scheduled tasks run via APScheduler with PostgreSQL as source of truth. Key categories:

Daily Consumer Tasks:

  • morning_briefing — Calendar + email + weather + device health synthesis
  • gmail_digest — Unread email triage and summary
  • calendar_reminder — Upcoming event alerts (every 5 min)
  • device_health_check — Smart home device status
  • security_summary — Camera/motion event summary (every 6h)
  • email_intake / email_draft / email_auto_approve — Email processing pipeline
  • model_swap_day / model_swap_night — GPU memory management

B2B Intelligence Pipeline:

  • b2b_enrichment — LLM extraction on pending reviews (every 5 min)
  • b2b_churn_intelligence — Weekly signal aggregation + evidence pool building
  • b2b_reasoning_synthesis — Claude-powered reasoning contracts from evidence pools
  • b2b_product_profiles — Daily vendor knowledge card generation
  • b2b_campaign_generation — Nightly opportunity scoring + outreach drafting
  • b2b_score_calibration — Weekly calibration from CRM outcomes
  • b2b_battle_cards — Competitive positioning generation
  • b2b_blog_generation — Auto-write vendor alternative guides
  • b2b_vendor_briefing — Email-delivered intelligence packages
  • b2b_accounts_in_motion — High-intent account identification
  • b2b_scrape_target_pruning — Optimize scrape spend

Intelligence & Learning:

  • daily_intelligence / competitive_intelligence / news_intelligence — Market signals
  • pattern_learning / preference_learning — User behavior modeling
  • anomaly_detection — Churn signal anomaly alerting (every 15 min)
  • knowledge_graph_sync — Nightly Neo4j sync from conversation history
  • reasoning_reflection — Persistent reasoning updates

All tasks support ntfy push notifications, per-task opt-out, and _skip_synthesis for empty results.


MCP Servers

Eight MCP servers expose Atlas to any MCP-compatible client (Claude Desktop, Cursor, custom agents). All support stdio (for local clients) and SSE HTTP (for remote access).

ServerToolsPortDescription
Memory138001Semantic search, entity lookup, graph traversal, episode ingestion, sentiment analysis
CRM108056Contact CRUD, interaction logging, appointment tracking, customer context
Email88057Send/read email (Gmail OAuth + IMAP), estimates, proposals, thread search
Twilio108058Calls, SMS, recordings, phone lookup
Calendar88059Google Calendar + CalDAV, free slot finder, appointment sync
Invoicing158060Invoice lifecycle, payments, services, customer balance
Intelligence178061Strategic entity intelligence + consumer product reviews, brand health, market reports
B2B Churn618062Full B2B intelligence: signals, reviews, displacement, campaigns, calibration, corrections, webhooks

B2B Churn MCP (61 tools across 14 domains)

The largest MCP server, organized by domain:

  • Signals — list_churn_signals, get_churn_signal, get_vendor_profile, list_high_intent_companies
  • Reviews — search_reviews, get_review (enriched with pain, urgency, churn intent)
  • Displacement — list_displacement_edges, get_displacement_history, list_vendor_pain_points, list_vendor_use_cases, list_vendor_integrations, list_vendor_buyer_profiles
  • Products — get_product_profile, get_product_profile_history, match_products_tool
  • Evidence Pools — get_evidence_vault, get_segment_intelligence, get_temporal_intelligence, get_account_intelligence, get_displacement_dynamics, get_category_dynamics
  • Cross-Vendor — list_cross_vendor_conclusions, get_cross_vendor_conclusion (battle cards, category councils)
  • Reports — list_reports, get_report, export_report_pdf
  • Vendor Registry — list_vendors_registry, fuzzy_vendor_search, fuzzy_company_search, add_vendor_to_registry, add_vendor_alias
  • Scrape Admin — list_scrape_targets, add_scrape_target, manage_scrape_target, delete_scrape_target
  • Corrections — create_data_correction, list_data_corrections, revert_data_correction, get_correction_stats, get_source_correction_impact
  • Calibration — record_campaign_outcome, get_signal_effectiveness, get_outcome_distribution, trigger_score_calibration, get_calibration_weights
  • Change Events — list_change_events, list_concurrent_events, get_vendor_correlation
  • Webhooks — list_webhook_subscriptions, update_webhook, send_test_webhook_tool, get_webhook_delivery_summary
  • CRM Events — list_crm_events, ingest_crm_event, get_crm_enrichment_stats
  • Content — list_blog_posts, get_blog_post, list_affiliate_partners
  • Write — persist_report, persist_conclusion, draft_campaign, build_challenger_brief, build_accounts_in_motion
  • Pipeline — get_pipeline_status, get_parser_health, get_source_health, get_source_telemetry, get_operational_overview

B2B Intelligence Pipeline

The full data flow from raw reviews to outbound campaigns:

16 Review Sources (G2, Capterra, Reddit, Gartner, etc.)
    │
    ▼
b2b_enrichment (every 5 min, vLLM extraction)
    │  pain_category, urgency_score, churn_intent, company_signals,
    │  budget_pressure, competitive_mentions, buying_stage
    ▼
b2b_churn_intelligence (weekly)
    │  Aggregates per-vendor metrics, computes archetypes + risk levels
    │  Builds 6 evidence pools:
    │    Evidence Vault · Segment Intelligence · Temporal Intelligence
    │    Account Intelligence · Displacement Dynamics · Category Dynamics
    ▼
b2b_reasoning_synthesis (after intelligence)
    │  Claude compresses pools → structured reasoning contracts
    │  Validates citations, enforces schema, decomposes into:
    │    vendor_core · displacement · category · account reasoning
    ▼
┌───────────────────────────────────────────────────────┐
│  Downstream consumers (all compose from pools/contracts) │
│                                                         │
│  battle_cards ─── competitive positioning               │
│  campaigns ────── opportunity-scored outreach            │
│  blog_posts ──── SEO content (alternatives, guides)     │
│  vendor_briefings ── email intelligence packages        │
│  product_profiles ── vendor knowledge cards             │
│  tenant_reports ─── per-customer intelligence           │
│  churn_alerts ──── high-intent notifications            │
│  accounts_in_motion ── at-risk account identification   │
└───────────────────────────────────────────────────────┘
    │
    ▼
CRM Feedback Loop
    ingest_crm_event (deal_won/lost/meeting_booked)
    → record_campaign_outcome
    → score_calibration (weekly, updates opportunity weights)

Web Dashboards

Main UI (atlas-ui/)

Sci-fi themed conversational interface. Real-time audio waveform visualization, system metrics (CPU/memory/network), conversation history, live event feed, voice/text input with privacy mode, settings for voice pipeline and integrations.

B2B Churn Dashboard (atlas-churn-ui/)

Vendor intelligence operations center. Pages: Dashboard (KPIs + pipeline health), Vendors (filterable list with urgency/archetype badges), Vendor Detail (churn trajectory, product profile, reviews, companies), Reviews (enriched search), Leads (high-intent companies), Prospects (outreach management), Reports (generated intelligence with quality status), Campaigns (review + diagnostics), Blog (auto-generated content library), Challengers (displacement analysis).

Consumer Intelligence Dashboard (atlas-intel-ui/)

Product review analytics. Pages: Dashboard (pipeline + enrichment metrics), Brands (top brands, comparison), Reviews (deep enrichment panels), Flows (churn flow visualization), Safety (risk signals), plus B2B sub-routes for cross-system views.

Admin Operations Dashboard (atlas-admin-ui/)

System monitoring. LLM cost tracking by provider/model with daily trends, system resource usage, scheduled task health + success rates, scraping pipeline status per source (success rate, block frequency, proxy usage), recent API calls with latency, reasoning activity (Reddit posts by signal type, per-subreddit breakdown), error timeline.


Edge Nodes

Orange Pi RK3588 (or Jetson Nano) running atlas_edge/:

  • Voice — Piper TTS (~6.6x realtime), SenseVoice STT (int8 ONNX, CPU)
  • Vision — YOLO-World (NPU core 0), RetinaFace (NPU core 1), MobileFaceNet (NPU core 2), YOLOv8n-pose (NPU core 1 timeshared)
  • Motion gate — MOG2 on CPU prevents NPU inference when no motion
  • Local skills — Time, timer, math, status queries skip brain round-trip
  • Home Assistant — Runs on the edge node via Docker, direct entity control
  • Offline fallback — Functions independently when brain is unreachable
  • Brain connection — Tailscale mesh, WebSocket with zlib compression, token batching

Skills System

68 injectable markdown documents that enrich LLM system prompts at runtime. Organized by domain:

  • Digest (46) — B2B campaign generation, churn extraction, intelligence synthesis, battle cards, vendor outreach, complaint analysis, morning briefing, email triage, security summary, and more
  • Email (7) — Cleaning confirmation, reply, query, proposal, sentiment response, estimate
  • Call (4) — Call extraction, action planning, confirmation email/SMS
  • Invoicing (3) — Payment reminder, overdue notification, invoice email
  • Intelligence (6) — Report building, narrative architecture, intervention, simulation
  • Security (1) — Escalation narration
  • B2B (1) — Product profile synthesis

Skills are lazy-loaded and referenced by domain/name (e.g., email/draft, digest/b2b_churn_intelligence).


Memory & Knowledge Graph

Dual-layer memory system:

  • Semantic memory — Neo4j knowledge graph via Graphiti wrapper. Entity relationships, facts, temporal awareness. Query decomposition, synonym expansion, cross-encoder reranking.
  • Episodic memory — PostgreSQL conversation persistence. Session transcripts with metadata, memory quality detection (correction patterns, repetition via cosine similarity).
  • Quality signals — 10 regex patterns for correction detection, embedding-based repetition detection (threshold 0.85). Stored in metadata JSONB on conversation_turns.
  • Nightly sync — Conversation history → Neo4j knowledge graph with quality metadata.
  • RAG retrieval — Unified RAGClient with retrieve_memory() returning structured SearchSource[]. Source tracking on both text and voice paths.

Quick Start

Requirements

  • Python 3.11+
  • NVIDIA GPU with 24GB+ VRAM (RTX 3090/4090)
  • Docker and Docker Compose
  • Ollama
  • PostgreSQL + Neo4j

Setup

git clone https://github.com/canfieldjuan/ATLAS.git
cd ATLAS

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cp .env.example .env   # Configure credentials

ollama pull qwen3:14b
docker compose up -d postgres

# Dev server with hot reload
uvicorn atlas_brain.main:app \
  --host 0.0.0.0 --port 8001 \
  --reload --reload-dir atlas_brain \
  --reload-exclude 'data/postgres/**' \
  --ws-ping-interval 60 --ws-ping-timeout 120

ASR Server (for voice pipeline)

pip install -r requirements.asr.txt
python asr_server.py --model nvidia/nemotron-speech-streaming-en-0.6b --port 8081 --device cuda:0

Test

# Health
curl http://127.0.0.1:8001/api/v1/ping

# Text query
curl -X POST http://127.0.0.1:8001/api/v1/query/text \
  -H "Content-Type: application/json" \
  -d '{"query_text": "Hello Atlas"}'

# Device control
curl -X POST http://127.0.0.1:8001/api/v1/devices/intent \
  -H "Content-Type: application/json" \
  -d '{"query": "turn on the living room lights"}'

# Vision event feed
curl http://127.0.0.1:8001/api/v1/vision/events

# Voice pipeline (WebSocket)
# Connect to ws://127.0.0.1:8001/api/v1/ws/orchestrated

API Reference

Below is a curated API overview for the main route families. For a generated mounted-route snapshot from importing atlas_brain.main:app in the current checkout, see docs/API_REFERENCE.md.

Most REST endpoints are served under /api/v1/ (port 8001 by default). Root-level exceptions include OpenAI compatibility (/v1/...), Ollama compatibility (/, /api/...), and webhooks (/webhooks/...). Most authenticated endpoints use a JWT Bearer token obtained via /api/v1/auth/login. B2B-specific routes additionally require the b2b_plan claim. Exact mounted route counts can vary with optional routers and local build artifacts.

Authentication

MethodPathDescription
POST/api/v1/auth/registerRegister a new user; returns JWT access + refresh tokens
POST/api/v1/auth/loginPassword login; returns JWT access + refresh tokens
POST/api/v1/auth/refreshExchange refresh token for a new access token
GET/api/v1/auth/meReturns the authenticated user's profile

Billing (Stripe)

MethodPathDescription
POST/api/v1/billing/checkoutCreate a Stripe Checkout session
POST/api/v1/billing/portalCreate a Stripe Customer Portal session
GET/api/v1/billing/statusActive subscription tier and feature flags

Core AI

MethodPathDescription
GET/api/v1/pingLiveness check
GET/api/v1/healthDetailed health with service status
POST/api/v1/query/textText query → LLM response
GET/api/v1/system/statsHigh-level system stats
GET/api/v1/vision/eventsVision event feed from atlas_vision nodes
WS/api/v1/ws/orchestratedFull voice pipeline over WebSocket

LLM Management

MethodPathDescription
GET/api/v1/llm/availableList registered LLM implementations and the active model
POST/api/v1/llm/activateLoad a model into the active slot
POST/api/v1/llm/deactivateUnload the active model
POST/api/v1/llm/generateOne-shot text generation from a prompt
POST/api/v1/llm/chatMulti-message chat request through the active LLM
GET/api/v1/llm/statusActive model, VRAM usage, health

Device Control

MethodPathDescription
GET/api/v1/devices/List all registered capability devices
GET/api/v1/devices/{device_id}Device state and metadata
POST/api/v1/devices/{device_id}/actionExecute a device action directly
POST/api/v1/devices/intentNatural language → device action dispatch

Session & Memory

MethodPathDescription
POST/api/v1/session/createCreate a new conversation session
POST/api/v1/session/continueResume or create a user session on another terminal
GET/api/v1/session/{session_id}Session detail with transcript
GET/api/v1/session/{session_id}/historyPaginated conversation history for a session
POST/api/v1/session/{session_id}/closeMark a session inactive
GET/api/v1/session/status/dbDatabase/session persistence health

Email

MethodPathDescription
GET/api/v1/email/drafts/List pending email drafts
GET/api/v1/email/drafts/{draft_id}Draft detail
POST/api/v1/email/drafts/{draft_id}/approveApprove and send a draft
POST/api/v1/email/drafts/{draft_id}/rejectReject a draft
POST/api/v1/email/drafts/{draft_id}/editEdit a generated draft
POST/api/v1/email/drafts/generate/{gmail_message_id}Generate a draft for a processed Gmail message
POST/api/v1/email/drafts/{draft_id}/redraftRegenerate a draft
POST/api/v1/email/drafts/{draft_id}/skipSkip a draft without sending
POST/api/v1/email/actions/{gmail_message_id}/quoteGenerate a quote reply draft
POST/api/v1/email/actions/{gmail_message_id}/escalateEscalate a complaint email
POST/api/v1/email/actions/{gmail_message_id}/slotsSuggest appointment slots
POST/api/v1/email/actions/{gmail_message_id}/send-infoSend an informational reply
POST/api/v1/email/actions/{gmail_message_id}/archiveArchive a processed email
GET/api/v1/email/inbox-rules/List inbox routing rules
POST/api/v1/email/inbox-rules/Create an inbox routing rule
PUT/api/v1/email/inbox-rules/{rule_id}Update an inbox rule
DELETE/api/v1/email/inbox-rules/{rule_id}Delete an inbox rule
POST/api/v1/email/inbox-rules/reorderReorder rule priority
POST/api/v1/email/inbox-rules/testTest a rule against sample email content

Communications (Calls, SMS, Actions & Webhooks)

MethodPathDescription
GET/api/v1/comms/statusCommunications provider status
GET/api/v1/comms/contextsList registered business contexts
GET/api/v1/comms/contexts/{context_id}Context detail and availability
POST/api/v1/comms/callsInitiate an outbound call
POST/api/v1/comms/smsSend an outbound SMS
POST/api/v1/comms/availabilityCheck availability for a call/SMS workflow
POST/api/v1/comms/appointmentsCreate an appointment from a comms workflow
DELETE/api/v1/comms/appointments/{appointment_id}Delete an appointment
POST/api/v1/comms/recordings/reconcileReconcile provider recording state
POST/api/v1/comms/call-actions/{transcript_id}/bookTurn a transcript into an appointment
POST/api/v1/comms/call-actions/{transcript_id}/draft-emailDraft a follow-up email from a call
POST/api/v1/comms/call-actions/{transcript_id}/draft-smsDraft a follow-up SMS from a call
POST/api/v1/comms/call-actions/{transcript_id}/send-emailSend the drafted email
POST/api/v1/comms/call-actions/{transcript_id}/send-smsSend the drafted SMS
GET/api/v1/comms/calls/searchFull-text search over call transcripts
GET/api/v1/contacts/{contact_id}/timelineContact interaction timeline
POST/api/v1/comms/voice/inboundInbound telephony webhook
POST/api/v1/comms/voice/statusVoice status callback webhook
POST/api/v1/comms/sms/inboundInbound SMS webhook
POST/api/v1/comms/sms/statusSMS delivery status webhook
WS/api/v1/comms/voice/stream/{call_sid}Live telephony media stream

Invoicing

MethodPathDescription
GET/api/v1/invoicing/{invoice_id}Invoice detail
POST/api/v1/invoicing/{invoice_id}/sendEmail the invoice to the customer
POST/api/v1/invoicing/{invoice_id}/send-reminderSend a reminder for an unpaid invoice
POST/api/v1/invoicing/{invoice_id}/mark-paidRecord payment / mark invoice paid

B2B Intelligence — Admin Dashboard (/api/v1/b2b/dashboard/)

Public / admin-facing endpoints — no tenant scope. Require b2b_plan.

MethodPathDescription
GET/signalsGlobal churn signals across all vendors
GET/slow-burn-watchlistLow-urgency vendors with accumulating risk
GET/signals/{vendor_name}Full vendor signal detail
GET/high-intentCompanies showing high purchase intent
GET/vendors/{vendor_name}Vendor profile with churn metrics
POST/vendors/{vendor_name}/reasonTrigger Claude reasoning synthesis for a vendor
POST/vendors/compare-reasoningSide-by-side reasoning comparison
GET/reportsList generated intelligence reports
GET/reports/{report_id}Report detail
GET/reports/{report_id}/pdfDownload report as PDF
POST/reports/compareGenerate a vendor comparison report
POST/reports/compare-companiesAccount-level comparison report
POST/reports/company-deep-diveSingle-company deep dive report
GET/reviewsEnriched review list with filters
GET/reviews/{review_id}Single review with full enrichment
GET/pipelinePipeline health: queue depths, error rates, lag
GET/source-healthPer-source scraping health (success rate, block rate)
GET/source-health/telemetrySource telemetry metrics
GET/displacement-edgesCompetitive displacement graph edges
GET/displacement-historyDisplacement edge velocity over time
GET/vendor-pain-pointsAggregated pain categories per vendor
GET/vendor-use-casesUse case coverage per vendor
GET/vendor-integrationsIntegration graph per vendor
GET/vendor-buyer-profilesBuyer profile segments per vendor
GET/product-profileVendor product profile knowledge card
GET/change-eventsContract/leadership/funding change events
GET/fuzzy-vendor-searchFuzzy vendor name search
GET/fuzzy-company-searchFuzzy company name search
GET/compare-vendor-periodsMetric delta between two time windows
GET/signal-effectivenessPer-signal type performance stats

B2B Intelligence — Tenant Dashboard (/api/v1/b2b/tenant/)

All endpoints are tenant-scoped to the authenticated user's tracked vendors. Require b2b_plan.

Vendor Management

MethodPathDescription
GET/vendorsList this tenant's tracked vendors
POST/vendorsAdd a vendor to the tenant's tracking list
DELETE/vendors/{vendor_name}Remove a vendor from tracking
GET/vendors/searchSearch the global vendor registry
POST/push-to-crmPush a high-intent company to the connected CRM

Competitive Sets

MethodPathDescription
GET/competitive-setsList tenant competitive sets
POST/competitive-setsCreate a competitive set
PUT/competitive-sets/{id}Update a competitive set
DELETE/competitive-sets/{id}Delete a competitive set
GET/competitive-sets/{id}/planPreview synthesis plan before running
POST/competitive-sets/{id}/runTrigger on-demand intelligence synthesis

Intelligence Feeds

MethodPathDescription
GET/overviewKPI summary: signal counts, risk levels, archetype breakdown
GET/signalsTenant-scoped churn signals with filters
GET/slow-burn-watchlistSlow-burn risk vendors with accumulating pressure
GET/signals/{vendor_name}Full vendor detail scoped to tenant
GET/accounts-in-motion-feedAt-risk accounts with decision-maker signals
GET/vendor-historyMetric time-series for a tracked vendor
GET/compare-vendor-periodsMetric delta between two time windows
GET/pain-trendsPain category trend lines over time
GET/displacementCompetitive displacement edges for tracked vendors
GET/pipelineTenant pipeline status: enrichment lag, queue depth
GET/leadsHigh-intent companies scoped to tenant vendors
GET/high-intentCompact high-intent list for quick scan
GET/leads/{company}Detailed lead profile for a single company

Watchlist Views & Alerts

MethodPathDescription
GET/watchlist-viewsList saved watchlist filter configurations
POST/watchlist-viewsCreate a watchlist view
PUT/watchlist-views/{view_id}Update view filters or delivery settings
DELETE/watchlist-views/{view_id}Delete a watchlist view
GET/watchlist-views/{view_id}/alert-eventsAlert trigger history for a view
POST/watchlist-views/{view_id}/alert-events/evaluateRun alert rules now
GET/watchlist-views/{view_id}/alert-email-logEmail delivery log
POST/watchlist-views/{view_id}/alert-events/deliver-emailSend alert email immediately

Reports

MethodPathDescription
GET/reportsList tenant intelligence reports with trust metadata
GET/reports/{report_id}Report detail with freshness and review state
POST/reports/compareGenerate a vendor comparison report
POST/reports/compare-companiesAccount-level comparison report
POST/reports/company-deep-diveSingle-company deep dive
POST/reports/battle-cardCompetitive battle card
GET/report-subscriptions/{scope_type}/{scope_key}Get recurring delivery subscription
PUT/report-subscriptions/{scope_type}/{scope_key}Create or update recurring delivery

Reviews, Campaigns & Exports

MethodPathDescription
GET/reviewsTenant-scoped enriched reviews
GET/reviews/{review_id}Single review detail
GET/campaignsOutreach campaigns scoped to tenant
POST/campaigns/generateTrigger campaign generation now
PATCH/campaigns/{campaign_id}Update campaign status or content
GET/opportunity-dispositionsManual disposition overrides
POST/opportunity-dispositionsSet a disposition for an opportunity
POST/opportunity-dispositions/bulkBulk set dispositions
POST/opportunity-dispositions/removeRemove disposition overrides
GET/export/signalsCSV export of signals
GET/export/reviewsCSV export of reviews
GET/export/high-intentCSV export of high-intent companies
GET/export/source-healthCSV export of source health metrics

B2B Evidence Explorer (/api/v1/b2b/evidence/)

Trust layer exposing raw evidence behind every signal, report, and account card. Requires b2b_plan.

MethodPathDescription
GET/witnessesList witness records for a vendor (filters: urgency, pain category, buying stage, date)
GET/witnesses/{id}Single witness with full review context and company signals
GET/vaultEvidence vault claims (weakness/strength) with citation counts
GET/traceFull claim-to-review reasoning trace (sample of 20 witnesses)
GET/annotationsHuman annotation overrides on witness records
POST/annotationsAdd or update a witness annotation
POST/annotations/removeRemove an annotation

B2B Win/Loss Predictor (/api/v1/b2b/predict/)

Aggregates displacement, churn, pain, and buyer data into a probability score with evidence. Requires b2b_plan.

MethodPathDescription
POST/win-lossPredict win probability for a target vendor vs. a challenger
POST/win-loss/compareHead-to-head comparison across multiple challengers
GET/win-loss/recentRecent predictions with outcome labels
GET/win-loss/{prediction_id}Prediction detail with factor breakdown
GET/win-loss/{prediction_id}/csvExport prediction as CSV

Scoring factors: displacement_momentum (25%), churn_severity (20%), pain_concentration (15%), dm_engagement (15%), historical_outcomes (15%), segment_match (10%). Vendors with insufficient data return is_gated=true instead of a fake probability.

B2B Campaigns (/api/v1/b2b/campaigns/)

MethodPathDescription
GET/List campaigns with status and quality filters
GET/statsAggregate campaign KPIs
GET/quality-trendsQuality score trends over time
GET/analytics/funnelFull outreach funnel metrics
GET/analytics/by-vendorPer-vendor campaign analytics
GET/suppressionsEmail suppression list
POST/suppressionsAdd a suppression entry
DELETE/suppressions/{id}Remove a suppression entry
GET/review-queueCampaigns awaiting human review

B2B Scrape Management (/api/v1/b2b/scrape/)

MethodPathDescription
GET/targetsList active scrape targets
GET/targets/probation-telemetryLow-yield target diagnostics
POST/targets/onboard-vendorProvision scrape targets for a new vendor
GET/targets/coverage-planCoverage gap analysis
POST/targets/coverage-plan/seed-missing-coreAuto-provision missing core-source targets

B2B CRM Events (/api/v1/b2b/crm/)

MethodPathDescription
POST/eventsIngest a single CRM event (deal_won, deal_lost, meeting_booked)
POST/events/batchBatch ingest CRM events
POST/events/hubspotHubSpot webhook receiver
POST/events/salesforceSalesforce webhook receiver

B2B Vendor Briefings (/api/v1/b2b/briefings/)

MethodPathDescription
POST/previewPreview briefing content before sending
POST/generateGenerate and send a vendor intelligence briefing email
POST/gateCheck data readiness before briefing generation
POST/checkoutSchedule a recurring briefing delivery

B2B Prospects (/api/v1/b2b/prospects/)

MethodPathDescription
GET/List prospects with pipeline stage filters
GET/statsProspect pipeline stats
GET/manual-queueManually queued prospects awaiting review
GET/company-overridesManual targeting overrides

Consumer Product Intelligence (/api/v1/consumer/dashboard/)

MethodPathDescription
GET/asinsList tracked Amazon ASINs
POST/asinsAdd an ASIN to tracking
DELETE/asins/{asin}Remove an ASIN from tracking
GET/pipelineEnrichment pipeline health
GET/categoriesProduct category list with review counts
GET/brandsBrand list with health scores
GET/brands/compareSide-by-side brand comparison
GET/brands/{brand_name}Brand detail: health score, pain map, safety signals
GET/flowsChurn flow visualization data
GET/featuresFeature mention matrix
GET/safetySafety risk signals
GET/reviewsEnriched product reviews with filters
GET/reviews/{review_id}Review detail with full enrichment
GET/brand-historyBrand health score time-series

Strategic Intelligence (/api/v1/intelligence/)

MethodPathDescription
POST/reportGenerate an intelligence report
POST/interventionTrigger an intervention pipeline
GET/reportsList intelligence reports
GET/reports/{report_id}Report detail
GET/pressureEntity pressure baseline records
GET/approvalsPending approval queue
GET/approvals/{approval_id}Approval detail
POST/approvals/{approval_id}/approveApprove a pending action
POST/approvals/{approval_id}/rejectReject a pending action

Identity, Presence, Speaker ID & Recognition

Route familyDescription
/api/v1/identity/*Canonical identity records, names, creation, and modality cleanup
/api/v1/presence/*Occupancy status and transition history
/api/v1/speaker/*Speaker enrollment, verification, and enrolled-user management
/api/v1/recognition/*Face/gait enrollment, identification, and recognition-event history

Alerts, Vision, Video, Security & Settings

Route familyDescription
/api/v1/alerts/*Unified cross-source alert history, rules, acknowledgements, and cleanup
/api/v1/vision/*Vision events, cameras, alert rules, and alert history
/api/v1/video/*Webcam / RTSP streams, snapshots, and recognition views
/api/v1/security/*Security asset telemetry, observations, and threat summaries
/api/v1/settings/*Voice, email, daily, intelligence, LLM, notifications, and integrations settings
/api/v1/system/*High-level system stats

Additional Business Route Families

Route familyDescription
/api/v1/b2b/tenant/affiliates/*Affiliate opportunities, partner registry, and click tracking
/api/v1/b2b/vendor-targets/*Vendor target CRUD, claiming, and report generation
/api/v1/seller/*Seller-side targets, campaigns, and intelligence refresh
/api/v1/scraper/*Universal scrape job creation, status, results, cancel, and delete
/api/v1/actions/*Proactive action queue acknowledgement/dismiss flows

Blog (/api/v1/blog/, /api/v1/admin/blog/)

MethodPathDescription
GET/blog/publishedList published posts (public, no auth)
GET/blog/published/{slug}Single published post (public)
GET/admin/blog/draftsList blog drafts
GET/admin/blog/drafts/{id}Draft detail
PATCH/admin/blog/drafts/{id}Edit draft content or metadata
POST/admin/blog/drafts/{id}/publishPublish a draft
GET/admin/blog/quality-trendsQuality score trends

Pipeline Visibility (/api/v1/pipeline/visibility/)

MethodPathDescription
GET/extraction-healthEnrichment extraction success rates
GET/summaryHigh-level pipeline summary
GET/watchlist-deliveryWatchlist alert delivery health
GET/queueEnrichment queue state
GET/eventsRecent pipeline events

Admin & Cost Tracking (/api/v1/admin/costs/)

MethodPathDescription
GET/summaryLLM cost summary (all providers)
GET/burn-dashboardDaily spend burn rate
GET/by-providerCost breakdown by LLM provider
GET/by-modelCost breakdown by model
GET/by-workflowCost breakdown by workflow
GET/reconciliationCost reconciliation against usage data

Autonomous Tasks (/api/v1/autonomous/)

MethodPathDescription
GET/status/summaryScheduler / hook-manager status summary
GET/List all scheduled tasks
POST/Create a scheduled task
GET/{task_id}Task detail
PUT/{task_id}Update a task
DELETE/{task_id}Delete a task
POST/{task_id}/runTrigger a task immediately
POST/{task_id}/enableEnable and schedule a task
POST/{task_id}/disableDisable and unschedule a task
GET/{task_id}/executionsTask execution history

Reasoning Events (/api/v1/reasoning/)

MethodPathDescription
GET/eventsPending reasoning events
GET/locksActive reasoning locks
GET/queueReasoning work queue
POST/process/{event_id}Manually process a reasoning event

WebSocket Endpoints

PathDescription
WS /api/v1/ws/edge/{location_id}Edge node connection and state sync
WS /api/v1/ws/orchestratedOrchestrated full voice pipeline: audio in → ASR → agent → TTS
WS /api/v1/comms/voice/stream/{call_sid}Live telephony audio stream for calls

OpenAI / Ollama Compatibility

Atlas exposes drop-in compatibility endpoints so any OpenAI SDK or Ollama client can point at the Atlas brain server:

PathCompatibility
POST /v1/chat/completionsOpenAI Chat Completions API
GET /Ollama root health check (Ollama is running)
GET /api/versionOllama version endpoint
POST /api/chatOllama /api/chat
GET /api/tagsOllama /api/tags

Webhooks

PathDescription
GET /webhooks/unsubscribeOne-click campaign unsubscribe page
POST /webhooks/campaign-emailCampaign email ESP event webhook receiver
POST /webhooks/stripeStripe webhook receiver (subscription lifecycle)

Tech Stack

LayerTechnology
BackendPython 3.11, FastAPI, asyncpg, APScheduler
DatabasePostgreSQL (50+ tables), Neo4j (GraphRAG)
LLMOllama, vLLM, Claude (Anthropic), OpenRouter
ASRNemotron 0.6B (brain), SenseVoice ONNX (edge)
TTSPiper (edge), Kokoro (brain)
Embeddingsall-MiniLM-L6-v2 (384-dim), mxbai-embed-large-v1 (1024-dim)
WorkflowsLangGraph (12 state machines)
MCPFastMCP (8 servers, 130+ tools)
Home AutomationHome Assistant (WebSocket), MQTT
TelephonyTwilio, SignalWire
EmailGmail (OAuth2), IMAP, Resend
CalendarGoogle Calendar, CalDAV
CRMDirect asyncpg, NocoDB admin UI
BillingStripe (subscription lifecycle)
VisionYOLOv8, YOLO-World, RetinaFace, MobileFaceNet
EdgeOrange Pi RK3588 (NPU), Jetson Nano
FrontendsReact 19, Next.js, Vite, Recharts, Tailwind
NetworkingTailscale mesh, zlib WebSocket compression

License

Private repository.

Ver o original no GitHub

Bom para

Relacionados