An AI-powered chatbot that provides information about Australian Prudential Regulation Authority (APRA) standards and guidelines. Built using RAG (Retrieval-Augmented Generation) technology with Chainlit, LangChain, Pinecone, and OpenAI.
This chatbot uses publicly available APRA documentation to answer questions about:
- APRA Connect Guide (May 2025)
- Prudential Standard CPS 230 (Operational Risk Management)
- Prudential Practice Guide CPG 230 (Operational Risk Management)
- Other APRA regulatory guidance
Note: This chatbot uses only public APRA documents and is intended for informational purposes.
- 🤖 Conversational AI Interface - Beautiful Chainlit UI for natural conversations
- 📚 Vector Database Search - Pinecone-powered document retrieval
- 🔍 Source Citations - Shows exact document sources for each answer
- 💬 Memory-Enabled Chat - Maintains conversation context
- 🏛️ APRA-Specific Knowledge - Focused on Australian prudential regulation
- 📊 Quality Evaluation - Integrated RAGAS and LLM-as-Judge evaluation metrics
- 📈 Observability - Langfuse integration for conversation monitoring and analytics
Deployed on Railway: [Your App URL]
- Frontend: Chainlit (Python-based chat interface)
- Backend: LangChain (LLM orchestration)
- Vector Database: Pinecone (document embeddings storage)
- LLM: OpenAI GPT-3.5-turbo
- PDF Processing: PyMuPDF
- Deployment: Railway (Docker container)
- Python 3.11+
- OpenAI API key
- Pinecone API key
- Docker (for deployment)
-
Clone the repository:
git clone https://github.com/xichaow/knowledgebase_chatbot.git cd knowledgebase_chatbot -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env
Edit
.envand add your API keys:OPENAI_API_KEY=your_openai_api_key_here PINECONE_API_KEY=your_pinecone_api_key_here LANGFUSE_PUBLIC_KEY=your_langfuse_public_key_here LANGFUSE_SECRET_KEY=your_langfuse_secret_key_here -
Process PDFs and build vector store:
python vector_store.py
This will process the APRA PDFs in the
pdf/directory and create embeddings in Pinecone. -
Run the chatbot:
chainlit run app.py
-
Open your browser to
http://localhost:8000
This app is configured for easy deployment on Railway:
- Fork this repository
- Sign up at Railway
- Create new project → Deploy from GitHub repo
- Add environment variables in Railway dashboard:
OPENAI_API_KEYPINECONE_API_KEYLANGFUSE_PUBLIC_KEY(optional, for evaluation)LANGFUSE_SECRET_KEY(optional, for evaluation)
- Deploy automatically - Railway will build and deploy using the Dockerfile
Cost: ~$5/month on Railway
- Google Cloud Run: Use the included Dockerfile
- AWS ECS/Fargate: Container-ready deployment
- DigitalOcean App Platform: Simple container deployment
- Render: Alternative to Railway
knowledgebase_chatbot/
├── app.py # Main Chainlit application
├── vector_store.py # PDF processing and Pinecone setup
├── requirements.txt # Python dependencies
├── Dockerfile # Container configuration
├── .env.example # Environment variables template
├── .gitignore # Security exclusions
├── pdf/ # APRA PDF documents
│ ├── APRA Connect Guide May 2025_0.pdf
│ ├── Prudential Practice Guide CPG 230.pdf
│ └── Prudential Standard CPS 230.pdf
└── README.md # This file
- Environment Variables: API keys stored securely, not in code
- Public Documents Only: Uses only publicly available APRA documents
- No Sensitive Data: PDF directory excluded from git repository
- Secure Deployment: Environment variables injected at runtime
Ask the chatbot questions like:
- "What is CPS 230?"
- "How do I access APRA Connect?"
- "What are the operational risk management requirements?"
- "Explain prudential standards for operational risk"
- "How do I create returns in APRA Connect?"
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally
- Submit a pull request
This project is open source. The APRA documents used are publicly available from the APRA website.
This chatbot provides information based on publicly available APRA documents. It is not official APRA guidance and should not be used as a substitute for professional advice or official APRA communications. Always refer to the official APRA website for the most current information.
Built with ❤️ for the Australian financial services community