This is an advanced HR Assistant built on the A2A (Agent-to-Agent) compatible agent template. X-it serves two primary functions: conducting conversational exit interviews to generate detailed PDF summaries, and acting as an HR Data Analyst to generate aggregate attrition reports and charts. It implements the A2A JSON-RPC 2.0 protocol using FastAPI, giving you complete control over your stack.
-
Server: FastAPI
-
Agent Logic: LangChain (Pre-configured)
-
Data & Reporting: Pandas, Matplotlib, FPDF2
-
src/main.py: Protocol Implementation. A FastAPI server that handles the A2A JSON-RPC message/send requests. -
src/models.py: Data Models. A2A protocol Pydantic models (Message, Task, etc.). -
src/tools.py: Tools Definition. Contains the dual-tool logic (exit_interview_summary and generate_aggregate_attrition_report) for generating the dynamic HR PDFs. -
src/agent.py: Core Logic. Configures the LangChain agent and tools, featuring the customized "Dual-Brain" routing system prompt. -
src/attrition_data.csv: Dataset. The database tracking employee tenure, departments, reasons for leaving, and suggestions. -
AgentCard.json: Agent metadata (auto-generated). -
Dockerfile: Standard Python Dockerfile.
-
Prepare your Data: Ensure attrition_data.csv contains your up-to-date employee records.
-
Customize (Optional): Edit src/tools.py or src/agent.py if you need to adjust PDF formatting or the LangChain agent's behavior.
-
Build and Run:
docker build -t x-it-agent . docker run -p 5000:5000 -e OPENAI_API_KEY=your_key x-it-agent
This template implements:
POST /: JSON-RPC 2.0 endpoint.- Method:
message/send - Params: A2A Message format
- Method: