An AI-powered Bible study assistant built with LangChain and LangGraph, offering multiple interface options including direct API, WhatsApp, and more.
- 🤖 Intelligent Bible study assistance using LangChain and LangGraph
- 📱 Multiple interface options:
- RESTful API for direct integration
- WhatsApp integration via Twilio
- 🔍 Advanced Bible study capabilities:
- Verse lookup and search
- Cross-reference analysis
- Contextual understanding
- Topic-based study
- 🛠️ Modular architecture with clean separation of concerns
- 📝 Comprehensive logging and error handling
- 📚 Swagger UI documentation
- Clone the repository:
git clone https://github.com/yourusername/bible_study_agent.git
cd bible_study_agent- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtCreate a .env file in the project root with the following variables:
# Server Configuration
API_HOST=0.0.0.0
API_PORT=8000
# WhatsApp Integration (Optional)
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM_NUMBER=your_whatsapp_numberRun the unified server:
python -m bible_study_agentThis will start the server with all configured integrations.
- Endpoint:
/api/study - Method: POST
- Request Body:
{ "message": "What does the Bible say about love?", "user_id": "optional_user_id", "context": {} } - Response:
{ "response": "The Bible's teaching on love...", "context": {} }
- Endpoint:
/whatsapp/webhook - Method: POST
- Handles incoming WhatsApp messages via Twilio
Access the Swagger UI documentation at http://localhost:8000/docs when the server is running.
src/bible_study_agent/
├── __init__.py
├── __main__.py
├── server.py # Unified server implementation
├── agents/
│ ├── __init__.py
│ └── study_agent.py # Core Bible study agent
├── tools/
│ ├── __init__.py
│ └── bible_tools.py # Bible-specific tools
├── api/
│ ├── __init__.py
│ └── api.py # Direct API implementation
└── integrations/
├── __init__.py
└── whatsapp_bot.py # WhatsApp integration
The Bible Study Agent uses a modular architecture:
- Core Agent: Built with LangChain and LangGraph for intelligent Bible study assistance
- Tools: Specialized tools for Bible verse lookup, search, and analysis
- Unified Server: Single server handling multiple interfaces
- Integrations: Platform-specific integrations (WhatsApp, etc.)
- Create a new tool class in
tools/bible_tools.py - Inherit from
BaseTool - Implement the required methods
Example:
from langchain.tools import BaseTool
class NewBibleTool(BaseTool):
name = "tool_name"
description = "Tool description"
def _run(self, input_str: str) -> str:
# Implementation
pass- Create a new integration class in
integrations/ - Implement the required interface methods
- Add configuration to the unified server
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
[Your chosen license]
[Your contact information]