Pramana.ai includes five specialized AI agents, each optimized for different research workflows. All agents are powered by Groq's LLaMA models and built using LangGraph.
AI-powered pharmaceutical innovation discovery with multi-source evidence synthesis
The Portfolio Strategist is the default agent for biomedical opportunity analysis. It orchestrates parallel research across six data sources, applies sophisticated decision heuristics, and generates comprehensive opportunity reports.
flowchart LR
A[User Query] --> B[Clarify Scope]
B --> C[Dispatch Workers]
C --> D1[IQVIA] & D2[Trials] & D3[Patents] & D4[EXIM] & D5[Internal] & D6[Web]
D1 & D2 & D3 & D4 & D5 & D6 --> E[Apply Heuristics]
E --> F[Synthesize Evidence]
F --> G[Generate Story]
G --> H[Portfolio Report]
Market intelligence and competitive landscape
- Market size and CAGR projections
- Competitive concentration (HHI index)
- Top player market shares
- Unmet need scoring
- Fragmentation analysis
Live research activity via ClinicalTrials.gov API
- Active and recruiting trials
- Sponsor classification (Industry, Academic, NIH)
- Phase distribution (Phase 1-4)
- Enrollment statistics
- Geographic distribution
IP landscape analysis
- Patent expiration timelines
- Freedom-to-operate (FTO) status
- Claim breadth analysis
- Jurisdictional coverage
- Blocking patents identification
Import/export intelligence
- Dependency scoring
- Local manufacturing opportunities
- Import volume trends
- Cost competitiveness
- Supply chain insights
Proprietary data and institutional knowledge
- Past project outcomes
- Internal expertise mapping
- Resource availability
- Strategic alignment
General market intelligence
- News and trends
- KOL opinions
- Market access insights
- Regulatory developments
The Portfolio Strategist applies seven sophisticated decision heuristics to evaluate opportunities:
Identifies unmet medical needs with limited competition
# Scoring Logic
if unmet_need > 0.7 and active_trials < 5:
signals.append("HIGH_WHITESPACE")
opportunity += 20
elif unmet_need > 0.5 and active_trials < 10:
signals.append("MODERATE_WHITESPACE")
opportunity += 10Impact:
- High Whitespace: +20 opportunity points
- Moderate Whitespace: +10 opportunity points
Example: Metformin for anti-aging in the US shows HIGH_WHITESPACE with unmet need score of 0.85 and only 3 active trials.
Identifies opportunities with expiring key patents
# Scoring Logic
expiring_soon = [patent for patent in patents if years_to_expiry <= 3]
if expiring_soon:
signals.append("PATENT_WINDOW_OPEN")
opportunity += 15
innovation += 10Impact:
- Opportunity: +15 points
- Innovation: +10 points
Example: Major diabetes drugs with patents expiring 2025-2027 create PATENT_WINDOW_OPEN opportunities.
Evaluates competitive intensity
# Scoring Logic
if total_players > 20 and top_5_share > 70:
signals.append("CROWDED_MARKET")
opportunity -= 15
risk += 10
elif fragmentation_index == "HIGH":
signals.append("FRAGMENTED_MARKET")
opportunity += 10Impact:
- Crowded Market: -15 opportunity, +10 risk
- Fragmented Market: +10 opportunity
Metrics Used:
- Total player count
- Top 5 concentration ratio
- Fragmentation index (HIGH/MEDIUM/LOW)
Identifies local manufacturing opportunities
# Scoring Logic
if import_dependency > 0.7:
signals.append("HIGH_IMPORT_DEPENDENCY")
risk += 10
if "LOCAL_MANUFACTURING_OPPORTUNITY" in flags:
signals.append("LOCAL_MFG_OPPORTUNITY")
opportunity += 8Impact:
- High Dependency: +10 risk
- Local Mfg Opportunity: +8 opportunity
Example: India's respiratory drug market shows HIGH_IMPORT_DEPENDENCY (0.82) but strong LOCAL_MFG_OPPORTUNITY.
Detects major player presence in late-stage trials
# Scoring Logic
big_pharma_late_stage = [
trial for trial in trials
if sponsor_class == "INDUSTRY" and phase in ["PHASE3", "PHASE4"]
]
if big_pharma_late_stage:
signals.append("BIG_PHARMA_ACTIVE")
opportunity -= 10
risk += 5Impact:
- Opportunity: -10 points
- Risk: +5 points
Rationale: Late-stage industry trials indicate crowded competitive space.
Evaluates market trajectory
# Scoring Logic
if cagr_5yr > 8:
signals.append("HIGH_GROWTH_MARKET")
opportunity += 12
elif cagr_5yr > 5:
signals.append("MODERATE_GROWTH")
opportunity += 5Impact:
- High Growth (>8% CAGR): +12 opportunity
- Moderate Growth (5-8% CAGR): +5 opportunity
Identifies IP blocking risks
# Scoring Logic
fto_blocked = [patent for patent in patents if fto_status == "BLOCKED"]
fto_warnings = [patent for patent in patents if fto_status == "WARNING"]
if fto_blocked:
signals.append("FTO_BLOCKED")
risk += 20
opportunity -= 15
elif fto_warnings:
signals.append("FTO_WARNING")
risk += 10Impact:
- FTO Blocked: +20 risk, -15 opportunity
- FTO Warning: +10 risk
The Portfolio Strategist generates a comprehensive report with:
- Executive Summary — One-paragraph opportunity synthesis
- Opportunity Score — 0-100 scale with breakdown
- Risk Score — 0-100 scale with breakdown
- Innovation Score — 0-100 scale with breakdown
- Signal Summary — List of triggered heuristic signals
- Evidence Base — Citations and data sources
- Strategic Recommendation — Go/No-Go with rationale
| Molecule/Therapy | Region | Opportunity Score | Key Signals |
|---|---|---|---|
| Metformin (Anti-Aging) | United States | 87/100 | HIGH_WHITESPACE, PATENT_WINDOW_OPEN, HIGH_GROWTH_MARKET |
| COPD Respiratory Therapy | India | 85/100 | HIGH_WHITESPACE, FRAGMENTED_MARKET, LOCAL_MFG_OPPORTUNITY |
| Oncology Checkpoint Inhibitor | Europe | 42/100 | CROWDED_MARKET, BIG_PHARMA_ACTIVE, FTO_WARNING |
The Portfolio Strategist is configured in backend/src/agent/portfolio/orchestrator.py.
Key Parameters:
max_parallel_workers: 6 (default)timeout_per_worker: 30 secondsheuristic_weight_profiles: Customizable scoring weights
⚠️ Important: Current connectors use mock data for demonstration. In production, replace with real APIs:
- IQVIA: Requires enterprise license
- Patents: Use USPTO/EPO APIs or Google Patents
- EXIM: Connect to trade databases (e.g., UN Comtrade)
- Internal: Integrate with your data warehouse
Advanced web research with iterative query refinement and citation tracking
The Deep Researcher performs comprehensive web research using SerpAPI, with intelligent query generation and reflection loops to ensure thorough coverage.
flowchart TD
A[User Query] --> B[Generate Initial Queries]
B --> C[Parallel Web Research]
C --> D[Gather Results]
D --> E{Reflection}
E -->|Knowledge Gaps| F[Generate Follow-up Queries]
F --> C
E -->|Sufficient| G[Synthesize Report]
G --> H[Citation-First Output]
Uses Groq LLMs to generate optimized search queries:
# Example generated queries for "CRISPR gene therapy safety"
[
"CRISPR gene therapy clinical trial safety results 2024",
"off-target effects CRISPR Cas9 human trials",
"FDA CRISPR therapy adverse events reporting"
]After each research iteration, the agent reflects on:
- Information completeness
- Knowledge gaps
- Source quality
- Need for follow-up queries
Max Iterations: 2 (configurable)
Every claim is backed by:
- Source URL
- Publication date
- Relevance score
- Snippet extraction
| Parameter | Default | Description |
|---|---|---|
initial_search_query_count |
3 | Number of initial queries to generate |
max_research_loops |
2 | Maximum refinement iterations |
search_result_limit |
10 | Results per query |
reasoning_model |
llama-3.3-70b-versatile | Model for query generation and reflection |
response_model |
llama-3.3-70b-versatile | Model for final synthesis |
Edit Configuration: Modify backend/src/agent/deep_researcher.py or pass configuration via LangGraph Studio.
# Research Report: [Topic]
## Executive Summary
[One-paragraph overview]
## Key Findings
### Finding 1: [Title]
[Detailed explanation]
**Sources:**
1. [Source Title](URL) — [Date]
2. [Source Title](URL) — [Date]
### Finding 2: [Title]
[Detailed explanation]
**Sources:**
...
## Sources Consulted
- [Complete bibliography with URLs]- Be Specific — Better: "CAR-T therapy for pediatric ALL safety data 2023-2024" vs "cancer treatment"
- Set Context — Mention year, geography, or specific aspects
- Iterate — Review first output and ask follow-up questions
- Verify — Always check source citations for accuracy
Required: SERPAPI_API_KEY in .env
# Get your key from https://serpapi.com/
SERPAPI_API_KEY=your_serpapi_api_key_hereAlternative: Set MCP_BRAVE_SEARCH_ENABLED=true and use Brave Search MCP server.
General-purpose conversational AI with context awareness
A friendly, helpful chatbot for casual conversation and quick Q&A.
- Conversational Memory — Maintains last 10 messages for context
- Fast Responses — Powered by Groq's optimized inference
- Friendly Tone — Natural, approachable communication style
- No Tool Calling — Pure conversation without web search or calculations
- Quick questions and clarifications
- General knowledge queries
- Friendly conversation
- Explaining concepts
- Brainstorming ideas
Model: llama-3.3-70b-versatile (default)
System Prompt: Friendly, helpful assistant persona
Message History: Last 10 messages
Streaming: Enabled by default
Edit Configuration:
backend/src/agent/chatbot_graph.py
User: "Explain LangGraph in simple terms"
Assistant: "LangGraph is a framework for building AI agents as graphs. Think of it like a flowchart where each box is an AI task, and arrows show how information flows. It makes complex AI workflows easier to build, test, and understand!"
User: "What's the difference between supervised and unsupervised learning?"
Assistant: [Provides clear explanation with examples]
Safe mathematical expression evaluation and problem-solving
A specialized agent for mathematical calculations with sandboxed execution.
"2 + 3 * 4" # → 14
"10 / 2 - 3" # → 2.0
"2 ** 8" # → 256"sqrt(16)" # → 4.0
"sin(pi/2)" # → 1.0
"cos(0)" # → 1.0
"tan(pi/4)" # → 1.0
"log(e)" # → 1.0
"exp(1)" # → 2.718..."sqrt(sin(pi/4)**2 + cos(pi/4)**2)" # → 1.0
"2 * pi * 5" # → 31.415...- Sandboxed Execution — Isolated evaluation environment
- Whitelist Functions — Only safe math operations allowed
- No File System Access — Cannot read/write files
- No Network Access — Cannot make external requests
- No Code Execution — Only mathematical expressions
Allowed Functions:
- Arithmetic:
+,-,*,/,**,//,% - Math:
sqrt,sin,cos,tan,log,exp,log10,factorial - Constants:
pi,e
Tool: calculator from backend/src/tools/calculator.py
Model: llama-3.3-70b-versatile
Max Expression Length: 500 characters
User: "What's the square root of 144?"
Math Agent: Let me calculate that. [uses calculator]
Answer: 12.0
User: "Calculate sin(30 degrees)"
Math Agent: Converting to radians... [uses calculator]
sin(30°) = sin(pi/6) ≈ 0.5
User: "If I invest $1000 at 5% annual interest for 10 years, how much will I have?"
Math Agent: Using compound interest formula A = P(1 + r)^t
[uses calculator]
$1000 * (1.05)^10 ≈ $1,628.89
Model Context Protocol integration for extensible tool ecosystem
The MCP Agent connects to external MCP servers, enabling file operations, web search, and other tool integrations.
Model Context Protocol is an open standard for connecting AI agents to external tools and data sources. Think of it as a universal adapter for AI tools.
File and directory operations
Capabilities:
- Read file contents
- Write files
- List directories
- Create/delete files
- Sandboxed access to specified paths
Configuration:
# backend/.env
MCP_FILESYSTEM_ENABLED=true
MCP_FILESYSTEM_PATH=/app/workspace # Sandbox rootExample Usage:
User: "Read the contents of project_notes.txt"
MCP Agent: [reads file] Here are the contents...
User: "Create a new file called summary.md with this content: ..."
MCP Agent: [creates file] File created successfully at /app/workspace/summary.md
Web search alternative to SerpAPI
Capabilities:
- Web search
- News search
- Result processing
- Citation extraction
Configuration:
# backend/.env
MCP_BRAVE_SEARCH_ENABLED=true
BRAVE_API_KEY=your_brave_api_key_hereGet API Key: https://brave.com/search/api/
-
Install the MCP server:
npm install -g @modelcontextprotocol/server-[name]
-
Configure in backend/src/config/mcp_config.py:
MCP_SERVERS = [ { "name": "my_custom_server", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-my-custom"], "env": {"API_KEY": os.getenv("MY_CUSTOM_API_KEY")} } ]
-
Restart the backend — MCP servers load at startup
┌─────────────────────────────────────────────────┐
│ MCP Agent (LangGraph) │
└────────────────────┬────────────────────────────┘
│
┌────────────┴────────────┐
│ MCP Loader (SSE/Stdio) │
└────────────┬────────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌────▼────┐ ┌────▼────┐ ┌────▼────┐
│Filesystem│ │ Brave │ │ Custom │
│ Server │ │ Search │ │ Server │
└──────────┘ └─────────┘ └─────────┘
- Sandbox Paths — Always use sandboxed directories for filesystem access
- Error Handling — MCP agents handle server failures gracefully
- Parallel Init — Multiple MCP servers load in parallel at startup
- Resource Limits — Configure timeouts for long-running operations
MCP server not loading:
- Check server is installed:
npm list -g | grep mcp - Verify environment variables in
.env - Check logs: Backend will log MCP initialization errors
Tool not available:
- Confirm server is enabled in config
- Restart backend after config changes
- Check MCP server health endpoint
| Use Case | Recommended Agent | Why |
|---|---|---|
| Drug opportunity analysis | Portfolio Strategist | Multi-source synthesis + heuristics |
| Research deep dive | Deep Researcher | Iterative web research + citations |
| Quick Q&A | Chat Assistant | Fast, conversational |
| Calculations | Math Solver | Safe expression evaluation |
| File operations | MCP Agent | Filesystem access via MCP |
| Web search (no SerpAPI) | MCP Agent | Brave Search MCP server |
All agents are built using:
- LangGraph — Graph-based agent orchestration
- LangChain — LLM framework and tool integration
- Groq — Fast inference with LLaMA models
- State Management — Persistent state across agent steps
- Streaming — Real-time output via Server-Sent Events (SSE)
Agent Registration: backend/langgraph.json
{
"graphs": {
"portfolio_strategist": "./src/agent/portfolio/orchestrator.py:portfolio_graph",
"deep_researcher": "./src/agent/deep_researcher.py:deep_researcher_graph",
"chatbot": "./src/agent/chatbot_graph.py:chatbot_graph",
"math_agent": "./src/agent/math_agent.py:math_agent_graph",
"mcp_agent": "./src/agent/mcp_agent.py:mcp_agent_graph"
}
}- Architecture Overview — System design and infrastructure
- API Reference — LangGraph endpoints and schemas
- Configuration — Environment variables and model selection
- Development Guide — Building custom agents
Need help? Check the Troubleshooting Guide or open an issue on GitHub.