This is the FastAPI backend for the Agentic AI Platform. It provides:
- REST API endpoints for LLM (Gemini) and MCP tools
- Configurable, session-based PII masking/restoration
- Dynamic, config-driven pipeline orchestration
-
Install dependencies:
cd backend uv venv uv pip install -r requirements.txt -
Copy and configure environment variables:
cp .env-sample .env # Edit .env with your Gemini API key and config -
Run the server:
uvicorn main:app --reload
GEMINI_API_KEY– Your Google Gemini API key (required)GEMINI_API_URL– (Optional) Override Gemini API endpointGEMINI_MODEL– (Optional) Model name (default:gemini-2.0-flash)MCP_CONFIG_PATH– (Optional) Path to MCP config JSON (default:templates/mcp_config.json)
- Gemini:
- API key and model are loaded from
.env. - Endpoint:
/llm/gemini(POST) - Request:
{ "prompt": "...", "model": "..." } - Response:
{ "response": "..." }
- API key and model are loaded from
- MCP Pipeline:
- Config-driven via
mcp_config.json(seetemplates/) - Supports dynamic tool orchestration, pre/post-processing, and session-based PII handling
- Endpoint:
/mcp/pipeline(POST) - Tools listed at
/mcp/tools
- Config-driven via
GET /– Root health checkPOST /llm/gemini– Gemini LLM prompt/responseGET /mcp/health– MCP server healthGET /mcp/tools– List available MCP toolsPOST /mcp/pipeline– Run pipeline with config-driven tools
- In-memory masking/restoration for SSNs, emails, phones, names, addresses, credit cards
- Session-based: Use the same
session_idfor pre- and post-processing - Only last 4 digits of credit cards are shown
- See
main.pyfor API logic - See
templates/mcp_config.jsonfor pipeline config structure - Extend MCP tools in
mcp_tools/(if present)