|
| 1 | +# IPM Installation Guide |
| 2 | + |
| 3 | +## Installing via InterSystems Package Manager (IPM/ZPM) |
| 4 | + |
| 5 | +This guide covers installing the RAG Templates package using InterSystems Package Manager (IPM) directly in your IRIS instance. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- InterSystems IRIS 2025.1 or later |
| 10 | +- IPM/ZPM installed in your IRIS instance |
| 11 | +- Internet access for downloading dependencies |
| 12 | +- Python 3.11+ available on the system |
| 13 | + |
| 14 | +## Installation Methods |
| 15 | + |
| 16 | +### Method 1: From Package Manager Registry |
| 17 | + |
| 18 | +```objectscript |
| 19 | +// Install from IPM registry |
| 20 | +zpm "install intersystems-iris-rag" |
| 21 | +``` |
| 22 | + |
| 23 | +### Method 2: From GitHub Repository |
| 24 | + |
| 25 | +```objectscript |
| 26 | +// Install directly from GitHub |
| 27 | +zpm "install https://github.com/intersystems-community/iris-rag-templates" |
| 28 | +``` |
| 29 | + |
| 30 | +### Method 3: From Local Module |
| 31 | + |
| 32 | +1. Clone the repository: |
| 33 | +```bash |
| 34 | +git clone https://github.com/intersystems-community/iris-rag-templates.git |
| 35 | +cd iris-rag-templates |
| 36 | +``` |
| 37 | + |
| 38 | +2. Install via IPM: |
| 39 | +```objectscript |
| 40 | +// In IRIS Terminal |
| 41 | +zpm "load /path/to/iris-rag-templates/" |
| 42 | +``` |
| 43 | + |
| 44 | +## Installation Parameters |
| 45 | + |
| 46 | +The package supports several configuration parameters: |
| 47 | + |
| 48 | +| Parameter | Description | Default | Options | |
| 49 | +|-----------|-------------|---------|---------| |
| 50 | +| `PYTHON_PATH` | Path to Python executable | `python3` | Any valid Python path | |
| 51 | +| `INSTALL_PYTHON_PACKAGE` | Install Python dependencies | `1` | `0` (skip), `1` (install) | |
| 52 | +| `ENABLE_VECTOR_SEARCH` | Enable IRIS Vector Search | `1` | `0` (disable), `1` (enable) | |
| 53 | +| `NAMESPACE` | Target installation namespace | `USER` | Any valid namespace | |
| 54 | + |
| 55 | +### Custom Installation with Parameters |
| 56 | + |
| 57 | +```objectscript |
| 58 | +// Install with custom parameters |
| 59 | +zpm "install intersystems-iris-rag -DParameters=""PYTHON_PATH=/usr/local/bin/python3,NAMESPACE=MYRAG""" |
| 60 | +``` |
| 61 | + |
| 62 | +## Post-Installation Configuration |
| 63 | + |
| 64 | +### 1. Verify Installation |
| 65 | + |
| 66 | +```objectscript |
| 67 | +// Check installation status |
| 68 | +Do ##class(RAG.IPMInstaller).Test() |
| 69 | +``` |
| 70 | + |
| 71 | +### 2. Configure Python Environment |
| 72 | + |
| 73 | +If automatic Python installation was skipped, manually configure: |
| 74 | + |
| 75 | +```bash |
| 76 | +# Navigate to installation directory |
| 77 | +cd /path/to/iris-installation/ |
| 78 | + |
| 79 | +# Install Python dependencies |
| 80 | +pip install -r requirements.txt |
| 81 | +``` |
| 82 | + |
| 83 | +### 3. Initialize Vector Search |
| 84 | + |
| 85 | +```objectscript |
| 86 | +// Enable vector search capabilities |
| 87 | +Do ##class(RAG.VectorMigration).EnableVectorSearch() |
| 88 | +``` |
| 89 | + |
| 90 | +### 4. Test RAG Functionality |
| 91 | + |
| 92 | +```objectscript |
| 93 | +// Test basic RAG functionality |
| 94 | +Set bridge = ##class(RAG.PythonBridge).%New() |
| 95 | +Set result = bridge.Query("What is machine learning?", "basic") |
| 96 | +Write result.answer |
| 97 | +``` |
| 98 | + |
| 99 | +## Python Integration |
| 100 | + |
| 101 | +### Environment Setup |
| 102 | + |
| 103 | +The package automatically configures Python integration, but you may need to verify: |
| 104 | + |
| 105 | +```python |
| 106 | +# Test Python package import |
| 107 | +import iris_rag |
| 108 | +from rag_templates import RAG |
| 109 | + |
| 110 | +# Initialize RAG system |
| 111 | +rag = RAG() |
| 112 | +result = rag.query("test query") |
| 113 | +print(result) |
| 114 | +``` |
| 115 | + |
| 116 | +### Configuration Files |
| 117 | + |
| 118 | +After installation, the following configuration files are available: |
| 119 | + |
| 120 | +- `config/config.yaml` - Main configuration |
| 121 | +- `config/pipelines.yaml` - Pipeline configurations |
| 122 | +- `requirements.txt` - Python dependencies |
| 123 | +- `pyproject.toml` - Package metadata |
| 124 | + |
| 125 | +## Verification Steps |
| 126 | + |
| 127 | +### 1. Database Schema Verification |
| 128 | + |
| 129 | +```objectscript |
| 130 | +// Check if RAG tables were created |
| 131 | +SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES |
| 132 | +WHERE TABLE_SCHEMA = 'RAG' |
| 133 | +``` |
| 134 | + |
| 135 | +### 2. Python Package Verification |
| 136 | + |
| 137 | +```python |
| 138 | +# Verify all RAG pipelines are available |
| 139 | +from iris_rag.validation.factory import get_available_pipelines |
| 140 | +pipelines = get_available_pipelines() |
| 141 | +print(f"Available pipelines: {pipelines}") |
| 142 | +``` |
| 143 | + |
| 144 | +### 3. ObjectScript Integration Verification |
| 145 | + |
| 146 | +```objectscript |
| 147 | +// Test ObjectScript-Python bridge |
| 148 | +Set demo = ##class(RAGDemo.TestBed).%New() |
| 149 | +Do demo.RunBasicTests() |
| 150 | +``` |
| 151 | + |
| 152 | +## Troubleshooting |
| 153 | + |
| 154 | +### Common Issues |
| 155 | + |
| 156 | +**1. Python Import Errors** |
| 157 | +```bash |
| 158 | +# Ensure Python path is correct |
| 159 | +which python3 |
| 160 | +pip list | grep sentence-transformers |
| 161 | +``` |
| 162 | + |
| 163 | +**2. Vector Search Not Enabled** |
| 164 | +```objectscript |
| 165 | +// Enable vector search manually |
| 166 | +Do ##class(RAG.VectorMigration).EnableVectorSearch() |
| 167 | +``` |
| 168 | + |
| 169 | +**3. Missing Dependencies** |
| 170 | +```bash |
| 171 | +# Reinstall Python dependencies |
| 172 | +pip install -r requirements.txt --force-reinstall |
| 173 | +``` |
| 174 | + |
| 175 | +**4. Namespace Issues** |
| 176 | +```objectscript |
| 177 | +// Switch to correct namespace |
| 178 | +zn "USER" |
| 179 | +// Or your target namespace |
| 180 | +zn "MYRAG" |
| 181 | +``` |
| 182 | + |
| 183 | +### Diagnostic Commands |
| 184 | + |
| 185 | +```objectscript |
| 186 | +// Run comprehensive diagnostics |
| 187 | +Do ##class(RAG.IPMInstaller).ValidateInstallation() |
| 188 | +
|
| 189 | +// Check system status |
| 190 | +Do ##class(RAG.IPMInstaller).GetSystemStatus() |
| 191 | +
|
| 192 | +// Test individual components |
| 193 | +Do ##class(RAG.IPMInstaller).TestPythonIntegration() |
| 194 | +Do ##class(RAG.IPMInstaller).TestVectorSearch() |
| 195 | +Do ##class(RAG.IPMInstaller).TestRAGPipelines() |
| 196 | +``` |
| 197 | + |
| 198 | +## Uninstallation |
| 199 | + |
| 200 | +To remove the package: |
| 201 | + |
| 202 | +```objectscript |
| 203 | +// Uninstall package |
| 204 | +zpm "uninstall intersystems-iris-rag" |
| 205 | +``` |
| 206 | + |
| 207 | +This will: |
| 208 | +- Remove ObjectScript classes |
| 209 | +- Clean up database schema (optional) |
| 210 | +- Remove package metadata |
| 211 | + |
| 212 | +Note: Python dependencies and configuration files may need manual cleanup. |
| 213 | + |
| 214 | +## Advanced Configuration |
| 215 | + |
| 216 | +### Custom Schema Installation |
| 217 | + |
| 218 | +```objectscript |
| 219 | +// Install to custom schema |
| 220 | +Do ##class(RAG.IPMInstaller).SetParameter("CUSTOM_SCHEMA", "MyCompany") |
| 221 | +Do ##class(RAG.IPMInstaller).Configure() |
| 222 | +``` |
| 223 | + |
| 224 | +### Production Deployment |
| 225 | + |
| 226 | +For production environments: |
| 227 | + |
| 228 | +1. **Set Production Parameters**: |
| 229 | +```objectscript |
| 230 | +Do ##class(RAG.IPMInstaller).SetParameter("ENVIRONMENT", "PRODUCTION") |
| 231 | +Do ##class(RAG.IPMInstaller).SetParameter("LOG_LEVEL", "WARNING") |
| 232 | +``` |
| 233 | + |
| 234 | +2. **Configure Security**: |
| 235 | +```objectscript |
| 236 | +// Set up secure database connections |
| 237 | +Do ##class(RAG.IPMInstaller).ConfigureProductionSecurity() |
| 238 | +``` |
| 239 | + |
| 240 | +3. **Enable Monitoring**: |
| 241 | +```objectscript |
| 242 | +// Enable production monitoring |
| 243 | +Do ##class(RAG.IPMInstaller).EnableMonitoring() |
| 244 | +``` |
| 245 | + |
| 246 | +## Support and Documentation |
| 247 | + |
| 248 | +- **Main Documentation**: [RAG Templates Documentation](../README.md) |
| 249 | +- **Configuration Guide**: [Configuration Documentation](CONFIGURATION.md) |
| 250 | +- **Troubleshooting**: [Deployment Guide](guides/DEPLOYMENT_GUIDE.md) |
| 251 | +- **API Reference**: [Developer Guide](DEVELOPER_GUIDE.md) |
| 252 | + |
| 253 | +## Version Compatibility |
| 254 | + |
| 255 | +| RAG Templates Version | IRIS Version | Python Version | Notes | |
| 256 | +|----------------------|--------------|----------------|-------| |
| 257 | +| 0.2.0+ | 2025.1+ | 3.11+ | Full feature support | |
| 258 | +| 0.1.x | 2024.1+ | 3.9+ | Limited vector search | |
| 259 | + |
| 260 | +For older IRIS versions, consider manual installation following the [Deployment Guide](guides/DEPLOYMENT_GUIDE.md). |
0 commit comments