Innovation Hackathon Week4 Langchain
No description available
Ask AI about Innovation Hackathon Week4 Langchain
Powered by Claude Β· Grounded in docs
I know everything about Innovation Hackathon Week4 Langchain. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Presidio Research Agent with A2A Protocol
This project implements an Internal Research Agent for Presidio Insurance that uses LangChain, Google Docs MCP integration, and Google's A2A (Agent-to-Agent) protocol to deliver accurate, contextual, and actionable responses to employee queries.
Features
- Google Docs Integration: Search and analyze documents stored in Google Drive
- RAG System: Search and retrieve answers from HR Policy documents
- Web Search: Fetch industry benchmarks, trends, and regulatory updates
- A2A Protocol: Agent-to-agent communication for complex tasks
- Advanced Document Analysis: Document summarization, table extraction, and trend analysis
Architecture
The system follows a modular architecture:
User β React Frontend β FastAPI Backend β LangChain Agent β Tools (MCP, RAG, Web Search)
Components
- Frontend: React-based UI for user interaction
- Backend: FastAPI server that handles requests and manages services
- Agent Service: LangChain-based agent that orchestrates tools
- MCP Server: Custom MCP server for Google Docs integration
- A2A Service: Implementation of Google's A2A protocol
Setup
Prerequisites
- Python 3.8+
- Node.js 14+
- Google Cloud Platform account with API access
- SerpAPI key for web search
Environment Variables
Create a .env file with the following variables:
# Google API
GOOGLE_APPLICATION_CREDENTIALS=credentials.json
# SerpAPI
SERPAPI_API_KEY=your_serpapi_key
# AWS (for Bedrock)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
# Vector Database
PINECONE_API_KEY=your_pinecone_key
PINECONE_INDEX_NAME=presidio-research
Installation
-
Install Python dependencies:
pip install -r requirements.txt -
Install frontend dependencies:
cd src/frontend npm install -
Set up Google OAuth:
python run_mcp_local.py -
Start the application:
./run.sh
Usage
Example Queries
The agent can handle various types of queries:
-
Document Research:
- "Summarize all customer feedback related to our Q1 marketing campaigns."
- "Extract key insights from our customer satisfaction surveys."
-
Policy Compliance:
- "Find relevant compliance policies related to AI data handling."
- "What are our guidelines for remote work?"
-
Market Intelligence:
- "Compare our current hiring trend with industry benchmarks."
- "What are the latest regulatory updates in insurance?"
A2A Protocol
The system uses Google's A2A protocol for agent-to-agent communication. This allows specialized agents to collaborate on complex tasks:
- Document Research Agent: Specializes in searching and analyzing Google Docs
- Policy Compliance Agent: Focuses on HR policies and compliance requirements
- Market Intelligence Agent: Gathers industry benchmarks, trends, and regulatory updates
API Endpoints
Chat API
POST /api/chat: Process a chat message using the LangChain agent
A2A Protocol API
POST /api/a2a/send_message: Send a message from one agent to anotherGET /api/a2a/conversation/{conversation_id}: Get the history of an A2A conversationPOST /api/a2a/process_query: Process a user query using the A2A protocol
Document API
GET /api/documents: List all documentsPOST /api/documents/upload: Upload and process a documentGET /api/documents/{document_id}: Get document by IDDELETE /api/documents/{document_id}: Delete a documentPOST /api/documents/search: Search for documents based on query
Tool API
POST /api/tools/execute: Execute a specific agent tool directly
MCP Server Endpoints
/search_google_docs: Search Google Docs for information/extract_document_content: Extract the full content of a Google Doc/analyze_document_trends: Analyze trends in time-series data within Google Sheets/compare_document_trends: Compare trends across multiple Google Sheets/summarize_document: Generate a summary of a Google Doc/extract_document_tables: Extract tables from a Google Doc
Development
Adding New Tools
To add a new tool:
- Implement the tool function in the appropriate service
- Add the tool to the
_get_toolsmethod inagent_service.py - Update the system message to include the new tool
Adding New Agents
To add a new specialized agent:
- Create a message handler function in
agent_service.py - Register the agent in the
_initialize_specialized_agentsmethod - Add an endpoint in the MCP server to handle requests for this agent

