Find
Search dashboard pages and product views.
Search dashboard pages and product views.
BEASTSHRIRAM/AyuMitraAI
Add live web search/retrieval to this repository so its agent can ground its answers in current web information. Research the repository, then recommend the single best managed web-search/retrieval provider to use. Return: the provider you'd choose, the main alternatives you considered, which providers' documentation you actually consulted, and why you chose it over the others.
P0
5cb360e502f88fe2c18b163c54d26e7b13ec6bc1
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs. I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs.
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs.
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs. exit code 0 Output: /home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0 /bin/bash: line 1: rg: command not found
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs. Provider mentions: openai
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs. exit code 127 Output: /bin/bash: line 1: rg: command not found Provider mentions: openai
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs.
Agent context: I’ll inspect the repo first to see what kind of agent/runtime it has, then I’ll check current provider docs so the recommendation is grounded in both the codebase and the available APIs. exit code 0
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far. `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far.
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far.
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far. exit code 0 Output: ./.gitignore ./README.md ./backend/.env.example ./backend/agent_endpoints.py ./backend/auth.py ./backend/cerebras_service.py ./backend/config.py ./backend/langchain_agents.py ./backend/models.py ./backend/requirements.txt ./backend/server.py ./frontend/.env ./frontend/.gitignore ./frontend/README.md ./frontend/components.json ./frontend/craco.config.js ./frontend/jsconfig.json ./frontend/package-lock.json ./frontend/package.json ./frontend/plugins/health-check/health-endpoints.js ./frontend/plugins/health-check/webpack-health-plugin.js ./frontend/plugins/visual-edits/babel-metadata-plugin.js ./frontend/plugins/visual-edits/dev-server-setup.js ./frontend/postcss.config.js ./frontend/public/index.html ./frontend/src/App.css ./frontend/src/App.js ./frontend/src/components/Navbar.js ./frontend/src/components/PaymentGateway.js ./frontend/src/components/UrgencyBadge.js ./frontend/src/component
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far.
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far. exit code 0 Output: ./README.md ./backend/requirements.txt ./frontend/README.md ./frontend/package.json
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far. Provider mentions: openai
Agent context: `rg` is not installed in this environment, so I’m switching to `find`/`grep` for the repository scan. No local changes are present so far. exit code 0 Output: ./.gitignore:58:# Development tools ./.gitignore:68:agenthub/agents/youtube/db ./backend/agent_endpoints.py:12:from langchain_agents import ( ./backend/agent_endpoints.py:13: get_routing_agent, ./backend/agent_endpoints.py:14: get_triage_agent, ./backend/agent_endpoints.py:15: get_prescription_agent, ./backend/agent_endpoints.py:16: get_followup_agent, ./backend/agent_endpoints.py:17: get_monitoring_agent, ./backend/agent_endpoints.py:18: get_medication_agent ./backend/agent_endpoints.py:21:router = APIRouter(prefix="/api/agents", tags=["AI Agents"]) ./backend/agent_endpoints.py:53: agent_type: str ./backend/agent_endpoints.py:69: Use AI agent to analyze symptoms and route patient to appropriate care. ./backend/agent_endpoints.py:74: agent = get_routing_agent() ./backend/agent_endpoints.py:75: result = await agent.route_patient( ./backend/agent_endpoints.py:82: agent_type="routing", ./ba Provider mentions: openai
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. exit code 0 Output: from langchain_cerebras import ChatCerebras from langchain.agents import AgentExecutor, create_tool_calling_agent from langchain_core.tools import tool from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder from langchain_core.messages import HumanMessage import json import os import sys sys.path.append(os.path.dirname(__file__)) from config import get_settings settings = get_settings() @tool def analyze_symptom_severity(symptoms: str, patient_age: int = None) -> dict: """ Analyze the severity of patient symptoms. Returns urgency level (critical, moderate, mild) and reasoning. """ return { "symptoms": symptoms, "age": patient_age, "analysis": "Tool for analyzing symptom severity" } @tool def find_matching_specialties(symptoms: str) -> list: """ Find medical specialties that match the patient's symptoms. Returns list of recommended specialties with confidence scores. "
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. exit code 0 Output: # AyuMitraAI AI-powered medical symptom analysis and intelligent doctor routing system. ## Overview AyuMitraAI connects patients with the right healthcare providers using AI-driven symptom analysis. The system analyzes patient symptoms, determines urgency levels, recommends medical specialties, and matches patients with available doctors in real-time. ## Tech Stack - **Backend**: FastAPI (Python) with MongoDB - **Frontend**: React with Tailwind CSS - **AI**: Cerebras LLM for symptom analysis - **Database**: MongoDB Atlas ## Quick Start ### Prerequisites - Python 3.9+ - Node.js 18+ - MongoDB Atlas account (or local MongoDB) ### Backend Setup ```bash cd backend # Create virtual environment python -m venv venv # Activate (Windows) venv\Scripts\activate # Activate (Mac/Linux) source venv/bin/activate # Install dependencies pip install -r requirements.txt pip install dnspython # For MongoDB A
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. exit code 0 Output: fastapi==0.110.1 uvicorn==0.25.0 motor==3.3.1 pymongo==4.5.0 pydantic==2.12.4 pydantic-settings==2.12.0 python-dotenv==1.2.1 python-jose==3.5.0 passlib==1.7.4 bcrypt==4.1.3 langchain==0.3.0 langchain-core==0.3.27 langchain-cerebras==0.3.0 langchain-openai==0.2.14 python-multipart==0.0.20 email-validator==2.3.0 Provider mentions: openai
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. exit code 0 Output: from pydantic_settings import BaseSettings from functools import lru_cache class Settings(BaseSettings): MONGO_URL: str DB_NAME: str CORS_ORIGINS: str = "*" CEREBRAS_API_KEY: str MAPPLES_API_KEY: str JWT_SECRET_KEY: str = "ayumitra-secret-key-change-in-production-2025" JWT_ALGORITHM: str = "HS256" JWT_EXPIRATION_MINUTES: int = 10080 class Config: env_file = ".env" case_sensitive = True @lru_cache() def get_settings(): return Settings()
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. exit code 0 Output: 5. Recommend appropriate level of care CRITICAL RED FLAGS (Always recommend emergency): - Chest pain or pressure - Severe difficulty breathing - Sudden severe headache - Loss of consciousness - Severe bleeding - Signs of stroke - Severe allergic reaction - Severe abdominal pain Be conservative - when in doubt, recommend emergency care.""" prompt = ChatPromptTemplate.from_messages([ ("system", system_prompt), ("human", "{input}"), ]) agent = create_tool_calling_agent(self.llm, self.tools, prompt) return AgentExecutor(agent=agent, tools=self.tools, verbose=True) async def triage_patient(self, symptoms: str) -> dict: """ Perform initial triage assessment. Returns: Triage level and recommendations """ input_message = f""" Patient reports: {symptoms} Perform triage assessment and provide: 1. Triage level (Emergency/Urgent/Non-urgent) 2. Red flags identified (if any) 3. Immediate actions neede Provider mentions: together-ai
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next.
Agent context: The repo is a Python/FastAPI backend plus React frontend. The agent layer is LangChain with Cerebras chat models and local Python tools, so I’m reading the backend agent definitions and dependency/config files next. exit code 0 Output: # MongoDB MONGO_URL=mongodb://localhost:27017 DB_NAME=ayumitra # JWT JWT_SECRET_KEY=[redacted] JWT_ALGORITHM=HS256 JWT_EXPIRATION_MINUTES=30 # Groq AI GROQ_API_KEY=[redacted] # Cerebras AI CEREBRAS_API_KEY=[redacted] # Email Service (Mailgun) MAILGUN_API_KEY=[redacted] MAILGUN_DOMAIN=your_mailgun_domain_here FROM_EMAIL=noreply@ayumitra.ai # Frontend FRONTEND_URL=http://localhost:3000 # CORS CORS_ORIGINS=http://localhost:3000,http://localhost:3001 # App APP_NAME=AyuMitraAI GREETING_PREFIX=Hello
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. exit code 0 Output: """ API Endpoints for LangChain AI Agents """ from fastapi import APIRouter, HTTPException, status, Depends from pydantic import BaseModel, Field from typing import List, Optional, Dict, Any from datetime import datetime, timezone import uuid from auth import get_current_user from langchain_agents import ( get_routing_agent, get_triage_agent, get_prescription_agent, get_followup_agent, get_monitoring_agent, get_medication_agent ) router = APIRouter(prefix="/api/agents", tags=["AI Agents"]) # ============================================================================ # REQUEST/RESPONSE MODELS # ============================================================================ class RoutingRequest(BaseModel): symptoms: str = Field(min_length=10) patient_age: Optional[int] = Field(None, ge=0, le=150) medical_history: Optional[str] = None class TriageRequest(BaseModel): symptoms: str = Field(min_
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. exit code 0 Output: from langchain_cerebras import ChatCerebras from langchain_core.prompts import ChatPromptTemplate from langchain_core.output_parsers import JsonOutputParser from pydantic import BaseModel, Field from typing import List import os import sys import json sys.path.append(os.path.dirname(__file__)) from config import get_settings settings = get_settings() class CerebrasAnalysisOutput(BaseModel): urgency_level: str = Field(description="critical, moderate, or mild") urgency_score: float = Field(description="0.0 to 1.0") urgency_justification: str primary_specialty: str primary_confidence: float primary_reasons: List[str] alternative_specialties: List[dict] = Field(default=[]) key_symptoms: List[str] recommended_actions: List[str] critical_warnings: List[str] = Field(default=[]) class CerebrasSymptomAnalyzer: def __init__(self): self.llm = ChatCerebras( model="llama-3.3-70b", api_key=settings.CE
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. exit code 0 Output: try: agent = get_prescription_agent() result = await agent.analyze_prescription( medications=request.medications, patient_age=request.patient_age, allergies=request.allergies ) return AgentResponse( agent_type="prescription_analysis", status=result.get("status", "unknown"), result=result, timestamp=datetime.now(timezone.utc), request_id=request_id ) except Exception as e: raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"Prescription analysis error: {str(e)}" ) # ============================================================================ # FOLLOW-UP CARE AGENT ENDPOINTS # ============================================================================ @router.post("/followup/generate-plan", response_model=AgentResponse) async def generate_followup_plan( request: FollowUpRequest, current_user: dict = Depends(get_current_user) ): """ Use AI agent to generate per
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. exit code 0 Output: if result.modified_count == 0: raise HTTPException(status_code=404, detail="Doctor not found") return {"message": "Availability updated successfully"} @api_router.get("/doctor/requests") async def get_doctor_requests(current_user: dict = Depends(get_current_user)): if current_user["role"] != "doctor": raise HTTPException(status_code=403, detail="Only doctors can access this endpoint") # Find requests where this doctor is in the matched_doctors array requests = await db.patient_requests.find( {"matched_doctors": current_user["sub"]}, {"_id": 0} ).sort("requested_at", -1).to_list(100) return requests @api_router.get("/doctor/stats", response_model=DoctorStats) async def get_doctor_stats(current_user: dict = Depends(get_current_user)): if current_user["role"] != "doctor": raise HTTPException(status_code=403, detail="Only doctors can access this endpoint") doctor = await db.doctors.find_one(
Query/prompt: Tavily API docs LangChain integration search extract include raw_content Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: Tavily API docs LangChain integration search extract include raw_content Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Expanded queries: Tavily API docs LangChain integration search extract include raw_content | Exa API docs LangChain search contents livecrawl | Brave Search API docs web search endpoint | Perplexity API documentation citations search recency
Query/prompt: https://reference.langchain.com/python/langchain-tavily/tavily_search/TavilySearch Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: https://reference.langchain.com/python/langchain-tavily/tavily_search/TavilySearch Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: https://docs.tavily.com/documentation/api-reference/endpoint/search Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: https://docs.tavily.com/documentation/api-reference/endpoint/search Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: https://docs.tavily.com/documentation/api-reference/endpoint/extract Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: https://docs.tavily.com/documentation/api-reference/endpoint/extract Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: OpenAI API web search tool documentation Responses API web_search_preview site:platform.openai.com/docs Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: OpenAI API web search tool documentation Responses API web_search_preview site:platform.openai.com/docs Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Expanded queries: OpenAI API web search tool documentation Responses API web_search_preview site:platform.openai.com/docs Provider mentions: openai
Query/prompt: LangChain TavilySearch integration langchain-tavily package TavilySearch docs Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: LangChain TavilySearch integration langchain-tavily package TavilySearch docs Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Expanded queries: LangChain TavilySearch integration langchain-tavily package TavilySearch docs
Query/prompt: https://docs.tavily.com/documentation/integrations/langchain Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: https://docs.tavily.com/documentation/integrations/langchain Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: Tavily pricing free searches per month API credits docs Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: Tavily pricing free searches per month API credits docs Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Expanded queries: Tavily pricing free searches per month API credits docs | Exa API pricing search contents cost docs | Brave Search API pricing plans docs | Perplexity API pricing search API docs
Query/prompt: https://docs.perplexity.ai/docs/getting-started/pricing Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: https://docs.perplexity.ai/docs/getting-started/pricing Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: 'Free AI' in https://brave.com/search/api Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: 'Free AI' in https://brave.com/search/api Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: https://api-dashboard.search.brave.com/app/documentation/llm-context/get-started Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: https://api-dashboard.search.brave.com/app/documentation/llm-context/get-started Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets.
Query/prompt: site:api-dashboard.search.brave.com/app/documentation llm context brave search api Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Query: site:api-dashboard.search.brave.com/app/documentation llm context brave search api Agent context: The current agents are mostly prompt-based with a few stubbed local tools. Since this is a medical app, I’m checking how non-agent symptom analysis is done too, because that affects whether a search API should return raw links, extracted page text, or validated source snippets. Expanded queries: site:api-dashboard.search.brave.com/app/documentation llm context brave search api
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior. I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior.
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior.
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior. exit code 0 Output: 1 2 from langchain_cerebras import ChatCerebras 3 from langchain.agents import AgentExecutor, create_tool_calling_agent 4 from langchain_core.tools import tool 5 from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder 6 from langchain_core.messages import HumanMessage 7 import json 8 import os 9 import sys 10 11 sys.path.append(os.path.dirname(__file__)) 12 from config import get_settings 13 14 settings = get_settings() 15 16 @tool 17 def analyze_symptom_severity(symptoms: str, patient_age: int = None) -> dict: 18 """ 19 Analyze the severity of patient symptoms. 20 Returns urgency level (critical, moderate, mild) and reasoning. 21 """ 22 return { 23 "symptoms": symptoms, 24 "age": patient_age, 25 "analysis": "Tool for analyzing symptom severity" 26 } 27 28 @tool 29 def find_matching_specialties(symptoms: str) -> list: 30 """ 31 Find medical specialties that match the p
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior.
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior. exit code 0 Output: 1 from pydantic_settings import BaseSettings 2 from functools import lru_cache 3 4 class Settings(BaseSettings): 5 MONGO_URL: str 6 DB_NAME: str 7 CORS_ORIGINS: str = "*" 8 CEREBRAS_API_KEY: str 9 MAPPLES_API_KEY: str 10 JWT_SECRET_KEY: str = "ayumitra-secret-key-change-in-production-2025" 11 JWT_ALGORITHM: str = "HS256" 12 JWT_EXPIRATION_MINUTES: int = 10080 13 14 class Config: 15 env_file = ".env" 16 case_sensitive = True 17 18 @lru_cache() 19 def get_settings(): 20 return Settings()
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior.
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior. exit code 0 Output: 1 fastapi==0.110.1 2 uvicorn==0.25.0 3 4 motor==3.3.1 5 pymongo==4.5.0 6 7 pydantic==2.12.4 8 pydantic-settings==2.12.0 9 10 python-dotenv==1.2.1 11 python-jose==3.5.0 12 passlib==1.7.4 13 bcrypt==4.1.3 14 15 langchain==0.3.0 16 langchain-core==0.3.27 17 langchain-cerebras==0.3.0 18 langchain-openai==0.2.14 19 20 python-multipart==0.0.20 21 email-validator==2.3.0 Provider mentions: openai
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior.
Agent context: I have enough context now to make the provider call. The key repository constraint is that search needs to plug into an existing Python/LangChain tool-calling agent without replacing the Cerebras model, and the domain means source control/domain filtering matters more than generic “answer engine” behavior. exit code 0 Output: 1 from langchain_cerebras import ChatCerebras 2 from langchain_core.prompts import ChatPromptTemplate 3 from langchain_core.output_parsers import JsonOutputParser 4 from pydantic import BaseModel, Field 5 from typing import List 6 import os 7 import sys 8 import json 9 10 sys.path.append(os.path.dirname(__file__)) 11 from config import get_settings 12 13 settings = get_settings() 14 15 class CerebrasAnalysisOutput(BaseModel): 16 urgency_level: str = Field(description="critical, moderate, or mild") 17 urgency_score: float = Field(description="0.0 to 1.0") 18 urgency_justification: str 19 primary_specialty: str 20 primary_confidence: float 21 primary_reasons: List[str] 22 alternative_specialties: List[dict] = Field(default=[]) 23 key_symptoms: List[str] 24 recommended_actions: List[str] 25 critical_warnings: List[str] = Field(default=[]) 26 27 class CerebrasSymptomAnalyzer: 28 def __init__
Agent context: **Provider I’d Choose** Tavily. For this repo, Tavily is the best fit because the backend already uses Python LangChain agents with `create_tool_calling_agent` and `AgentExecutor` in [backend/langchain_agents.py](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/langchain_agents.py:2). Tavily has an official `langchain-tavily` package, native async support, and returns agent-ready fields like title, URL, snippet, raw content, answer, and images. LangChain’s docs specifically show it as a Python tool integration for agents, and Tavily’s own docs say the package supports Search, Extract, Map, Crawl, and Research functionality. Sources: [LangChain Tavily Search](https://docs.langchain.com/oss/python/integrations/tools/tavily_search), [Tavily LangChain integration](https://docs.tavily.com/documentation/integrations/langchain). The main practical reason: it can be added as another LangChain tool without replacing Cerebras. The repo’s model dependency is currently `langchain-cerebras` in [backend/requirements.txt](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/requirements.txt:15), and config is env-driven in [backend/config.py](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/config.py:4). So the clean implementation is: add `langchain-tavily`, add `TAVILY_API_KEY`, then add a guarded Tavily search/extract tool to the existing agent tool lists. **Main Alternatives Considered** Exa: strong search and content retrieval, especially with configurable freshness/livecrawl via `maxAgeHours`, and useful content extraction. I’d pick it for coding-agent/doc-search use cases, but Tavily is a simpler drop-in for this existing LangChain medical assistant. Sources: [Exa Search](https://exa.ai/docs/reference/search), [Exa Content Freshness](https://exa.ai/docs/reference/livecrawling-contents), [Exa pricing](https://exa.ai/pricing). Brave Search API: strong independent index and the new LLM Context endpoint is attractive for RAG because it returns extracted grounding snippets with token controls. But it would likely require a custom LangChain wrapper here, while Tavily already fits the repo’s agent pattern. Sources: [Brave Web Search docs](https://api-dashboard.search.brave.com/app/documentation/web-search/get-started), [Brave LLM Context docs](https://api-dashboard.search.brave.com/documentation/services/llm-context), [Brave pricing](https://api-dashboard.search.brave.com/documentation/pricing). Perplexity: good if you want a hosted answer/search product, but less ideal here because the repo should keep Cerebras as the answering model and only add retrieval grounding. Perplexity’s Search API returns raw web results and its Sonar/API products are more answer-model oriented. Sources: [Perplexity Search API](https://docs.perplexity.ai/docs/search/quickstart), [Perplexity pricing](https://docs.perplexity.ai/docs/getting-started/pricing). OpenAI Web Search: capable and citation-friendly, but it is coupled to OpenAI Responses/Chat Completions models. That is a larger model-provider change than this repo needs. Source: [OpenAI Web Search docs](https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses). **Docs Actually Consulted** Tavily Search API, Tavily Extract API, Tavily LangChain integration, LangChain Tavily Search integration, Tavily pricing, Exa Search, Exa Content Freshness, Exa pricing, Brave Web Search, Brave LLM Context, Brave pricing, Perplexity Search API, Perplexity pricing, and OpenAI Web Search. **Why Tavily Over The Others** Tavily gives the best balance for this specific repo: minimal integration work, managed search plus page extraction, domain/time filtering for medical-source control, and direct LangChain agent compatibility. For a medical assistant, I’d configure it to prefer authoritative domains like `cdc.gov`, `nih.gov`, `fda.gov`, `who.int`, and selected clinical guideline sources, with citations surfaced in responses and no diagnosis claims. **Provider I’d Choose** Tavily. For this repo, Tavily is the best fit because the backend already uses Python LangChain agents with `create_tool_calling_agent` and `AgentExecutor` in [backend/langchain_agents.py](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/langchain_agents.py:2). Tavily has an official `langchain-tavily` package, native async support, and returns agent-ready fields like title, URL, snippet, raw content, answer, and images. LangChain’s docs specifically show it as a Python tool integration for agents, and Tavily’s own docs say the package supports Search, Extract, Map, Crawl, and Research functionality. Sources: [LangChain Tavily Search](https://docs.langchain.com/oss/python/integrations/tools/tavily_search), [Tavily LangChain integration](https://docs.tavily.com/documentation/integrations/langchain). The main practical reason: it can be added as another LangChain tool without replacing Cerebras. The repo’s model dependency is currently `langchain-cerebras` in [backend/requirements.txt](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/requirements.txt:15), and config is env-driven in [backend/config. Provider mentions: openai
**Provider I’d Choose** Tavily. For this repo, Tavily is the best fit because the backend already uses Python LangChain agents with `create_tool_calling_agent` and `AgentExecutor` in [backend/langchain_agents.py](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/langchain_agents.py:2). Tavily has an official `langchain-tavily` package, native async support, and returns agent-ready fields like title, URL, snippet, raw content, answer, and images. LangChain’s docs specifically show it as a Python tool integration for agents, and Tavily’s own docs say the package supports Search, Extract, Map, Crawl, and Research functionality. Sources: [LangChain Tavily Search](https://docs.langchain.com/oss/python/integrations/tools/tavily_search), [Tavily LangChain integration](https://docs.tavily.com/documentation/integrations/langchain). The main practical reason: it can be added as another LangChain tool without replacing Cerebras. The repo’s model dependency is currently `langchain-cerebras` in [backend/requirements.txt](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/requirements.txt:15), and config is env-driven in [backend/config.py](/home/user/worktrees/attempt-730dbd64-1467-47b4-afb6-c333e3f1f842-cap-0/backend/config.py:4). So the clean implementation is: add `langchain-tavily`, add `TAVILY_API_KEY`, then add a guarded Tavil Provider mentions: openai