Spaces:
Runtime error
Quick Start: Fraud Assistant with Confluence Integration
Follow these steps to add Confluence search to your fraud explainability assistant in under 10 minutes.
TL;DR (For the Impatient)
# 1. Install dependencies
pip install -r requirements-with-confluence.txt
# 2. Create .env file with your Confluence credentials
cp .env.example .env
nano .env # Add your Confluence URL, email, and API token
# 3. Test it
python confluence_integration_example.py
Then ask: "What does our fair lending policy say about synthetic ID detection?"
Step-by-Step Setup
Step 1: Get Confluence API Token (2 minutes)
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Label it: "Fraud Assistant"
- Copy the token (you won't see it again!)
Step 2: Configure Environment (1 minute)
cd fraud_model_explainability_assistant
# Copy example file
cp .env.example .env
# Edit with your credentials
nano .env # or use your preferred editor
Edit these 3 lines in .env:
CONFLUENCE_URL=https://yourcompany.atlassian.net # YOUR Confluence URL
CONFLUENCE_EMAIL=your.email@company.com # YOUR email
CONFLUENCE_API_TOKEN=ATATT3xFfGF0... # YOUR token (paste here)
Save and close.
Step 3: Install Dependencies (2 minutes)
# Install everything needed
pip install -r requirements-with-confluence.txt
# Verify installation
python -c "from confluence_ingestor import ConfluenceRAG; print('β
Ready!')"
Step 4: Identify Confluence Spaces (1 minute)
Find the "space keys" for your Confluence spaces:
- Open your Confluence
- Go to a space
- Look at the URL:
https://yourcompany.atlassian.net/wiki/spaces/SPACEKEY/ - The
SPACEKEYis what you need
Recommended spaces:
- Model governance docs (e.g.,
fraud-model-governance) - Compliance policies (e.g.,
compliance-policies) - Investigation playbooks (e.g.,
fraud-investigation)
Step 5: Update Space Keys in Code (1 minute)
Edit confluence_integration_example.py line 88:
spaces = {
"your-governance-space": 100, # Replace with YOUR space key
"your-compliance-space": 50, # Replace with YOUR space key
"your-playbooks-space": 75, # Replace with YOUR space key
}
Step 6: Run Initial Ingestion (5 minutes)
This downloads and indexes your Confluence content (one-time):
python confluence_integration_example.py
What happens:
- Connects to Confluence β
- Downloads pages from your spaces (~5 min)
- Creates searchable vector database
- Launches web UI
First time only: Downloads ~400MB ML model (free, runs locally)
Step 7: Test It! (1 minute)
- Open http://localhost:7860 in your browser
- Try these questions:
Question 1 (tests Confluence search):
What does our fair lending policy say about phone type features?
Question 2 (tests fraud analysis):
Why was application APP-78432 flagged as high risk?
Question 3 (tests compliance with policy citation):
Check fair lending compliance for APP-55555 and cite relevant policies
If the agent cites specific Confluence pages in its response, it's working! π
What You Just Built
Your fraud assistant now has access to:
- β Company fair lending policies
- β Model governance documentation
- β Investigation procedures
- β Compliance guidelines
- β Historical precedents
Use cases unlocked:
- Executive briefings with policy citations
- Regulatory examination support
- Analyst training and investigation support
- Audit trail documentation
Troubleshooting
"3 validation errors for ConfluenceConfig"
Problem: Missing Confluence credentials
Fix:
# Check if .env exists
ls -la .env
# If missing:
cp .env.example .env
# Edit with your credentials
nano .env
# Verify:
cat .env | grep CONFLUENCE
"401 Unauthorized"
Problem: Wrong email or API token
Fix:
- Re-generate API token at https://id.atlassian.com/manage-profile/security/api-tokens
- Double-check email is correct
- Remove any extra spaces in
.env
"Space 'xyz' not found"
Problem: Space key doesn't exist or you don't have access
Fix:
- Check the space key in Confluence URL
- Verify you can view the space when logged in
- Update space keys in
confluence_integration_example.pyline 88
"Module not found: confluence_ingestor"
Problem: Package not installed
Fix:
pip install -r requirements-with-confluence.txt
Next Steps
Once it's working:
- Add more spaces: Edit the
spacesdict in the code - Customize prompts: Update
ENHANCED_PROMPTfor your use case - Set up auto-updates: See
CONFLUENCE_INTEGRATION_ANALYSIS.md - Share with team: Deploy on internal server
- Monitor usage: Track which policies are searched most
Full Documentation
- Detailed Setup: See
CONFLUENCE_SETUP_GUIDE.md - Architecture & ROI: See
CONFLUENCE_INTEGRATION_ANALYSIS.md - Confluence-Ingestor Docs: See
../confluence-ingestor/README.md
Summary Checklist
- Get Confluence API token (2 min)
- Create
.envwith credentials (1 min) - Install dependencies (2 min)
- Find your Confluence space keys (1 min)
- Update space keys in code (1 min)
- Run initial ingestion (5 min)
- Test with sample questions (1 min)
Total Time: ~10 minutes
Support
Having issues? Check:
CONFLUENCE_SETUP_GUIDE.md- Detailed troubleshootingCONFLUENCE_INTEGRATION_ANALYSIS.md- Architecture details- The "Troubleshooting" section above
Still stuck? Review the error message - it usually tells you what's missing!
You're done! Your fraud assistant can now search company documentation and cite specific policies. π