memQL Tech Stack & Deployment Practices
Version: 1.0 Date: February 8, 2026 Audience: Backend and Frontend Development Teams
[TASKS] Purpose
This document establishes the opinionated technologies and practices for memQL development and deployment. These standards ensure consistency, effectiveness, and clear separation of environments across all teams.
[BUILD] Technology Stack
Backend
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Language | Go | 1.26.1+ | Primary backend language |
| Database | PostgreSQL + TimescaleDB | 16 + latest | Time-series memory graph |
| API | HTTP + gRPC | - | REST and real-time communication |
| WebSocket | Native Go | - | Real-time collaboration |
| SI | Multi-provider (OpenAI, Anthropic) | latest | All SI text/chat/vision/speech goes through gRPC on MemqlService.Stream (AiChatMsg, AiSpeechMsg, AiTranscribeMsg, AiSuggestMsg). The legacy SI HTTP path is gone. |
| Auth | In-house identity service | - | Magic-link login, JWT, JWKS-published; PAT for CLI |
| Container | Docker | latest | Local development |
| Orchestration | Docker Compose | 3.8+ | Multi-container management |
| Coding Agent | NemoClaw (NVIDIA) | latest | Enterprise coding/automation agent (Apache 2.0) |
Query Language
| Component | Technology | Purpose |
|---|---|---|
| MemQL DSL | Custom language | Query language for time-series graphs |
| Automations | MemQL DSL | Event-driven workflows |
| Functions | MemQL DSL | Reusable query functions |
Frontend (for reference)
| Component | Technology | Notes |
|---|---|---|
| Framework | TBD | Coordinate with frontend team |
| API Client | HTTP + WebSocket | Connect to memQL service |
| Auth | In-house identity service (magic-link JWT) | Same auth provider as backend |
Environment Architecture
1. Development Environment
Purpose: Isolated development and testing on developer machines
| Component | Technology | Location |
|---|---|---|
| Database | PostgreSQL + TimescaleDB | Docker container (local) |
| Service | memQL | Docker container (local) |
| Ports | 5432, 8088 (BFF HTTP), 50051 (BFF gRPC), 50059 (Voice), 18789 (NemoClaw) | localhost |
| Data | Ephemeral | Docker volumes (can be reset) |
Commands:
# Start development environmentdocker compose -f docker/docker-compose.full.yml up --build # Stop (preserves data)docker compose -f docker/docker-compose.full.yml down # View logsdocker compose -f docker/docker-compose.full.yml logs -f # Access databasepsql postgres://memql:memql_dev@localhost:5432/memqlDeveloper Access: [x] All developers
2. Staging Environment
Purpose: Shared testing and staging environment for integration testing
| Component | Technology | Location |
|---|---|---|
| Database | TimescaleDB Cloud (Tiger Cloud) | Managed Tiger Cloud instance |
| Service | memQL | Azure Kubernetes Service (cluster aks-memql-staging, namespace memql) |
| URL | HTTPS | https://app.staging.copresent.ai, https://identity.staging.copresent.ai |
| Data | Persistent | Managed by Tiger Cloud |
Commands:
# Deploy to staging (Azure AKS)make deploy VERSION=X # View logskubectl logs -n memql deployment/bff -fSee DEPLOYMENT_STRATEGY.md for the full deploy flow and topology.
Developer Access: [x] All developers
3. Production Environment
Purpose: Live production system serving real users
| Component | Technology | Location |
|---|---|---|
| Database | TimescaleDB Cloud (Tiger Cloud) | Production instance (separate from staging) |
| Service | memQL | Azure Kubernetes Service (production) |
| URL | HTTPS | Production domain |
| Data | Persistent | Managed by Tiger Cloud (with backups) |
Deployment:
- Automatic via CI/CD pipeline when code is merged to
mainbranch - Manual deploys require production access permissions
Developer Access: WARNING: Limited - only developers with production permissions
AUTH Authentication & Authorization
In-house identity service
All environments use the in-house identity service
(component/identity, make identity) for authentication:
- Magic-link login as the primary path
- Personal Access Tokens (PATs) for CLI clients
- Per-node JWT verifier (
component/identity/verifier) on bff/voice/cognition/agent/planner; JWKS-published - Role-based access control (owner / admin / writer / reader)
- Centralized user + invitation management via the admin web app
at
/admin/*
See docs/public/operate/auth/identity-service.md for the operator-side narrative.
Developer Access Levels
| Environment | Access Level | Permissions |
|---|---|---|
| Development | All Developers | Full access (own machine) |
| Staging | All Developers | Deploy, view logs, test |
| Production | Senior/Lead Developers | Deploy, configure, manage |
Service Accounts
- AKS pulls images from ACR (
acrmemql.azurecr.io) - Secrets managed via the genesis A2 sealed envelope + Azure Key Vault
(
kv-memql-<env>); see DEPLOYMENT_STRATEGY.md - Environment variables injected at runtime
Deployment Practices
Development Workflow
Workflow:
- Pull latest from
main - Start development Docker environment:
docker compose -f docker/docker-compose.full.yml up --build - Make code changes
- Test locally:
go test ./... - View logs:
docker compose -f docker/docker-compose.full.yml logs -f - Commit (directly to
mainfor focused changes; feature branch + PR when review is useful)
Best Practices:
- Always use development Docker database (not staging database)
- Reset development database if migrations conflict: stop services, remove Docker volumes, then restart
- Use debug logging (enabled by default in Docker)
- Test automations and functions in development before deploying
- Generate
.env.local(master key + bootstrap envelope) withmake bootstrap, populate memQL config viamake secrets-init+make secrets-seed
Staging Deployment
Workflow:
- Ensure all tests pass:
go test ./... - Push feature branch to GitHub
- Deploy to staging:
make deploy VERSION=X - Verify deployment via logs and health endpoint
- Test integration with frontend (if applicable)
- Create pull request when ready
Best Practices:
- Always test in development before deploying to staging
- Staging shares database - be careful with schema changes
- Coordinate with team if making breaking changes
- Use staging for integration testing, not development
Production Deployment
Workflow:
- Feature branch reviewed and approved via PR
- Merge PR to
mainbranch - CI/CD pipeline automatically deploys to production
- Monitor deployment logs for errors
- Verify production health endpoint
- Monitor for 24 hours after deployment
Best Practices:
- Never deploy untested code to production
- Always run full test suite before merging
- Schema migrations run automatically (use caution)
- Coordinate with team for major changes
- Have rollback plan ready
- Test thoroughly in staging before production deployment
CONFIG Development Tools
Hardware Requirements
Standardized Platform: macOS with Apple Silicon
| Component | Requirement | Notes |
|---|---|---|
| Operating System | macOS | Monterey (12.0) or later |
| Processor | Apple Silicon (M1/M2/M3) | ARM64 architecture |
| Devices | MacBook Pro or MacBook Air | With M-series chips |
| RAM | 16GB minimum, 32GB recommended | For Docker + IDE + services |
| Storage | 50GB free minimum | For Docker images, dependencies |
Why Apple Silicon?
- Standardized development environment across team
- Native ARM64 Docker performance
- Consistent tooling and behavior
- Superior battery life for remote work
Required Software
| Tool | Purpose | Installation |
|---|---|---|
| Go 1.26.1+ | Backend development | https://go.dev/dl/ (ARM64 build) |
| Docker Desktop | Local environment | https://docker.com/products/docker-desktop (Apple Silicon) |
| Docker Compose | Local container orchestration | Pre-installed with Docker Desktop |
Azure CLI (az) | Cloud deployments (AKS, ACR) | https://learn.microsoft.com/cli/azure/install-azure-cli |
| kubectl | AKS cluster management | https://kubernetes.io/docs/tasks/tools/ |
| git | Version control | Pre-installed on macOS |
Optional Tools
| Tool | Purpose | Installation |
|---|---|---|
| pgAdmin | Database GUI | docker-compose --profile tools up -d pgadmin |
| Tiger CLI | Database management | ./scripts/tiger-setup.sh |
| Postman | API testing | https://postman.com/downloads/ |
DOCS Documentation Standards
Documentation Structure
memQL/├── CLAUDE.md # Project overview (read first)├── docs/public/overview/quickstart.md # 5-minute setup guide├── GLOSSARY.md # Complete doc index├── docs/│ ├── core/ # Architecture, language│ ├── api/ # API references│ ├── guides/ # How-to guides│ ├── auth/ # Authentication│ └── planning/ # Historical planning└── .claude/ # Claude Code CLI configurationFinding Documentation
- Project overview: Start with
CLAUDE.md - Quick setup: Read
docs/public/overview/quickstart.md - Find topics: Use
GLOSSARY.md - Component details: Check directory
CLAUDE.mdfiles - Commands: See docs/public/overview/quickstart.md for common development commands
START Quick Reference
Common Commands
# Development Environmentdocker compose -f docker/docker-compose.full.yml up --build # Start Docker stackdocker compose -f docker/docker-compose.full.yml down # Stop containersdocker compose -f docker/docker-compose.full.yml logs -f # View logspsql postgres://memql:memql_dev@localhost:5432/memql # PostgreSQL shell # Testinggo test ./... # Run Go test suite # Deployment (Azure AKS) -- see DEPLOYMENT_STRATEGY.mdmake deploy VERSION=X # Deploy to staging (scripts/deploy/aks-deploy.sh) # Dev secrets workflowmake bootstrap # Generate .env.local with master key + bootstrap envelopemake secrets-init # Interactively populate ~/.memql/dev-secrets.yaml from manifestmake secrets-seed # Push the yaml into running memQL (encrypts secrets first)make secrets-list # Diff manifest vs yaml vs running memQL # AKSkubectl get pods -n memql # List podskubectl logs -n memql deployment/bff -f # View logskubectl get deployments -n memql # Deployment status (staging)Environment Variables
Managed via memQL concept storage (v1:platform:globalVariable and
v1:platform:globalSecret). Operators populate via Make targets backed by
the dev-secrets workflow; see docs/public/operate/env-vars.md
for the full design.
Development (Docker):
- Generate
.env.localwithmake bootstrap(writes master key + bootstrap envelope; idempotent) - Populate
~/.memql/dev-secrets.yamlinteractively withmake secrets-init - Push to memQL with
make secrets-seed - Override with
.env.localfile (git-ignored) for the bootstrap envelope only - Debug logging enabled by default
Partition Configuration:
- No env var. Partition defaults to
"default"and is set per-request via the gRPC envelope (MemqlClientMessage.partition). - Auto-injected into every query / mutation / event topic by the engine.
- The CLI manages partitions interactively in the Clusters tab and persists
the per-cluster selection in
~/.memql/clusters.yaml.
Staging/Production (AKS):
- Shared secrets (DSN, master key, identity signing seed) ride the
genesis A2 sealed envelope (
MEMQL_GENESIS_B64in thememql-secretsSecret), backed up in Azure Key Vault (kv-memql-<env>). Per-node, non-secret config lives in the k8s manifest env. See DEPLOYMENT_STRATEGY.md for the canonical add/rotate flow. - Everything else lives in memQL's
v1:platform:globalSecret/v1:platform:globalVariableconcepts - Never commit secrets to git
Opinionated Practices
Code Standards
- Go formatting: Use
gofmtandgoimports - Testing: Write tests for all new features
- Error handling: Always handle errors explicitly
- Logging: Use structured logging (slog)
- Comments: Document why, not what
Git Workflow
- Single long-lived branch:
main. Commit directly when PR review isn't useful; use a short-lived feature branch only when it is. - Stage by explicit path (
git add <file>) -- nevergit add -A/.. Multiple Claude sessions may share a worktree. - Pre-release; no backwards-compat shims. When a contract changes, fix both memQL and the consumer (typically CoPresent) at once and delete what's no longer needed.
- Commit messages: Clear, imperative mood. Subject under ~70 chars. Body explains the why.
- Co-authoring: Include SI contributions
(
Co-Authored-By: Claude ... <noreply@anthropic.com>).
Docker Practices
- Development isolation: Always use development Docker for local work
- Volume mounts: Use for live code changes
- Health checks: All containers must have health checks
- Multi-stage builds: Optimize image sizes
- Non-root users: Security best practice
- Environment variables: Generate
.env.localwithmake bootstrap, then populate memQL config viamake secrets-init+make secrets-seed
Database Practices
- Migrations: Automatic on startup (use carefully in production)
- Seeding: Use concept seeding for test data
- Backups: Managed by Tiger Cloud (production and staging)
- Reset:
docker compose -f docker/docker-compose.full.yml down -vthen restart for fresh development database - Schema changes: Coordinate with team
Team Coordination
Before Major Changes
Notify team if changes affect:
- Database schema
- API contracts
- Authentication flow
- Environment variables
- Deployment process
Communication Channels
- Code reviews: GitHub pull requests
- Questions: Team chat or documentation
- Issues: GitHub issues
- Architecture: Architecture decision records (ADRs)
INFO Success Metrics
Development Velocity
- Local setup time: < 5 minutes
- Test execution time: < 2 minutes
- Deploy to staging time: < 5 minutes
- Deploy to production time: < 10 minutes
Code Quality
- Test coverage: > 70%
- Build success rate: > 95%
- Production incidents: Minimize
- Documentation completeness: 100%
[REFRESH] Continuous Improvement
This document is a living standard. Update it when:
- New technologies are adopted
- Practices are refined based on experience
- Team feedback suggests improvements
- Industry best practices evolve
Last Updated: April 29, 2026
Support & Questions
- Documentation: Check
GLOSSARY.mdfirst - Quick start: See
docs/public/overview/quickstart.md - Team: Ask in team chat or create GitHub issue
This document establishes our opinionated tech stack and practices for effective, standardized development across all teams.