Skip to content

An AI-powered conversational agent that represents Hariprasad Bantwal, providing an interactive chat interface for website visitors. Built with OpenAI GPT-4, Gradio, and PDF processing capabilities. Features lead capture, real-time notifications, and professional career representation.

License

Notifications You must be signed in to change notification settings

paihari/syntropAI-Insight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

syntropAI-Insight

An intelligent conversational AI agent that serves as a digital representative for Hariprasad Bantwal, a senior IT professional with 20+ years of experience in cloud infrastructure, enterprise architecture, and financial services platforms.

πŸš€ Live Demo

Try the AI Agent Live: Chat with Hariprasad Bantwal

The application is deployed on Hugging Face Spaces and ready for interaction!

πŸ“‹ Overview

syntropAI-Insight is a sophisticated AI-powered personal assistant that creates an interactive chat experience for website visitors. Built with OpenAI's GPT-4o-mini and Gradio, it provides intelligent responses about professional experience, skills, and background while capturing leads and tracking unanswered questions for continuous improvement.

Key Capabilities

  • πŸ€– Intelligent Conversation: Natural language processing powered by OpenAI GPT-4o-mini
  • πŸ“„ Knowledge Integration: Automatically extracts and processes information from LinkedIn PDF profiles
  • πŸ”§ Tool-Based Architecture: Function calling for structured data collection and lead capture
  • πŸ“± Real-time Notifications: Pushover integration for instant interaction alerts
  • 🎯 Lead Management: Automatic recording of interested visitors and their contact information
  • πŸ“Š Analytics: Tracks and records unanswered questions for knowledge base expansion

Features

  • Gradio Chat Interface: Modern, user-friendly web-based chat UI
  • PDF Document Processing: Automatically extracts text from LinkedIn PDF profiles
  • Tool-based Functionality: Uses OpenAI function calling for structured data collection
  • Push Notifications: Real-time alerts via Pushover for new interactions
  • Environment-based Configuration: Secure API key and token management

Agent Design

Core Architecture

The agent is built around a Me class that encapsulates the personality and capabilities of Hariprasad Bantwal:

class Me:
    def __init__(self):
        # Initialize OpenAI client
        # Load LinkedIn profile from PDF
        # Load personal summary

πŸ—οΈ Architecture

System Architecture Diagram

graph TB
    subgraph "Client Layer"
        UI[Gradio Web Interface]
        User[Website Visitors]
    end
    
    subgraph "Application Layer"
        Me[Me Class - AI Agent]
        SystemPrompt[System Prompt Manager]
        ToolHandler[Tool Call Handler]
    end
    
    subgraph "External Services"
        OpenAI[OpenAI GPT-4o-mini API]
        Pushover[Pushover Notification API]
    end
    
    subgraph "Data Sources"
        LinkedIn[LinkedIn PDF Profile]
        Summary[Personal Summary]
        Env[Environment Variables]
    end
    
    subgraph "Function Tools"
        RecordUser[record_user_details]
        RecordQuestion[record_unknown_question]
    end
    
    User --> UI
    UI --> Me
    Me --> SystemPrompt
    Me --> OpenAI
    Me --> ToolHandler
    
    SystemPrompt --> LinkedIn
    SystemPrompt --> Summary
    SystemPrompt --> Env
    
    ToolHandler --> RecordUser
    ToolHandler --> RecordQuestion
    RecordUser --> Pushover
    RecordQuestion --> Pushover
    
    OpenAI --> Me
    Me --> UI
    UI --> User
Loading

Component Flow

sequenceDiagram
    participant User
    participant Gradio as Gradio Interface
    participant Agent as Me Class
    participant OpenAI as OpenAI API
    participant Tools as Function Tools
    participant Pushover as Pushover API
    
    User->>Gradio: Send message
    Gradio->>Agent: chat(message, history)
    
    Agent->>Agent: Load system prompt with knowledge base
    Agent->>OpenAI: Send conversation with tools
    
    alt Tool call required
        OpenAI->>Agent: Response with tool_calls
        Agent->>Tools: Execute tool (record_user_details or record_unknown_question)
        Tools->>Pushover: Send notification
        Pushover->>Tools: Confirmation
        Tools->>Agent: Tool result
        Agent->>OpenAI: Continue conversation with tool results
    end
    
    OpenAI->>Agent: Final response
    Agent->>Gradio: Return message
    Gradio->>User: Display response
Loading

Layered Architecture

The system follows a clean layered architecture pattern:

  1. Presentation Layer: Gradio web interface for user interactions
  2. Application Layer: Core AI agent logic and conversation management
  3. Service Layer: External API integrations (OpenAI, Pushover)
  4. Data Layer: Knowledge base and configuration management

πŸ› οΈ Technical Stack

Component Technology Purpose
Runtime Python 3.12+ Core application logic
AI/LLM OpenAI GPT-4o-mini Natural language processing and conversation
Web Framework Gradio 5.36.2 Interactive web interface
PDF Processing PyPDF2 3.0.1 LinkedIn profile text extraction
Notifications Pushover API Real-time interaction alerts
Configuration python-dotenv Environment variable management
Deployment Hugging Face Spaces Cloud hosting platform

πŸ“ Project Structure

syntropAI-Insight/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.py              # Main application entry point
β”‚   β”œβ”€β”€ me/
β”‚   β”‚   β”œβ”€β”€ linkedin.pdf     # LinkedIn profile source
β”‚   β”‚   └── summary.txt      # Personal summary and background
β”‚   └── requirements.txt     # Package dependencies
β”œβ”€β”€ test/                    # Test files (if any)
β”œβ”€β”€ pyproject.toml          # Project configuration and dependencies
β”œβ”€β”€ requirements.txt        # Generated dependency lock file
β”œβ”€β”€ compose-dev.yaml        # Docker development environment
β”œβ”€β”€ LICENSE                 # Project license
└── README.md              # This file

Knowledge Base

The agent's knowledge comes from two primary sources:

  1. LinkedIn Profile PDF: Automatically extracted text from ./me/linkedin.pdf
  2. Personal Summary: Curated background information from ./me/summary.txt

System Prompt Design

The agent uses a carefully crafted system prompt that:

  • Establishes the AI's role as Hariprasad Bantwal
  • Provides context about the website interaction purpose
  • Includes the knowledge base content
  • Sets professional and engaging communication guidelines

Tool Integration

The agent has access to two specialized tools:

1. User Details Recording (record_user_details)

  • Purpose: Capture interested visitors' contact information
  • Parameters: email, name, notes
  • Trigger: When users show interest in getting in touch

2. Unknown Question Recording (record_unknown_question)

  • Purpose: Track questions the agent cannot answer
  • Parameters: question
  • Trigger: When the agent encounters questions outside its knowledge scope

Conversation Flow

  1. Initialization: Agent loads profile data and establishes system context
  2. Message Processing: Each user message is processed through the OpenAI API
  3. Tool Execution: If function calls are needed, tools are executed and results returned
  4. Response Generation: Final response is generated and displayed to the user
  5. Notification: Relevant interactions trigger push notifications

Error Handling

  • Unknown Questions: Automatically recorded for human review
  • Tool Failures: Graceful degradation with fallback responses
  • API Issues: Robust error handling for OpenAI API calls

πŸš€ Setup & Installation

Prerequisites

  • Python 3.12 or higher
  • OpenAI API key
  • Pushover account (for notifications)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/syntropAI-Insight.git
    cd syntropAI-Insight
  2. Install dependencies using uv (recommended):

    uv pip install -r requirements.txt

    Or using pip:

    pip install -r requirements.txt
  3. Configure environment variables: Create a .env file in the project root:

    OPENAI_API_KEY=your_openai_api_key_here
    PUSHOVER_TOKEN=your_pushover_app_token
    PUSHOVER_USER=your_pushover_user_key
  4. Prepare knowledge base:

    • Place your LinkedIn profile PDF at src/me/linkedin.pdf
    • Create or update src/me/summary.txt with your personal summary
  5. Run the application:

    python src/main.py

The Gradio interface will launch and be available at http://localhost:7860

Docker Development

For development with Docker:

docker-compose -f compose-dev.yaml up

πŸ’» Usage

The application launches a Gradio web interface where visitors can:

  • Ask questions about professional background and experience
  • Learn about skills, certifications, and expertise areas
  • Get in touch by providing their contact information
  • Receive intelligent, contextual responses in real-time
  • Experience natural conversation flow with follow-up questions

Example Interactions

Visitor: "What's your experience with cloud architecture?" AI Agent: Provides detailed response based on LinkedIn profile and summary

Visitor: "I'd like to discuss a potential collaboration" AI Agent: Engages and asks for contact details using the record_user_details tool

πŸ”§ Customization

Adapting for Your Own Use

To customize this agent for yourself:

  1. Update Knowledge Base:

    • Replace src/me/linkedin.pdf with your LinkedIn profile export
    • Modify src/me/summary.txt with your professional background
    • Update the name in src/main.py line 83: self.name = "Your Name"
  2. Customize System Prompt:

    • Modify the system_prompt() method in the Me class (src/main.py:105-116)
    • Adjust the tone, focus areas, and conversation style
  3. Extend Functionality:

    • Add new tools by creating functions and JSON schemas
    • Integrate additional data sources (databases, APIs, etc.)
    • Enhance notification systems or add analytics

Configuration Options

The agent behavior can be modified through:

  • Environment variables for API keys and settings
  • System prompt customization for personality and expertise focus
  • Tool definitions for additional capabilities
  • Knowledge base updates for domain-specific information

πŸ“‘ API Reference

Core Classes

Me Class

The main agent class that handles conversation logic.

Methods:

  • __init__(): Initializes OpenAI client and loads knowledge base
  • system_prompt(): Generates dynamic system prompt with knowledge base
  • chat(message, history): Main conversation handler
  • handle_tool_call(tool_calls): Executes function tools

Function Tools

record_user_details(email, name, notes)

Records visitor contact information and sends notification.

Parameters:

  • email (required): User's email address
  • name (optional): User's name
  • notes (optional): Additional context about the interaction

record_unknown_question(question)

Logs questions that couldn't be answered for knowledge base expansion.

Parameters:

  • question (required): The unanswered question

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Guidelines

  • Follow Python PEP 8 style guidelines
  • Add docstrings for new functions and classes
  • Test with various conversation scenarios
  • Ensure proper error handling for API calls
  • Update documentation for new features

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • OpenAI for the GPT-4o-mini API
  • Gradio team for the excellent web interface framework
  • Pushover for reliable notification services
  • Hugging Face for seamless deployment platform

Built with ❀️ by Hariprasad Bantwal - Senior IT Professional & Cloud Architect

About

An AI-powered conversational agent that represents Hariprasad Bantwal, providing an interactive chat interface for website visitors. Built with OpenAI GPT-4, Gradio, and PDF processing capabilities. Features lead capture, real-time notifications, and professional career representation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages