Skip to main content

Collections & Tables Reference

Audience: Engineering · QA · Support · Where in app: Internal · Plan availability: All plans

A high-density map of where data lives. Each service owns its own persistence — there is no cross-service shared schema; data crosses boundaries via API calls and shared IDs (company_id, user_session_id, person_id, file_id), never database joins. Use this page when you need to know which store holds a given record, or how to follow a record from one store to another.

Engineering deep-dive: Data Stores covers which service owns which database and the schema features (pgvector HNSW, JSONB, soft-deletes). This page is the collection/table catalogue. For the visitor-specific records (UserSession / VisitorProfile / SessionAnalysis / Person) see Visitor data; for companies.* config see Company configuration.

MongoDB — backend, ms-communication, ms-sessions

The three Nodevel services use MongoDB via Mongoose (locally mongo:7.0; backend is the largest schema, ~70 models).

Core tenant + identity

CollectionWhat
companiesTenants. Owns all per-tenant config (see Company configuration).
usersTeam members (admins + agents).
peopleGlobal Person records (name/email/phone/match_keys).
person_profilesPer-tenant Person view (extracted_facts, form_submissions, bookings, crm_enrichment).
user_sessionsOne row per visit. widget_user_session_id, lead_score, page visits, contact info, traffic source.
user_devicesDevice fingerprints for identity verification (also APN/FCM push tokens in ms-communication).
person_ip_signals / session_ipsIP-assisted identity-resolution signals.
playground_companiesSandbox tenants.

Communication

CollectionWhat
chatsFinal chat records (transcript messages[], knox enrichment).
service_roomsActive session containers (chat + call).
chat_queuePending chats waiting for an agent.
chatbotsFlow-builder definitions.
inbound_outbound_callsCall records (Twilio SID, recording URL, transcript) — in ms-communication.
call_eventsReal-time call event log.

Sessions & recording (ms-sessions)

CollectionWhat
session_filesrrweb recordings — chunk metadata, S3 paths, recording_status.
session_analysesPer-visit analysis artifact.
visitor_profilesCross-visit rollup keyed on (company_id, user_session_id).

Bookings & leads

CollectionWhat
bookingsAll meetings (Google / Calendly / GHL / manual).
form_submissionsCaptured forms (audit).

CRM / integrations / enrichment

CollectionWhat
webhooksOutbound webhook subscriptions.
webhook_events / webhook_logsWebhook delivery audit.
hubspot_requestsHubSpot sync audit.
outbound_call_ghl_syncGHL outbound-call sync state.
clearbit_sessions, rb2b_sessions, snitcher_sessions, apollo_records, happier_lead_sessionsB2B enrichment caches.

AI & automation

CollectionWhat
ai_conversationsQ+A training pairs (FAQ).
ai_credit_logsEvery credit consume/refill (180-day expiry).
ai_auto_trigger_messagesAuto-trigger message templates.
nox_actionsNox-initiated action records (NoxActionModel).
knox_visitor_directivesAuto-engage-on-return directives (KnoxVisitorDirectiveModel).
knox_visitor_watch_eventsReturn-visit watch events (KnoxVisitorWatchEventModel).
identity_graph_defaultsSingleton global IG config.

Billing & subscription

CollectionWhat
subscriptionsActive subscriptions (credits, expiry, trial).
packagesProduct tier SKUs.
addonsAdd-on SKUs.
invoicesStripe invoice mirror.
agencies, agency_packages, agency_addons, agency_subscriptionsReseller objects.

Operational

CollectionWhat
notificationsIn-app notifications.
admin_notificationsInternal admin alerts.
email_logsEmail send audit.
api_request_logsAPI call audit.
logsGeneral backend activity log.
filesUploaded assets (videos, logos, PDFs).
permissions, rolesRBAC.
teamsTeam groupings.
settingsGlobal key-value config.
blockedBlock-list for phone/email.

PostgreSQL + pgvector — ms-ai

ms-ai uses Postgres 17 with the pgvector extension via TypeORM; schema is migration-managed (ms-ai/migrations/).

Knox knowledge base (RAG)

TableWhat
knox_knowledge_chunksEmbeddings + metadata (this docs corpus's chunks; dual 1536-dim, HNSW index).
knox_knowledge_documentsSource markdown (pre-chunk).
knox_knowledge_collectionsFolders/groups of docs.
knox_knowledge_sourcesExternal sources (URLs) ingested.
knox_page_registryInternal app URL map for navigation.
knox_search_indexCross-tenant semantic-search embeddings (visitor narratives, session intents) — results filtered by company_id.

Knox analytics & memory

TableWhat
knox_session_analysesPer-visit analysis (PK: file_id).
knox_visitor_profilesPer-visitor cumulative profile (unique (company_id, user_session_id)).
knox_call_transcriptsVoice call transcripts + quality scores.
knox_agent_conversationsEvery Nox Q+A turn (audit + feedback).
knox_admin_memoryDurable per-admin facts (pgvector).

Knox tenant config + actions

TableWhat
knox_ai_modelsLLM config per tenant.
knox_tenant_configCustom Nox behaviors.
knox_usage_eventsToken / cost usage tracking per tool call.
knox_engagement_rulesAutomation conditions.
knox_action_eventsUnified write-side action stream (GHL / Nox / ElevenLabs / calendar / email).
knox_action_auditAudit of Knox-initiated actions.
knox_ghl_automation_eventsRaw GHL webhook events.

Identity & integrations

TableWhat
agent_memoriesPersistent conversation facts per visitor.
elabs_agentsElevenLabs Conversational AI agent configs.
elabs_phone_numbersMapped phone numbers for inbound AI calls.
integrationTenant platform credentials (Shopify / WooCommerce / Calendly / Google / GHL Calendar).
rag_productsSynced ecommerce products with embeddings.

Redis — cross-service (shared infra, not shared data)

Isolated instances/keys per service (redis-backend, redis-communication, redis-sessions).

UseWhere
Socket.IO adapter (multi-pod fan-out)All sockets
Cache (subscription gate, CRM enrichment)Backend, ms-ai
Rate limitingms-communication call/message limiters
Session storageBackend auth
Visitor presence registryms-sessions (powers knox_presence)
BullMQ queuesms-sessions analysis worker, ms-ai fact-extraction + embedding workers

Firestore — ms-communication

UseWhat
Real-time chat/call stateEach socket subscribes to /rooms/{room_id}/messages; SocketService keeps Firestore + Socket.IO in sync. Twilio WebRTC call tracking.

S3 — object storage

UseWhere
Recording NDJSON chunks (raw rrweb)ms-sessions
Stitched recordings / video files (call recordings, default videos)backend
Uploaded files (logos, PDFs, agent knowledge)backend

Join-key cheat sheet

The IDs that stitch records across stores:

WantJoin
Sessions for a personpeople._idperson_profiles.person_id (per tenant) → user_sessions.person_id
Chats for a personpeople._idperson_profiles.person_idchats.person_id
Recording for a sessionuser_sessions.widget_user_session_idsession_files.user_session_id (then session_files._id = file_id)
Analysis for a recordingsession_files._id = session_analyses.file_id = knox_session_analyses.file_id
Visitor profile from session(user_sessions.company_id, user_sessions.widget_user_session_id) = visitor_profiles.(company_id, user_session_id)
Cross-tenant Person checkpeople.match_keys contains sha256(normalized_email)
Booking attributionbookings.user_session_iduser_sessions → full journey