Building a Church Communication Agent: Service Times, Events, and Prayer Requests
Learn how to build an AI agent that manages church service schedules, promotes events, handles prayer request submissions, and routes pastoral care needs appropriately.
Why Churches Need Intelligent Communication
Churches serve as community hubs where people seek information about service times, register for events, submit prayer requests, and connect with pastoral staff. Church offices typically operate with limited staff and volunteers, yet the congregation expects timely, compassionate responses. An AI communication agent can handle routine inquiries instantly while ensuring sensitive matters like prayer requests and pastoral needs reach the right person.
The key design constraint is sensitivity. A church communication agent must balance efficiency with warmth, and it must recognize when a conversation requires human pastoral care rather than automated responses.
Defining Church Data Structures
Model the core entities: services, events, and prayer requests.
from dataclasses import dataclass, field
from datetime import datetime, date, time
from typing import Optional
from enum import Enum
from uuid import uuid4
class ServiceType(Enum):
SUNDAY_WORSHIP = "sunday_worship"
WEDNESDAY_BIBLE_STUDY = "wednesday_bible_study"
YOUTH_SERVICE = "youth_service"
SPECIAL_EVENT = "special_event"
class PrayerRequestPriority(Enum):
GENERAL = "general"
URGENT = "urgent"
PASTORAL_CARE = "pastoral_care"
CRISIS = "crisis"
@dataclass
class ServiceSchedule:
service_id: str = field(default_factory=lambda: str(uuid4()))
service_type: ServiceType = ServiceType.SUNDAY_WORSHIP
day_of_week: str = "Sunday"
start_time: time = field(default_factory=lambda: time(10, 0))
end_time: time = field(default_factory=lambda: time(11, 30))
location: str = "Main Sanctuary"
pastor: str = ""
description: str = ""
has_childcare: bool = True
livestream_url: Optional[str] = None
@dataclass
class PrayerRequest:
request_id: str = field(default_factory=lambda: str(uuid4()))
requester_name: str = ""
requester_email: Optional[str] = None
requester_phone: Optional[str] = None
request_text: str = ""
priority: PrayerRequestPriority = PrayerRequestPriority.GENERAL
is_confidential: bool = False
submitted_at: datetime = field(default_factory=datetime.utcnow)
assigned_to: Optional[str] = None
follow_up_date: Optional[date] = None
Service Schedule Tool
The agent answers questions about service times, locations, and available programs.
See AI Voice Agents Handle Real Calls
Book a free demo or calculate how much you can save with AI voice automation.
from agents import function_tool
service_schedules = [
ServiceSchedule(
service_type=ServiceType.SUNDAY_WORSHIP,
day_of_week="Sunday",
start_time=time(9, 0),
end_time=time(10, 15),
location="Main Sanctuary",
pastor="Pastor James",
description="Traditional worship service with hymns",
has_childcare=True,
livestream_url="https://live.gracechurch.org",
),
ServiceSchedule(
service_type=ServiceType.SUNDAY_WORSHIP,
day_of_week="Sunday",
start_time=time(11, 0),
end_time=time(12, 15),
location="Main Sanctuary",
pastor="Pastor James",
description="Contemporary worship service",
has_childcare=True,
livestream_url="https://live.gracechurch.org",
),
ServiceSchedule(
service_type=ServiceType.WEDNESDAY_BIBLE_STUDY,
day_of_week="Wednesday",
start_time=time(19, 0),
end_time=time(20, 30),
location="Fellowship Hall",
pastor="Pastor Sarah",
description="Midweek Bible study and prayer",
has_childcare=False,
),
]
@function_tool
async def get_service_times(
service_type: str = "all",
) -> dict:
"""Get church service times and details."""
results = []
for svc in service_schedules:
if service_type != "all" and svc.service_type.value != service_type:
continue
results.append({
"type": svc.service_type.value,
"day": svc.day_of_week,
"time": f"{svc.start_time.strftime('%I:%M %p')} - "
f"{svc.end_time.strftime('%I:%M %p')}",
"location": svc.location,
"pastor": svc.pastor,
"description": svc.description,
"childcare": svc.has_childcare,
"livestream": svc.livestream_url,
})
return {"services": results}
Prayer Request Handling
Prayer requests require special care. The agent classifies urgency and routes accordingly.
prayer_requests_db: list[PrayerRequest] = []
CRISIS_KEYWORDS = [
"suicide", "self-harm", "abuse", "emergency",
"dying", "hospice", "immediate danger",
]
@function_tool
async def submit_prayer_request(
requester_name: str,
request_text: str,
requester_email: str = "",
requester_phone: str = "",
is_confidential: bool = False,
) -> dict:
"""Submit a prayer request with automatic priority classification."""
# Detect crisis language for immediate escalation
text_lower = request_text.lower()
priority = PrayerRequestPriority.GENERAL
if any(kw in text_lower for kw in CRISIS_KEYWORDS):
priority = PrayerRequestPriority.CRISIS
elif any(kw in text_lower for kw in ["hospital", "surgery", "accident"]):
priority = PrayerRequestPriority.URGENT
elif any(kw in text_lower for kw in ["counseling", "marriage", "grief"]):
priority = PrayerRequestPriority.PASTORAL_CARE
request = PrayerRequest(
requester_name=requester_name,
request_text=request_text,
requester_email=requester_email or None,
requester_phone=requester_phone or None,
priority=priority,
is_confidential=is_confidential,
)
# Route based on priority
if priority == PrayerRequestPriority.CRISIS:
request.assigned_to = "Pastor James (Senior Pastor)"
elif priority == PrayerRequestPriority.PASTORAL_CARE:
request.assigned_to = "Pastor Sarah (Care Pastor)"
else:
request.assigned_to = "Prayer Team"
prayer_requests_db.append(request)
response = {
"status": "submitted",
"request_id": request.request_id,
"priority": priority.value,
"assigned_to": request.assigned_to,
}
if priority == PrayerRequestPriority.CRISIS:
response["urgent_note"] = (
"This request has been flagged as urgent. "
"A pastor will reach out within the hour. "
"If you are in immediate danger, please call 911."
)
return response
Assembling the Church Communication Agent
from agents import Agent, Runner
church_agent = Agent(
name="Grace Church Communication Agent",
instructions="""You are the communication agent for Grace
Community Church. Your tone should be warm, welcoming, and
compassionate. Your responsibilities:
1. Answer questions about service times, locations, and programs
2. Help people register for church events
3. Receive prayer requests with sensitivity and care
4. Recognize crisis language and escalate immediately
5. For confidential requests, confirm they will only be
shared with the assigned pastor
6. Always provide the church crisis line (555-PRAY) for
urgent needs outside office hours
7. If someone expresses suicidal thoughts, provide the
988 Suicide & Crisis Lifeline number immediately
8. Never attempt to provide counseling — route to pastors""",
tools=[
get_service_times,
submit_prayer_request,
],
)
result = Runner.run_sync(
church_agent,
"Hi, I am new to the area and looking for a church. "
"What are your Sunday service times? Do you have childcare?",
)
print(result.final_output)
FAQ
How does the agent handle confidential prayer requests?
When a requester marks a prayer request as confidential, the agent stores it with the is_confidential flag set to True. The request is routed only to the assigned pastor, not to the general prayer team. The agent confirms to the requester that their request will be kept private and shared only with their assigned pastoral contact.
What happens when crisis language is detected?
The agent immediately flags the request as crisis priority and assigns it directly to the senior pastor. The response includes the 988 Suicide and Crisis Lifeline number and a note that a pastor will reach out within the hour. The agent does not attempt to provide counseling or advice — it focuses on immediate resource connection and human handoff.
Can the agent handle event registration for church programs?
Yes. Add an events database and a register_for_event tool that checks capacity, collects participant details, and sends confirmation. Common church events include vacation Bible school, small groups, retreats, and community dinners. The tool should track waitlists when events reach capacity.
#ChurchTechnology #CommunityAI #EventManagement #AgenticAI #Python #LearnAI #AIEngineering
CallSphere Team
Expert insights on AI voice agents and customer communication automation.
Try CallSphere AI Voice Agents
See how AI voice agents work for your industry. Live demo available -- no signup required.