7 Parallel AI Agent Chains · Pinecone Hybrid RAG · Real-time SSE

Your Strategy,
Autonomously
Engineered

Upload your knowledge base, define your objective, and let NEXUS run 7 specialised AI agents in parallel — each grounded in your documents via Pinecone Hybrid RAG — delivering a complete strategic brief in under 30 seconds.

7x
Parallel Agents
<30s
Full Report
Live Pipeline Preview
📂 Knowledge Base — PDF / DOCX / TXT
Celery Worker → Pinecone Index
Hybrid RAG — Semantic + Keyword Re-rank
RunnableParallel — 7 agent chains
Executive Summary Market Analysis Competitive Monetization Risk Roadmap Weakness
Aggregation Chain → Final Brief
Complete SSE streamed · 24.1s
7
AI Agent Chains
RAG
Pinecone Hybrid
SSE
Real-time Streaming
LCEL
LangChain Pipelines
JWT
Secure Auth
Analysis Modules

Seven agents. One unified strategy.

All 7 chains fire simultaneously via LangChain LCEL's RunnableParallel. Each agent retrieves its own document context from Pinecone — your full strategy brief is ready in seconds, not hours.

01
📊
Executive Summary
Problem, opportunity & solution overview
02
📈
Market Analysis
TAM / CAGR / trends with tool use
03
⚔️
Competitive Landscape
Porter's 5 forces & positioning
04
💰
Monetization Strategy
Revenue models, pricing & LTV:CAC
05
🛡️
Risk Assessment
Threats, mitigations & risk rating
06
🗺️
30-60-90 Roadmap
RICE-scored milestones & cost estimates
07
🔍
Weakness Review
Gap analysis & blind spots

Architecture

From document to decision.

A five-stage async pipeline — knowledge base indexing handled separately by Celery so the generation pipeline never blocks on I/O.

01

Build Knowledge Base

Upload PDFs, DOCX, or TXT files. A Celery background task chunks each document and indexes it into Pinecone Serverless using BAAI/bge-small-en-v1.5 embeddings (384-dim). Indexed once, reused forever.

Celery · Pinecone · HuggingFace
02

Select Documents + Objective

Choose which KB documents to ground the analysis in. Define your strategic objective. Document IDs are passed directly — no re-indexing, no file uploads at pipeline time.

Django REST · JWT Auth
03

Hybrid RAG Per Agent

Each of the 7 agents runs its own semantic query against Pinecone. Results are re-ranked by keyword overlap + cosine similarity. Every agent gets context tailored to its analysis domain.

Pinecone · Hybrid RAG · Re-rank
04

Parallel Agents + SSE Stream

RunnableParallel fires all 7 chains at once via Celery. Pipeline events — start, RAG done, each agent complete, final brief — stream to the browser in real-time via Server-Sent Events over Redis.

RunnableParallel · SSE · Redis

Key Features

Production-grade patterns.

Real architectural decisions — not toy demos.

Parallel Execution

7 chains fire simultaneously

LangChain's RunnableParallel runs all 7 analysis chains at once via Celery — cutting sequential analysis from 3+ minutes down to the time of the single slowest chain (~20-30s).

executive_summary market_analysis competitive_landscape monetization_strategy risk_assessment roadmap weakness_review
Pinecone Hybrid RAG

Semantic + keyword re-ranking

Documents are embedded with BAAI/bge-small-en-v1.5 (384-dim) and indexed in Pinecone Serverless. At query time, cosine similarity results are re-ranked by keyword overlap — hybrid scoring for better grounding.

query_vec = emb.embed("market size CAGR")
results = pinecone.query(vec, top_k=3)
# keyword re-rank → top 2 returned
Real-time Streaming

Live pipeline via SSE

Pipeline events are pushed to Redis by the Celery worker and streamed to the browser via Server-Sent Events — users see every step live as it happens, not a loading spinner.

rag_retrievalContext fetched from KB
agents_start7 chains launched
agent_roadmapRoadmap — complete
aggregatingBuilding final brief...
Structured Output

Pydantic v2 validated JSON

Every agent output is validated against a Pydantic v2 schema via LangChain's JsonOutputParser. Failed parse triggers an automatic JSON-only retry. No unstructured text reaches the DB.

"market_analysis": {
  "tam": "$42B",
  "cagr_percentage": 18.4
}
LangChain Tool Use

Agents with bound tools

Market Analysis, Competitive, and Roadmap agents use chat_model.bind_tools() — the LLM calls quantitative and qualitative tools mid-chain. Tool results are injected back before the final JSON response.

Aggregation Chain

Unified brief — not 7 disconnected reports

After all 7 chains complete, a final aggregation chain synthesizes everything into a coherent strategic brief. Agent outputs are slimmed to ~400 tokens before aggregation to stay within context limits — a deliberate token-efficiency choice.

Market Opportunity
Competitive Position
Monetization Fit
Risk Exposure
Performance Engineering

Module-level singletons — expensive objects load once per worker

The HuggingFace transformer (BAAI/bge-small-en-v1.5) and Pinecone index client are cached as module-level globals in the Celery worker process. They load once on first task, then are reused across all subsequent pipeline runs — eliminating a ~17s model-load penalty and 14 wasted Pinecone HTTP calls per pipeline.

# Both live at module scope — survive across tasks in the same worker
_EMB_CACHE = None   # BAAI/bge-small-en-v1.5 — loaded once (~17s), reused forever
_INDEX_CACHE = None  # Pinecone Index client — one list_indexes() call ever

System Design

Every layer purpose-built.

A full-stack async system — from auth to vector search to real-time UI.

🔐
Auth Layer
Django + SimpleJWT
JWT access + refresh tokens, CSRF protection, login/signup/reset flows
📚
Knowledge Base
Django + Celery
File upload → async indexing task → Pinecone. Status tracked in DB (pending → indexing → indexed)
🧠
Embeddings
BAAI/bge-small-en-v1.5
384-dim sentence embeddings via HuggingFace sentence-transformers. Module-level cached per worker
🔍
Vector Store
Pinecone Serverless
Cosine similarity, AWS us-east-1. Filtered by doc_id — per-user knowledge isolation
Task Queue
Celery + Redis
Pipeline runs as background Celery tasks. Redis as broker + SSE event store
🤖
LLM Orchestration
LangChain LCEL + Groq
RunnableParallel for 7 chains, RunnableLambda for tool use, JsonOutputParser for validated output
📡
Real-time Events
SSE via Redis Lists
Celery worker pushes events to Redis. Django SSE view streams them to the browser — no WebSocket needed
🗄️
REST API
Django REST Framework
DRF serializers with nested relationships for Thread → AgentResponse → FinalStrategy
Validation
Pydantic v2
Input validation on all pipeline requests. Agent JSON outputs validated and auto-retried on parse failure
📊
Reports
Full Strategy Breakdown
Every analysis saved as a structured report — 7 agent outputs + a final strategy brief. Browse, filter, and revisit any past run instantly.

Technology Stack

Everything that powers it.

The complete set of technologies used — from LLM orchestration to deployment infrastructure.

AI / ML
LangChain LCEL RunnableParallel Groq LLM JsonOutputParser Tool Binding Pydantic v2 BAAI/bge-small-en-v1.5 HuggingFace Transformers sentence-transformers
Vector Search
Pinecone Serverless Hybrid RAG Cosine Similarity Semantic Search Keyword Re-rank 384-dim Vectors doc_id Filtering
Backend / Infra
Django Django REST Framework Celery Redis SimpleJWT Server-Sent Events PostgreSQL Django ORM gunicorn

Strategy doesn't wait.
Neither should you.

Upload your knowledge base, set your objective, and get a full AI-powered strategic brief — streamed live in under 30 seconds.

Build My Strategy → Sign In