Your AI-powered assistant for clinic scheduling & patient communication
SmartClinicAgent is an Agentic AI system designed to help clinics manage appointments, update schedules, and handle cancellations seamlessly. Integrated with Google Calendar and email services, it ensures patients and doctors stay in sync effortlessly.
- 📅 Smart Scheduling – Book, update, and cancel doctor appointments with ease.
- 🔄 Google Calendar Integration – Real-time sync with doctor's availability.
- 📧 Email Notifications – Automated reminders and confirmations.
- 🩺 Doctor Information Lookup – Retrieve schedules and details without patient data exposure.
- 🤖 Agentic AI Orchestration – Uses multiple tools for intelligent workflow automation.
- With Gemini 2.5 Pro, average response time (p50) was 4–5s, which is too slow for real-time applications.
- Switching to Gemini 2.5 Flash reduced latency to 2–4s (p50, p95 <10s).
| Model | p50 Latency | p95 Latency | Notes |
|---|---|---|---|
| Gemini 2.5 Pro | 4–5s | >15s | Too slow for real-time usage |
| Gemini 2.5 Flash | 2–3s | <10s | Optimized without quality loss |
- Transitioning to Gemini Flash delivered significant latency improvement with no major quality degradation.
- Challenge: Memory operations
(mem0.add())take 1-12 seconds, blocking user responses and creating poor user experience. - Solution: Background Tasks: Using
asyncio.create_task()makes the coroutine run simultaneously without waiting for it to finish. - Pros & Cons
- Pros: Fast user response, better UX,
- Cons: Memory is not immediately available,
- Python 3.12+
- LangChain / LangGraph – AI orchestration
- Google Calendar API – Scheduling integration
- Gmail SMTP – Email automation
- uv - Python package installer and resolver
- Python 3.10 or higher.
uvfor virtual environment management (Learn more).
git clone https://github.com/fahmiaziz98/SmartClinicAgent.git
cd SmartClinicAgent# create venv
uv venv
# activate venv
source .venv/bin/activate
# install dependencies
uv syncTo copy the .env.example file to .env, you can use the following command in your terminal:
cp .env.example .envThis will create a .env file with the same content as .env.example. You can then edit the .env file to add your actual environment variables.
# api key
GOOGLE_API_KEY=""
# gmail service
ACCOUNT_GMAIL=""
PASSWORD_GMAIL=""
# calendar service
SERVICE_ACCOUNT_FILE="path-service-acount.json"
CALENDAR_ID="you-id-calendar"
# tracing llm
LANGSMITH_TRACING_V2="true"
LANGSMITH_PROJECT="name-project"
LANGSMITH_API_KEY="langsmith-api-key"make run
# or
langgraph dev --allow-blocking
# Sample Output
> Ready!
>
> - API: [http://localhost:2024](http://localhost:2024/)
>
> - Docs: http://localhost:2024/docs
>
> - LangGraph Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024Note:
You can try the app at https://agentchat.vercel.app/
- Copy and paste your deployment URL (e.g.,
http://localhost:2024) - Add your Agent ID
- (Optional) Provide your LangSmith API Key
- create base
agent-tools - Integration
google-calendar - Add
memory presistance - Sending
email with SMTP(create-update-deleted) - Add
rag tools - Add
human-interupt (approve/reject) - Add Long-Term Memory with
mem0/memU - Implement Chat-UI
- Deploy on Docker
- Deploy on Cloud
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
- LangChain Gemini
- CalendarToolkit
- Sending GMAIL using SMTP
- Integration with Google Calendar
- Langgraph Run a local server
- Deploy on Cloud
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Email: fahmiazizfadhil999@gmail.com
Made with ❤️ by fahmiaziz98

