Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sav6 - AI-Powered Chat Agent with Workflow Builder

A sophisticated data engineering and analytics platform featuring an AI chat agent that can create workflows, analyze data, and automate business processes.

πŸš€ Features

Chat Agent

  • Mission-Critical Accuracy Mode - Never guesses or assumes, always verifies
  • Four Operational Modes:
    • 🌟 Planning - Strategic thinking and approach planning
    • πŸ”¨ Building - Create workflows, datasets, and artifacts
    • πŸ“Š Analyzing - Data analysis and insights
    • ▢️ Running - Execute existing workflows
  • Streaming Responses with Server-Sent Events (SSE)
  • File Upload Support for data analysis
  • Conversation Persistence with SQLite
  • Policy Enforcement - Mandatory, not optional

Workflow Builder

  • Visual Graph Editor with React Flow
  • 17 Node Types from SAV system:
    • Filter, Dedupe, Summarize, Join
    • Pivot, Unpivot, Transform, Time Series
    • Upload, Destination, Bot, Add
    • External connectors (Airtable, GitHub, Facebook, Atlassian)
  • Agent-Generated Workflows - Chat creates workflows automatically
  • Save/Load to SQLite database

Tech Stack

  • Frontend: React 19, Tailwind CSS 4, React Flow, Lucide Icons
  • Backend: Express.js, TypeScript, sql.js (pure JavaScript SQLite)
  • AI: Google Gemini API with streaming
  • Database: SQLite with full schema for workflows, conversations, logs

πŸ“¦ Installation

cd sav6
npm install

βš™οΈ Configuration

Option 1: Environment Variable

Create .env.local:

GEMINI_API_KEY=your_api_key_here

Option 2: Settings UI

  1. Start the application
  2. Navigate to Settings
  3. Enter your Gemini API key
  4. Click Save

Get your API key from Google AI Studio

🎯 Usage

Start Development Servers

Option A: Run both together (Recommended)

npm run dev:all

Option B: Run separately

Terminal 1 - Frontend:

npm run dev

Terminal 2 - Backend:

npm run server

Access the Application

πŸ’¬ Using the Chat Agent

  1. Navigate to Chat (first item in left navigation)
  2. Select a mode: Planning, Building, Analyzing, or Running
  3. Ask questions or describe what you need:
    • "Create a workflow to filter customer data from California"
    • "Analyze sales trends for Q1 2024"
    • "Set up a data pipeline for customer segmentation"
  4. Upload files for data analysis
  5. Agent will:
    • Ask clarifying questions
    • Create workflows with proper node configurations
    • Generate datasets and markdown documentation
    • Provide mission-critical, accurate responses

πŸ”§ API Endpoints

Chat

  • POST /api/chat/message - Send message with streaming response
  • GET /api/chat/history/:conversationId - Get conversation history
  • GET /api/chat/conversations - List all conversations

Workflows

  • GET /api/workflow - List all workflows
  • GET /api/workflow/:id - Get workflow details
  • POST /api/workflow - Create workflow
  • PUT /api/workflow/:id - Update workflow
  • DELETE /api/workflow/:id - Delete workflow

Upload

  • POST /api/upload - Upload single file
  • POST /api/upload/multiple - Upload multiple files

Settings

  • GET /api/settings - Get all settings
  • GET /api/settings/:key - Get specific setting
  • POST /api/settings - Set setting
  • DELETE /api/settings/:key - Delete setting

πŸ“ Project Structure

sav6/
β”œβ”€β”€ server/               # Express backend
β”‚   β”œβ”€β”€ index.ts         # Server entry point
β”‚   β”œβ”€β”€ database.ts      # SQLite database
β”‚   β”œβ”€β”€ routes/          # API routes
β”‚   β”‚   β”œβ”€β”€ chat.ts      # Chat endpoints
β”‚   β”‚   β”œβ”€β”€ workflow.ts  # Workflow CRUD
β”‚   β”‚   β”œβ”€β”€ upload.ts    # File uploads
β”‚   β”‚   └── settings.ts  # Settings management
β”‚   └── services/        # Business logic
β”‚       β”œβ”€β”€ llm.ts       # Gemini integration
β”‚       └── prompts.ts   # System prompts
β”œβ”€β”€ src/                 # React frontend
β”‚   └── views/           # Page components
β”‚       β”œβ”€β”€ Chat.tsx     # Chat interface
β”‚       └── Settings.tsx # Settings page
β”œβ”€β”€ data/                # Runtime data
β”‚   β”œβ”€β”€ database.sqlite  # SQLite database
β”‚   └── uploads/         # Uploaded files
└── md-library/          # Policy/skills/knowledge

πŸ—„οΈ Database Schema

Tables

  • workflows - Workflow metadata
  • nodes - Workflow nodes with configs
  • edges - Node connections
  • conversations - Chat conversation metadata
  • chat_messages - Individual messages
  • execution_logs - Workflow execution history
  • settings - API keys and configuration

🎨 Design Philosophy

  • Swiss Minimalism - Clean, grid-based layouts
  • Brand Color: #6453FF (Savant Purple)
  • Mission-Critical UX - No ambiguity, always clear
  • Progressive Disclosure - Show complexity when needed
  • Workflow-First - Everything revolves around workflows

πŸ› οΈ Development

Type Checking

npm run lint

Build for Production

npm run build

Clean Build Artifacts

npm run clean

πŸ“ Use Cases

  1. One-off Requests - Quick data analysis via chat
  2. Exploration - Discover patterns and insights
  3. First Deliverable - Create initial workflows
  4. Repeat Workflows - Save and reuse workflows
  5. Full Automation - Schedule and monitor workflows
  6. Documentation - Generate MD files for processes

πŸ› Troubleshooting

Port Already in Use

Change ports in:

  • Frontend: vite.config.ts (default: 3000)
  • Backend: server/index.ts (default: 3001)

Database Errors

Ensure data directory exists:

mkdir -p data/uploads

API Key Not Working

  1. Verify key in Settings page
  2. Check browser console for errors
  3. Ensure backend server is running
  4. Test with /api/health endpoint

πŸ“– Learn More

🀝 Contributing

This is a proof-of-concept for the Savant Labs platform. The system demonstrates:

  • AI-powered workflow generation
  • Mission-critical agent behavior
  • Real-time streaming chat
  • Visual workflow editing
  • Local-first data storage

πŸ“„ License

Proprietary - Savant Labs


Built with ❀️ for Data Engineers and Analytics Teams

About

SAV6 - FinOps Tax Operations application

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages