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74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# MnemoCore Helm Chart - Default Values
# ======================================
# Override these values in your own values file or via --set flags

# Global settings
global:
  imageRegistry: ""
  imagePullSecrets: []
  storageClass: ""
  namespace: mnemocore

# MnemoCore API Configuration
mnemocore:
  # Number of replicas (ignored if autoscaling.enabled is true)
  replicaCount: 2

  # Container image
  image:
    repository: mnemocore
    tag: "latest"
    pullPolicy: IfNotPresent

  # Container ports
  ports:
    api: 8100
    metrics: 9090

  # Resource limits and requests
  resources:
    limits:
      cpu: "2"
      memory: "2Gi"
    requests:
      cpu: "500m"
      memory: "512Mi"

  # Probes configuration
  probes:
    liveness:
      enabled: true
      initialDelaySeconds: 40
      periodSeconds: 30
      timeoutSeconds: 10
      failureThreshold: 3
      successThreshold: 1
    readiness:
      enabled: true
      initialDelaySeconds: 20
      periodSeconds: 10
      timeoutSeconds: 5
      failureThreshold: 3
      successThreshold: 1
    startup:
      enabled: true
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 5
      failureThreshold: 30
      successThreshold: 1

  # HAIM Configuration (mounted as config.yaml)
  config:
    version: "3.0"
    dimensionality: 16384
    encoding:
      mode: "binary"
      token_method: "bundle"
    tiers:
      hot:
        max_memories: 2000
        ltp_threshold_min: 0.7
        eviction_policy: "lru"
      warm:
        max_memories: 100000
        ltp_threshold_min: 0.3
        consolidation_interval_hours: 1
        storage_backend: "mmap"
      cold:
        storage_backend: "filesystem"
        compression: "gzip"
        archive_threshold_days: 30
    ltp:
      initial_importance: 0.5
      decay_lambda: 0.01
      permanence_threshold: 0.95
      half_life_days: 30.0
    hysteresis:
      promote_delta: 0.15
      demote_delta: 0.10
    gpu:
      enabled: false
      device: "cuda:0"
      batch_size: 1000
      fallback_to_cpu: true
    observability:
      metrics_port: 9090
      log_level: "INFO"
      structured_logging: true
    paths:
      data_dir: "/app/data"
      memory_file: "/app/data/memory.jsonl"
      codebook_file: "/app/data/codebook.json"
      concepts_file: "/app/data/concepts.json"
      synapses_file: "/app/data/synapses.json"
      warm_mmap_dir: "/app/data/warm_tier"
      cold_archive_dir: "/app/data/cold_archive"
    mcp:
      enabled: false
      transport: "stdio"
      host: "127.0.0.1"
      port: 8110
      api_base_url: "http://localhost:8100"
      timeout_seconds: 15
      allow_tools:
        - "memory_store"
        - "memory_query"
        - "memory_get"
        - "memory_delete"
        - "memory_stats"
        - "memory_health"

  # Environment variables
  env:
    logLevel: "INFO"
    host: "0.0.0.0"
    port: 8100

  # API Key (set via secret)
  apiKey:
    # Use existing secret
    existingSecret: ""
    # Key in the secret containing the API key
    key: "HAIM_API_KEY"
    # If not using existing secret, set value here (NOT RECOMMENDED for production)
    value: ""

  # Persistence
  persistence:
    enabled: true
    accessModes:
      - ReadWriteOnce
    size: 10Gi
    # storageClass: ""
    annotations: {}

  # Service configuration
  service:
    type: ClusterIP
    port: 8100
    targetPort: 8100
    metricsPort: 9090
    annotations: {}
    labels: {}

  # Ingress configuration
  ingress:
    enabled: false
    className: ""
    annotations: {}
      # kubernetes.io/ingress.class: nginx
      # kubernetes.io/tls-acme: "true"
    hosts:
      - host: mnemocore.local
        paths:
          - path: /
            pathType: Prefix
    tls: []
    #  - secretName: mnemocore-tls
    #    hosts:
    #      - mnemocore.local

  # Autoscaling configuration
  autoscaling:
    enabled: true
    minReplicas: 2
    maxReplicas: 10
    targetCPUUtilizationPercentage: 70
    targetMemoryUtilizationPercentage: 80
    # Custom metrics
    metrics: []
    behavior: {}

  # Pod Disruption Budget
  podDisruptionBudget:
    enabled: true
    minAvailable: 1
    # maxUnavailable: 1

  # Pod security context
  podSecurityContext:
    runAsNonRoot: true
    runAsUser: 1000
    runAsGroup: 1000
    fsGroup: 1000

  # Container security context
  securityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
        - ALL
    readOnlyRootFilesystem: true
    runAsNonRoot: true

  # Node selector
  nodeSelector: {}

  # Tolerations
  tolerations: []

  # Affinity
  affinity: {}

  # Pod annotations
  podAnnotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "9090"
    prometheus.io/path: "/metrics"

  # Pod labels
  podLabels: {}

  # Priority class name
  priorityClassName: ""

  # Termination grace period
  terminationGracePeriodSeconds: 30

  # Service account
  serviceAccount:
    create: true
    name: ""
    annotations: {}

  # Init containers
  initContainers: []

  # Extra volumes
  extraVolumes: []

  # Extra volume mounts
  extraVolumeMounts: []

