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
| Collection | What |
|---|
companies | Tenants. Owns all per-tenant config (see Company configuration). |
users | Team members (admins + agents). |
people | Global Person records (name/email/phone/match_keys). |
person_profiles | Per-tenant Person view (extracted_facts, form_submissions, bookings, crm_enrichment). |
user_sessions | One row per visit. widget_user_session_id, lead_score, page visits, contact info, traffic source. |
user_devices | Device fingerprints for identity verification (also APN/FCM push tokens in ms-communication). |
person_ip_signals / session_ips | IP-assisted identity-resolution signals. |
playground_companies | Sandbox tenants. |
Communication
| Collection | What |
|---|
chats | Final chat records (transcript messages[], knox enrichment). |
service_rooms | Active session containers (chat + call). |
chat_queue | Pending chats waiting for an agent. |
chatbots | Flow-builder definitions. |
inbound_outbound_calls | Call records (Twilio SID, recording URL, transcript) — in ms-communication. |
call_events | Real-time call event log. |
Sessions & recording (ms-sessions)
| Collection | What |
|---|
session_files | rrweb recordings — chunk metadata, S3 paths, recording_status. |
session_analyses | Per-visit analysis artifact. |
visitor_profiles | Cross-visit rollup keyed on (company_id, user_session_id). |
Bookings & leads
| Collection | What |
|---|
bookings | All meetings (Google / Calendly / GHL / manual). |
form_submissions | Captured forms (audit). |
CRM / integrations / enrichment
| Collection | What |
|---|
webhooks | Outbound webhook subscriptions. |
webhook_events / webhook_logs | Webhook delivery audit. |
hubspot_requests | HubSpot sync audit. |
outbound_call_ghl_sync | GHL outbound-call sync state. |
clearbit_sessions, rb2b_sessions, snitcher_sessions, apollo_records, happier_lead_sessions | B2B enrichment caches. |
AI & automation
| Collection | What |
|---|
ai_conversations | Q+A training pairs (FAQ). |
ai_credit_logs | Every credit consume/refill (180-day expiry). |
ai_auto_trigger_messages | Auto-trigger message templates. |
nox_actions | Nox-initiated action records (NoxActionModel). |
knox_visitor_directives | Auto-engage-on-return directives (KnoxVisitorDirectiveModel). |
knox_visitor_watch_events | Return-visit watch events (KnoxVisitorWatchEventModel). |
identity_graph_defaults | Singleton global IG config. |
Billing & subscription
| Collection | What |
|---|
subscriptions | Active subscriptions (credits, expiry, trial). |
packages | Product tier SKUs. |
addons | Add-on SKUs. |
invoices | Stripe invoice mirror. |
agencies, agency_packages, agency_addons, agency_subscriptions | Reseller objects. |
Operational
| Collection | What |
|---|
notifications | In-app notifications. |
admin_notifications | Internal admin alerts. |
email_logs | Email send audit. |
api_request_logs | API call audit. |
logs | General backend activity log. |
files | Uploaded assets (videos, logos, PDFs). |
permissions, roles | RBAC. |
teams | Team groupings. |
settings | Global key-value config. |
blocked | Block-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)
| Table | What |
|---|
knox_knowledge_chunks | Embeddings + metadata (this docs corpus's chunks; dual 1536-dim, HNSW index). |
knox_knowledge_documents | Source markdown (pre-chunk). |
knox_knowledge_collections | Folders/groups of docs. |
knox_knowledge_sources | External sources (URLs) ingested. |
knox_page_registry | Internal app URL map for navigation. |
knox_search_index | Cross-tenant semantic-search embeddings (visitor narratives, session intents) — results filtered by company_id. |
Knox analytics & memory
| Table | What |
|---|
knox_session_analyses | Per-visit analysis (PK: file_id). |
knox_visitor_profiles | Per-visitor cumulative profile (unique (company_id, user_session_id)). |
knox_call_transcripts | Voice call transcripts + quality scores. |
knox_agent_conversations | Every Nox Q+A turn (audit + feedback). |
knox_admin_memory | Durable per-admin facts (pgvector). |
Knox tenant config + actions
| Table | What |
|---|
knox_ai_models | LLM config per tenant. |
knox_tenant_config | Custom Nox behaviors. |
knox_usage_events | Token / cost usage tracking per tool call. |
knox_engagement_rules | Automation conditions. |
knox_action_events | Unified write-side action stream (GHL / Nox / ElevenLabs / calendar / email). |
knox_action_audit | Audit of Knox-initiated actions. |
knox_ghl_automation_events | Raw GHL webhook events. |
Identity & integrations
| Table | What |
|---|
agent_memories | Persistent conversation facts per visitor. |
elabs_agents | ElevenLabs Conversational AI agent configs. |
elabs_phone_numbers | Mapped phone numbers for inbound AI calls. |
integration | Tenant platform credentials (Shopify / WooCommerce / Calendly / Google / GHL Calendar). |
rag_products | Synced ecommerce products with embeddings. |
Redis — cross-service (shared infra, not shared data)
Isolated instances/keys per service (redis-backend, redis-communication, redis-sessions).
| Use | Where |
|---|
| Socket.IO adapter (multi-pod fan-out) | All sockets |
| Cache (subscription gate, CRM enrichment) | Backend, ms-ai |
| Rate limiting | ms-communication call/message limiters |
| Session storage | Backend auth |
| Visitor presence registry | ms-sessions (powers knox_presence) |
| BullMQ queues | ms-sessions analysis worker, ms-ai fact-extraction + embedding workers |
Firestore — ms-communication
| Use | What |
|---|
| Real-time chat/call state | Each socket subscribes to /rooms/{room_id}/messages; SocketService keeps Firestore + Socket.IO in sync. Twilio WebRTC call tracking. |
S3 — object storage
| Use | Where |
|---|
| 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:
| Want | Join |
|---|
| Sessions for a person | people._id → person_profiles.person_id (per tenant) → user_sessions.person_id |
| Chats for a person | people._id → person_profiles.person_id → chats.person_id |
| Recording for a session | user_sessions.widget_user_session_id ← session_files.user_session_id (then session_files._id = file_id) |
| Analysis for a recording | session_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 check | people.match_keys contains sha256(normalized_email) |
| Booking attribution | bookings.user_session_id → user_sessions → full journey |