Skip to content

amrs-tech/DeciSentient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeciSentient — Autonomous Web Shopping & Travel Decision Agent

An AI-powered decision intelligence platform that autonomously browses the web to find the best products and travel options, analyzes reviews, and presents actionable recommendations through an interactive dashboard with blog publishing capabilities.

Architecture

┌─────────────────────────────────────────────────────┐
│                  Next.js Frontend                    │
│  Search Input │ Activity Log │ Charts │ Blog Publish  │
└──────────────────────┬──────────────────────────────┘
                       │ SSE + REST
┌──────────────────────┴──────────────────────────────┐
│                  Express Backend                     │
│  Query Parser │ Plan Generator │ Blog Publisher     │
└───────┬────────────────────────────────┬────────────┘
        │                                │
┌───────┴───────────┐    ┌──────────────┴─────────────┐
│  TinyFish Agent   │    │     Gemini AI Analysis      │
│  Web Browsing     │    │     Review Sentiment         │
│  Data Extraction  │    │     Query Parsing            │
└───────────────────┘    └────────────────────────────┘

Tech Stack

  • Frontend: Next.js 14, React, TailwindCSS, Recharts, Lucide Icons
  • Backend: Node.js, Express
  • Agent: TinyFish Web Agent API (real web browsing)
  • AI: Google Gemini API (review analysis)
  • Voice: ElevenLabs API (text-to-speech)
  • Blog: Custom blog integration with API publishing
  • Communication: Server-Sent Events (SSE) for real-time updates

Features

Core Search & Analysis

  • Natural language query input (products & travel)
  • Autonomous web browsing via TinyFish (Amazon, Flipkart, MakeMyTrip, Skyscanner)
  • Real-time agent activity log with SSE streaming
  • AI-powered review sentiment analysis (Comfort, Durability, Value)
  • Smart recommendation engine (Best Value, Best Rated, Cheapest, Recommended)
  • Interactive price comparison bar chart
  • Detailed comparison table with pros/cons
  • "Go to Product Page" buttons for every item
  • Voice search and text-to-speech capabilities

Blog Publishing

  • Smart Cascade Publishing: Automatically tries TinyFish → API → Content-only
  • API Publishing: Direct blog API integration (no credits required)
  • TinyFish Publishing: Automated blog posting via web automation
  • Content Generation: AI-powered article creation for manual publishing
  • Real-time publishing progress with SSE updates
  • Support for multiple publishing strategies

Security & Environment

  • Secure environment variable management
  • No hardcoded secrets or API keys
  • Comprehensive .gitignore for sensitive files
  • Separate frontend/backend environment configurations

Setup

Prerequisites

1. Environment Configuration

Copy .env.example to .env and configure your credentials:

# Gemini AI API Configuration
GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_MODEL=gemini-3.1-flash-lite-preview

# TinyFish Agent API Configuration
TINYFISH_API_KEY=your_tinyfish_api_key_here

# ElevenLabs API Configuration (for voice features)
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here

# Server Configuration
PORT=3001

# Blog Publishing Configuration (optional)
BLOG_USERNAME=your_blog_username_here
BLOG_PASSWORD=your_blog_password_here
BLOG_PUBLISHING_STRATEGY=cascade
BLOG_API_KEY=your_blog_api_key_here
BLOG_API_URL=https://your-blog-url.com

# Frontend Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_BLOG_URL=https://your-blog-url.com

2. Install Dependencies

# Backend
cd backend
npm install

# Frontend
cd ../frontend
npm install

3. Run the Application

# Terminal 1 — Backend
cd backend
npm run dev

# Terminal 2 — Frontend
cd frontend
npm run dev

Example Queries

Query Category
"Best trekking shoes under ₹4000" Product
"Best backpack under ₹3000" Product
"Cheapest flight Chennai to Delhi tomorrow" Travel
"Best kitchen knife under ₹2000" Product
"Laptops under 50000 on Amazon" Product (specific store)

Blog Publishing

The application supports multiple blog publishing strategies:

Smart Cascade (Default)

  1. TinyFish First: Automated blog posting via web automation
  2. API Fallback: Direct API publishing if TinyFish fails
  3. Content-Only: Generate article for manual publishing

API Only

  • Direct blog API integration
  • No credits required
  • Fully automated

TinyFish Only

  • Web automation publishing
  • Uses TinyFish credits
  • Full automation

Content Only

  • Generate AI-powered articles
  • Manual publishing required
  • No API dependencies

API Endpoints

Method Endpoint Description
POST /api/search Start a new search
GET /api/search/:id/stream SSE stream for real-time updates
GET /api/search/:id Get search results (polling)
POST /api/blog/publish Start blog publishing
GET /api/blog/:id/stream Blog publishing SSE stream
GET /api/health Health check

Environment Variables

Backend Variables

  • GEMINI_API_KEY: Google Gemini API key for AI analysis
  • GEMINI_MODEL: Gemini model to use (default: gemini-3.1-flash-lite-preview)
  • TINYFISH_API_KEY: TinyFish web agent API key
  • ELEVENLABS_API_KEY: ElevenLabs API key for voice features
  • PORT: Backend server port (default: 3001)
  • BLOG_USERNAME: Blog admin username
  • BLOG_PASSWORD: Blog admin password
  • BLOG_PUBLISHING_STRATEGY: Publishing strategy (cascade/api/tinyfish/content-only)
  • BLOG_API_KEY: Blog API key for direct publishing
  • BLOG_API_URL: Base URL of blog API

Frontend Variables

  • NEXT_PUBLIC_API_URL: Backend API URL
  • NEXT_PUBLIC_BLOG_URL: Base URL of blog for frontend links

Security

  • ✅ No hardcoded API keys or secrets
  • ✅ Environment-based configuration
  • ✅ Comprehensive .gitignore for sensitive files
  • ✅ Separate development and production configurations
  • ✅ Secure credential handling for blog publishing

Demo Mode

If TinyFish API key is not configured, the system automatically falls back to built-in demo data so the full UI and recommendation engine can be demonstrated without live web scraping.

Project Structure

DeciSentient/
├── .env                          # Environment variables (gitignored)
├── .env.example                  # Environment variables template
├── .gitignore                    # Git ignore rules
├── README.md
├── backend/
│   ├── package.json
│   └── src/
│       ├── index.js              # Express server entry
│       ├── routes/
│       │   ├── search.js         # Search API routes + SSE
│       │   ├── blog.js           # Blog publishing routes
│       │   ├── voice.js          # Voice features
│       │   └── download.js       # Excel export
│       ├── agent/
│       │   ├── tinyfishAgent.js  # TinyFish web agent integration
│       │   ├── geminiAnalyzer.js # Gemini AI review analysis
│       │   └── blogPublisher.js  # Blog publishing logic
│       ├── engine/
│       │   └── recommendation.js # Scoring & recommendation engine
│       ├── utils/
│       │   ├── queryParser.js    # NL query parsing
│       │   └── planGenerator.js  # Browsing plan generation
│       └── data/
│           └── demoData.js       # Fallback demo datasets
└── frontend/
    ├── package.json
    ├── next.config.js
    ├── tailwind.config.js
    ├── postcss.config.js
    ├── app/
    │   ├── layout.js
    │   ├── globals.css
    │   └── page.js               # Main dashboard page
    └── components/
        ├── Header.js
        ├── SearchInput.js
        ├── BrowsingPlan.js
        ├── AgentActivityLog.js
        ├── RecommendationCard.js
        ├── PriceComparisonChart.js
        ├── ReviewSentimentPanel.js
        ├── ComparisonTable.js
        ├── PublishToBlog.js       # Blog publishing component
        └── VoiceSearch.js         # Voice search component

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Ensure all environment variables are properly configured
  5. Test carefully and verify
  6. Submit a pull request

About

DeciSentient -- Autonomous Shop/Travel Decision Agent

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages