Coordinator-driven multi-agent AI system for structured debate, opposition, and synthesis over a normalized reasoning context.
The system extracts debatable factors, argues for and against them using independent agents, and synthesizes a transparent final report β all orchestrated deterministically.
- Multi-Agent Orchestration: FactorExtractor, Support, Opposition, and Synthesizer agents working in sequence
- PDF Processing:
- Text extraction from PDFs
- Table extraction and parsing (numeric values β metrics)
- Metadata extraction
- Structured Debate System: Automatic pro/con analysis for each identified factor
- Reasoning Context Management: Unified data model for facts, metrics, assumptions, and limitations
- JSON Logging: All analysis sessions logged with full reasoning trace
- PDF Report Generation: Beautiful formatted PDF reports with embedded analysis
- Interactive UI: Components for uploading PDFs, entering factors, and viewing results
- Real-time Analysis: Direct integration with backend API
- Responsive Design: Mobile-friendly interface
- Factor Management: Input custom factors with domain tagging
- Results Display: Visualized debate logs and synthesis
- Backend: Python 3.10+, FastAPI, Pydantic v2, Gemini via Vertex AI (google-genai)
- Frontend: React 19+, Vite, CSS
- Data Processing: PyPDF2, Camelot (table extraction)
- Async: async/await architecture
- Logging: Structured JSON logging
- PDF Generation: ReportLab
Request (via API or PDF Upload)
β
ReasoningContext (validated)
β
FactorExtractorAgent β Extract debatable factors + domain
β
SupportAgent β Generate pro arguments for each factor
β
OppositionAgent β Generate counter arguments
β
SynthesizerAgent β Combine and synthesize findings
β
Final Structured Report + Debate Logs
β
Optional: Generate PDF Report
Key Properties:
- Agents never call each other directly
- Orchestrator enforces sequence deterministically
- No agent invents facts beyond the provided context
- All outputs are strict JSON schemas
- Table parsing is optional and never crashes the pipeline
python -m venv .venv
.\.venv\Scripts\Activate.ps1pip install -r requirements.txtNote: Camelot table extraction requires optional system libraries:
- On Windows, it should work out of the box
- On macOS/Linux, you may need
graphvizinstalled for best compatibility
Create a .env file in the project root or backend/ (Vertex AI via ADC):
GCP_PROJECT=YOUR_GCP_PROJECT_ID
GCP_LOCATION=us-central1
GEMINI_MODEL=gemini-2.5-pro
β οΈ .envis git-ignored and must not be committed.
Environment variables are loaded automatically using python-dotenv.
Make sure ADC is configured (for example, gcloud auth application-default login or a service account).
cd backend
uvicorn app.main:app --host 0.0.0.0 --port 8000API root: π http://localhost:8000/
cd frontend
npm install
npm run devFrontend: π http://localhost:5173/
Optional frontend API base override (create frontend/.env):
VITE_API_BASE=http://localhost:8000Analyze structured reasoning context with debate and synthesis.
{
"narrative": "Main report text",
"extracted_facts": [
"Customer engagement increased in metro cities during Q3",
"Tier-2 cities experienced higher churn rates"
],
"metrics": [
{
"name": "conversion_rate",
"region": "metro",
"value": 3.4
}
],
"assumptions": ["Higher engagement generally leads to higher revenue"],
"limitations": ["Customer demographics were not segmented"]
}{
"final_report": {
"what_worked": "...",
"what_failed": "...",
"why_it_happened": "...",
"how_to_improve": "...",
"synthesis": "...",
"recommendation": "...",
"confidence_score": 85
},
"factors": [
{
"factor_id": "F1",
"description": "...",
"domain": "sales"
}
],
"debate_logs": [
{
"factor_id": "F1",
"factor": {
"factor_id": "F1",
"description": "...",
"domain": "sales"
},
"support": {
"support_arguments": [
{
"claim": "...",
"evidence": "...",
"assumption": "..."
}
]
},
"opposition": {
"counter_arguments": [
{
"target_claim": "...",
"challenge": "...",
"risk": "..."
}
]
}
}
]
}Upload and analyze a PDF document.
- Extracts text from all pages
- Extracts tables (converts numeric values to metrics)
- Returns analysis results in same format as
/analyze
Analyze structured context and return PDF report.
Returns a beautifully formatted PDF with:
- Executive summary from synthesis
- Extracted factors with domain labels
- Full debate logs with support/opposition arguments
- Timestamps and confidence scores
Upload PDF, analyze it, and return formatted PDF report.
Combines PDF extraction and report generation in one request.
Returns the current orchestration phase and status metadata.
Returns a PDF report for the most recent analysis (without re-running).
class Metric(BaseModel):
name: str
region: Optional[str] = None
value: float
class ReasoningContext(BaseModel):
narrative: str
extracted_facts: List[str] = []
metrics: List[Metric] = []
assumptions: List[str] = []
limitations: List[str] = []Supported domains for factors:
- sales
- organization
- policy
- statistics
- Uses Camelot library to extract tables from PDFs
- Processes all pages automatically
- First row assumed to be headers
- First column (if present) becomes region label
- Numeric cells converted to metrics
- Non-numeric cells skipped
- Errors logged but never crash the pipeline
- Processing continues normally with text extraction only
- Returns empty metrics list
- All reasoning sessions are logged as structured JSON
- Location:
logs/reasoning_logs.json - The
logs/directory is ignored by Git - Includes full trace of all agent outputs and decisions
- No hallucination β agents rely strictly on provided context
- Debate-first reasoning β every claim is challenged
- Deterministic flow β orchestrator controls execution
- Schema-validated outputs β every agent returns strict JSON
- Graceful degradation β optional features (table parsing) never crash
- Transparent reasoning β all intermediate steps logged
- Domain-aware β factors categorized by domain for better analysis
project-aether/
βββ README.md
βββ frontend/
β βββ package.json
β βββ vite.config.js
β βββ index.html
β βββ src/
β βββ main.jsx
β βββ App.jsx
β βββ App.css
β βββ index.css
β βββ components/
β β βββ PdfUpload.jsx
β β βββ FactorsList.jsx
β β βββ JsonInput.jsx
β β βββ ResultsDisplay.jsx
β βββ pages/
β β βββ Home.jsx
β β βββ Results.jsx
β βββ services/
β βββ api.js
βββ backend/
βββ requirements.txt
βββ app/
β βββ main.py
β βββ orchestrator.py
β βββ agents/
β β βββ base_agent.py
β β βββ factor_extractor.py
β β βββ support_agent.py
β β βββ opposition_agent.py
β β βββ synthesizer_agent.py
β βββ schemas/
β β βββ context.py
β β βββ factor.py
β β βββ debate.py
β β βββ final_report.py
β βββ utils/
β β βββ pdf_parser.py
β β βββ pdf_generator.py
β β βββ logger.py
β β βββ llm_client.py
β βββ prompts/
β βββ factor_prompt.txt
β βββ support_prompt.txt
β βββ opposition_prompt.txt
β βββ synthesis_prompt.txt
βββ logs/
βββ reasoning_logs.json
- The system uses Gemini via Vertex AI (
google-genaiSDK) - Billing or available quota is required for sustained usage
- Free-tier quotas may be limited depending on project settings
- Agents are isolated and stateless per request
- Table parsing works with standard PDFs; complex/scanned PDFs may require OCR (not currently supported)
- All timestamps are UTC
.envfiles must never be committed (git-ignored by default)
- OCR support for scanned PDFs
- Chart extraction and analysis
- Multi-language support
- Custom domain definitions
- Result caching and history
- Advanced report formatting options
- Real-time collaborative analysis
- Integration with more LLM providers