Date: December 26, 2025
All hardcoded configuration values have been moved from palefire-cli.py to a centralized config.py module. Configuration is now managed through environment variables with sensible defaults.
-
config.py- Centralized configuration module- Loads settings from environment variables
- Provides defaults for all values
- Validates configuration on import
- Helper functions for accessing config
-
env.example- Configuration template- Copy to
.envand customize - Documents all available settings
- Includes descriptions and defaults
- Copy to
-
CONFIGURATION.md- Complete configuration guide- All environment variables documented
- Setup instructions
- Best practices
- Troubleshooting
-
CHANGELOG_CONFIG.md- Detailed migration log- All changes documented
- Migration guide
- Testing results
# 1. Copy example configuration
cp env.example .env
# 2. Edit with your settings
nano .env
# 3. Verify configuration
python palefire-cli.py config
# 4. Test
python palefire-cli.py query "Test question?"NEO4J_URI- Neo4j connection URINEO4J_USER- Neo4j usernameNEO4J_PASSWORD- Neo4j passwordOPENAI_API_KEY- API key (can be placeholder for Ollama)
LLM_PROVIDER=ollama- LLM providerOLLAMA_BASE_URL=http://10.147.18.253:11434/v1- Ollama endpointOLLAMA_MODEL=deepseek-r1:7b- LLM modelDEFAULT_SEARCH_METHOD=question-aware- Search methodSEARCH_RESULT_LIMIT=20- Results before rerankingSEARCH_TOP_K=5- Final results to returnWEIGHT_CONNECTION=0.15- Connection weightWEIGHT_TEMPORAL=0.20- Temporal weightWEIGHT_QUERY_MATCH=0.20- Query match weightWEIGHT_ENTITY_TYPE=0.15- Entity type weight
python palefire-cli.py configOutput:
================================================================================
⚙️ PALE FIRE CONFIGURATION
================================================================================
Neo4j URI: bolt://10.147.18.253:7687
Neo4j User: neo4j
LLM Provider: ollama
LLM Model: deepseek-r1:7b
LLM Base URL: http://10.147.18.253:11434/v1
Embedder Provider: ollama
Embedder Model: nomic-embed-text
Embedder Dimensions: 768
Search Configuration:
Default Method: question-aware
Result Limit: 20
Top K: 5
Ranking Weights:
Connection: 0.15
Temporal: 0.2
Query Match: 0.2
Entity Type: 0.15
Semantic: 0.30
NER Configuration:
Enabled: True
Use spaCy: True
spaCy Model: en_core_web_sm
================================================================================
✅ Maintainability - All config in one place
✅ Flexibility - Environment-specific settings
✅ Validation - Automatic validation on startup
✅ Documentation - Self-documenting with examples
✅ Best Practices - Follows 12-factor app methodology
✅ No Breaking Changes - All defaults match previous hardcoded values
✅ CLI Unchanged - All commands work exactly the same
✅ Function Signatures - Backward compatible with optional parameters
All tests passed:
- ✅ Configuration loads correctly
- ✅ Files compile without errors
- ✅ CLI commands work
- ✅ Config display shows correct values
- CONFIGURATION.md - Complete configuration guide
- CHANGELOG_CONFIG.md - Detailed migration log
- README.md - Updated with config examples
- PALEFIRE_SETUP.md - Updated setup instructions
- Copy
env.exampleto.env - Customize settings for your environment
- Run
python palefire-cli.py configto verify - Continue using Pale Fire as before!
For configuration issues:
- Check CONFIGURATION.md
- Verify
.envfile exists - Run
python palefire-cli.py config - Check logs for validation errors
Configuration System v1.0 - Ready to use! 🚀