# Redis Configuration
redis:
  # Enable Redis as part of this chart
  enabled: true

  # Use Bitnami Redis chart or embedded config
  embedded:
    enabled: false

  # When not using Bitnami chart
  image:
    repository: redis
    tag: "7.2-alpine"
    pullPolicy: IfNotPresent

  # Redis configuration
  config:
    maxmemory: "512mb"
    maxmemoryPolicy: "allkeys-lru"
    save: "60 1"
    logLevel: "warning"

  # Resource limits
  resources:
    limits:
      cpu: "1"
      memory: "512Mi"
    requests:
      cpu: "100m"
      memory: "128Mi"

  # Probes
  probes:
    liveness:
      enabled: true
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 5
      failureThreshold: 5
    readiness:
      enabled: true
      initialDelaySeconds: 5
      periodSeconds: 5
      timeoutSeconds: 3
      failureThreshold: 5

  # Service
  service:
    type: ClusterIP
    port: 6379

  # Persistence
  persistence:
    enabled: true
    accessModes:
      - ReadWriteOnce
    size: 5Gi
    # storageClass: ""

  # URL override (if using external Redis)
  url: ""
  existingSecret: ""

# Qdrant Configuration
qdrant:
  # Enable Qdrant as part of this chart
  enabled: true

  # Use official Qdrant chart or embedded config
  embedded:
    enabled: false

  # When not using official chart
  image:
    repository: qdrant/qdrant
    tag: "latest"
    pullPolicy: IfNotPresent

  # Qdrant configuration
  config:
    grpcPort: 6334
    logLevel: "INFO"

  # HAIM-specific collection settings
  collections:
    hot:
      name: "haim_hot"
      binaryQuantization: true
      alwaysRam: true
      hnswM: 16
      hnswEfConstruct: 100
    warm:
      name: "haim_warm"
      binaryQuantization: true
      alwaysRam: true
      hnswM: 16
      hnswEfConstruct: 100

  # Resource limits
  resources:
    limits:
      cpu: "2"
      memory: "4Gi"
    requests:
      cpu: "500m"
      memory: "1Gi"

  # Probes
  probes:
    liveness:
      enabled: true
      initialDelaySeconds: 15
      periodSeconds: 10
      timeoutSeconds: 5
      failureThreshold: 5
    readiness:
      enabled: true
      initialDelaySeconds: 10
      periodSeconds: 5
      timeoutSeconds: 3
      failureThreshold: 5

  # Services
  service:
    type: ClusterIP
    httpPort: 6333
    grpcPort: 6334

  # Persistence
  persistence:
    enabled: true
    accessModes:
      - ReadWriteOnce
    size: 20Gi
    # storageClass: ""

  # URL override (if using external Qdrant)
  url: ""
  existingSecret: ""

# Network Policies
networkPolicy:
  enabled: false
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              name: mnemocore
      ports:
        - protocol: TCP
          port: 8100
        - protocol: TCP
          port: 9090

# Service Monitor (Prometheus Operator)
serviceMonitor:
  enabled: false
  namespace: ""
  interval: 30s
  scrapeTimeout: 10s
  labels: {}
  annotations: {}
  relabelings: []
  metricRelabelings: []

# Grafana Dashboard
grafana:
  dashboard:
    enabled: false
    namespace: ""
    labels:
      grafana_dashboard: "1"
    annotations: {}

# Prometheus Rules
prometheusRule:
  enabled: false
  namespace: ""
  additionalLabels: {}
  rules: []

# Test configuration
test:
  enabled: false
  image:
    repository: busybox
    tag: "latest"