Skip to content

feat(docker): mem0-api sidecar bundling for RunPod Pod A/B (Qwen3-Embed-8B + Gemma-4 E4B vLLM) #31

Description

@luke-n-alpha

Summary

RunPod 듀얼 Pod (Pod A: Emotional / Pod B: Workflow) 양쪽에서 naia-memory 의 mem0-api 를 사이드카로 동작시키기 위해, naia-memory dist 를 Pod 이미지에 multi-stage 번들.

Scope

  • pod-a/Dockerfilepod-b/Dockerfile (각각의 레포에서 작성) 의 multi-stage 빌드에서 naia-memory dist 번들
    • stage 1: node:20 에서 naia-memory build → dist 산출
    • stage 2: 최종 이미지로 dist 복사
  • mem0-api.ts port 9876 노출
  • supervisord program: mem0-api 프로세스 등록 (Pod A/B 양쪽)
  • 환경변수:
    • VLLM_EMBED_BASE → 로컬 Qwen3-Embedding-8B FP16 endpoint
    • VLLM_REASONING_BASE → 로컬 google/gemma-4-E4B FP16 endpoint
    • 양 Pod 동일 (페르소나 전환 시 메모리 공간 호환)

페르소나 전환 호환

Qwen3-Embedding-8B FP16 + gemma-4 E4B FP16 를 양 Pod 공통으로 사이드카에 두는 이유:

  • Pod A (emotional) ↔ Pod B (workflow) 사이를 옮겨다닐 때 동일한 임베딩 공간 + 동일한 reasoning 모델 → consolidate / contradiction filter 결과 호환.
  • naia-memory R2.5 dual-process retrieval-rerank 아키텍처 그대로 사용.

통일 단가 컨텍스트

Gateway 측 통일 단가 $0.49/hr (realtime.py:46 0.49/60, config.naia.yml chat_session_price_per_hour: 0.49). 사이드카 비용은 Pod 시간단가에 포함.

Acceptance

  • naia-memory multi-stage build 산출물이 Pod A/B 양쪽 이미지에 번들
  • supervisord 가 mem0-api 를 port 9876 으로 띄움
  • VLLM_EMBED_BASE / VLLM_REASONING_BASE env 적용 확인
  • silent embedding failure 방지 — startup 시 factEmbeddings probe

Tracked in plan: /home/luke/.claude/plans/polished-hatching-walrus.md
Related sibling issues:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2개선·측정·후순위enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions