tenzor-insights
v1.1.0
Published
Production-ready Node.js package to analyze structured activity logs and generate intelligent business insights using LLM APIs.
Downloads
523
Maintainers
Readme
🚀 Tenzor Insights
Turn raw data into business intelligence — instantly.
Tenzor Insights is an AI-powered business intelligence engine for CRM, ERP, and any structured data system.
It transforms activity logs, historical reports, and arbitrary JSON datasets into actionable insights, trend analyses, and decision-ready summaries — powered by OpenAI, Gemini, and Claude.
✨ Features
| Feature | Description | |---|---| | 🧠 AI-Powered Analysis | Transforms raw logs into executive-level business insights | | 📊 Trend Intelligence | Compares reports across time to detect business direction | | 🔀 Hybrid Intelligence | Analyzes any structured JSON data without a predefined schema | | ⚠️ Risk Detection | Identifies anomalies, bottlenecks, and data quality issues | | 📈 Growth Signals | Surfaces pipeline movement, conversions, and stagnation signals | | 🤖 Multi-Provider | Supports OpenAI (GPT), Google Gemini, and Anthropic Claude | | 🧩 Variant Modes | ADVISOR, OPERATOR, and EXECUTIVE analytical perspectives |
🧠 Modes
Tenzor Insights operates in three intelligent modes. Choose the one that fits your use case.
1. 📋 Analysis Mode
Analyze structured activity logs and generate business intelligence reports.
import { analyzeLogs } from "tenzor-insights";
const report = await analyzeLogs({
mode: "ANALYSIS",
provider: "gemini",
apiKey: process.env.API_KEY,
model: "gemini-2.0-flash",
variant: "ADVISOR", // "ADVISOR" | "OPERATOR" | "EXECUTIVE"
logs: [ /* your activity logs array */ ],
limit: 200 // optional — default: 200
});What you get: Summary, priority scores, business impact, growth signals, risks, AI suggestions, notable users, trend indicators, and an executive insight.
2. 🔁 Compare Mode
Compare multiple time-period reports to detect business trends and direction.
import { analyzeLogs } from "tenzor-insights";
const report = await analyzeLogs({
mode: "COMPARE",
provider: "gpt",
apiKey: process.env.OPENAI_API_KEY,
model: "gpt-4.1-mini",
variant: "EXECUTIVE",
reports: [
{ period: { startDate: "2026-03-01", endDate: "2026-03-07" }, report: { /* week 1 report */ } },
{ period: { startDate: "2026-03-08", endDate: "2026-03-14" }, report: { /* week 2 report */ } }
]
});What you get: Trend analysis across periods, improvements, declines, persistent issues, new risks, business trajectory verdict, confidence score, and recommendations.
3. 🔀 Hybrid Mode
Analyze any structured JSON dataset — no schema required.
Tenzor Insights will automatically infer the domain, detect entities and patterns, identify anomalies, and generate targeted business or operational insights.
import { analyzeLogs } from "tenzor-insights";
const report = await analyzeLogs({
mode: "HYBRID",
provider: "gemini",
apiKey: process.env.API_KEY,
model: "gemini-2.0-flash",
data: [ /* any JSON array or object */ ],
contextHint: "Optional: brief description of what this data represents"
});What you get: Detected domain, entity map, key insights, patterns, time-based trends, anomalies, recommendations, data quality score, and a confidence score.
How Hybrid Intelligence Works
Hybrid mode executes a 5-phase intelligence pipeline internally:
Phase 1 → Understand the dataset (entities, fields, relationships)
Phase 2 → Infer the domain (sales, operations, HR, finance, marketing …)
Phase 3 → Detect patterns, time trends, growth/decline, and anomalies
Phase 4 → Generate high-quality, data-specific insights and recommendations
Phase 5 → Assign a confidence score (0.0 – 1.0) based on data richnessSupported domains detected automatically: sales · operations · hr · finance · marketing · product · logistics · general · unknown
💡
contextHintis optional but helps the engine orient faster. If the hint conflicts with the actual data structure, the engine will override it and explain the discrepancy.
📦 Installation
npm install tenzor-insights⚙️ Configuration
| Option | Type | Required | Description |
|---|---|---|---|
| mode | string | ✅ | "ANALYSIS" | "COMPARE" | "HYBRID" |
| provider | string | ✅ | "gpt" | "gemini" | "claude" |
| apiKey | string | ✅ | API key for the chosen provider |
| model | string | ✅ | Model name (e.g. "gpt-4.1-mini", "gemini-2.0-flash") |
| variant | string | ❌ | "ADVISOR" | "OPERATOR" | "EXECUTIVE" — default: "ADVISOR" |
| logs | array | ⚠️ | Required for ANALYSIS mode |
| limit | number | ❌ | Max logs to process in ANALYSIS mode — default: 200 |
| reports | array | ⚠️ | Required for COMPARE mode |
| data | any | ⚠️ | Required for HYBRID mode — any JSON array or object |
| contextHint | string | ❌ | Optional domain hint for HYBRID mode |
📥 Sample Input
Analysis Mode
[
{
"action": "CREATE",
"entity": "lead",
"timestamp": "2026-03-01T10:00:00Z",
"actor": { "name": "John", "role": "Sales" }
},
{
"action": "UPDATE",
"entity": "quote",
"timestamp": "2026-03-01T11:30:00Z",
"actor": { "name": "Ali", "role": "Sales" }
}
]Hybrid Mode
Pass any structured dataset — the engine figures out the rest:
[
{ "order_id": "1001", "customer": "Jane", "total": 299.00, "status": "shipped", "created_at": "2026-03-01" },
{ "order_id": "1002", "customer": "Mark", "total": 149.50, "status": "pending", "created_at": "2026-03-02" }
]📤 Sample Output
Analysis Mode Output
{
"summary": "Low system activity detected with only 3 actions recorded, indicating potential sales stagnation.",
"priorityScore": { "growth": 7, "risk": 2, "operations": 6 },
"keyHighlights": [
"One new lead created — positive pipeline signal.",
"One quote updated — progress in an existing deal."
],
"businessImpact": [
"Extremely low activity volume suggests a bottleneck in the sales pipeline."
],
"growthSignals": ["New lead created — potential future conversion."],
"risksOrConcerns": [
{ "issue": "Critically low activity across all users.", "severity": "MEDIUM" }
],
"aiSuggestions": [
{ "suggestion": "Investigate reasons for low system engagement.", "priority": "HIGH" }
],
"ownerFocus": ["Drive consistent team utilization across all pipeline stages."],
"notableUsers": ["Ali: 2 of 3 actions — single-user dependency risk."],
"metrics": { "actionsCount": 3, "activeUsers": 2 },
"trend": {
"activityLevel": "LOW",
"growthDirection": "STABLE",
"riskLevel": "MEDIUM",
"operationalHealth": "UNSTABLE"
},
"executiveInsight": "Current low activity levels present a direct risk to revenue growth if left unaddressed."
}Hybrid Mode Output
{
"detectedDomain": "operations",
"summary": "Dataset contains 1 order record spanning a medical e-commerce workflow. The order lifecycle is complete but abnormal re-engagement after 77 days and late-stage marketing removal events are key concerns.",
"entities": [
{
"type": "order",
"count": 1,
"keyFields": ["order_id", "order_total", "shipping_country"],
"notes": "Single order with full lifecycle tracked via nested timeline."
}
],
"keyInsights": [
{
"insight": "Order completed full lifecycle from checkout to shipment within 4 days — efficient fulfillment.",
"category": "operational"
},
{
"insight": "Customer re-engaged 77 days post-shipment, triggering marketing removal — churn signal.",
"category": "business"
}
],
"patternsDetected": [
{ "pattern": "Repeated member logins within short windows suggest engagement but possible confusion.", "significance": "MEDIUM" }
],
"trends": {
"hasTimestamps": true,
"timeRange": "2026-01-18 to 2026-04-07",
"direction": "STABLE",
"peakPeriod": "2026-01-20",
"notes": "Most activity concentrated in first 4 days; long gap before customer re-engagement."
},
"anomalies": [
{ "description": "ORDER_WELCOME_SMS sent with null order_id — broken event linkage.", "severity": "HIGH", "affectedRecords": 1 }
],
"recommendations": [
{
"action": "Fix null order_id in SMS events to ensure accurate tracking.",
"priority": "HIGH",
"rationale": "Broken event linkage compromises downstream analytics and customer communication attribution."
}
],
"metrics": { "totalRecords": 1, "timelineEvents": 33 },
"dataQuality": { "score": 0.72, "issues": ["Null order_id in 2 external events", "Empty reference_id fields"] },
"confidence": 0.78
}🤖 Supported Providers
| Provider | Parameter | Example Models |
|---|---|---|
| OpenAI | "gpt" or "openai" | gpt-4.1, gpt-4.1-mini, gpt-4o |
| Google Gemini | "gemini" | gemini-2.0-flash, gemini-1.5-pro |
| Anthropic Claude | "claude" | claude-3-5-sonnet, claude-3-haiku |
🎯 Use Cases
| Mode | Use Case | |---|---| | ANALYSIS | CRM log analysis, ERP activity monitoring, sales pipeline review, team performance tracking | | COMPARE | Week-over-week trend reporting, sprint retrospectives, monthly business reviews | | HYBRID | Order intelligence, support ticket analysis, logistics monitoring, HR data review, any custom JSON dataset |
🚀 Why Tenzor Insights?
Most analytics tools show you data. Tenzor Insights tells you what it means.
| Without Tenzor Insights | With Tenzor Insights | |---|---| | Raw logs | Executive-ready insights | | Numbers | Business context | | Activity data | Growth signals & risk flags | | Unknown JSON | Auto-detected domain intelligence |
🛣️ Roadmap
- 🔮 Predictive insights and forecasting
- 📊 Dashboard & BI tool integrations
- ⚡ Real-time alerting
- 📅 Scheduled intelligence reports (weekly / monthly)
- 🔗 Native CRM connectors (Salesforce, HubSpot)
📄 License
ISC © Greyloops
