######Imports import os from openai import OpenAI import gradio as gr import chromadb import uuid from pprint import pprint import json import requests import random ######Setup OPENAI_API_KEY=os.getenv("OPENAI_API_KEY") if OPENAI_API_KEY is None: raise Exception("API Key is missing") client = OpenAI() history = "" ######Document document_professional_profile_Sumtotal = """ # Detailed Work Experience Narrative ## Sr. Manager, Engineering **SumTotal Systems/Cornerstone OnDemand, Gainesville, FL** **January 2025 – April 2026** In my current role as Senior Manager of Engineering, I have taken on significant architectural leadership responsibilities for our cloud-native web application, designing and implementing robust solutions across enterprise authentication, authorization with role-based access control (RBAC), session management, localization, and other critical core framework functionalities used across our product's integrated modules. A major initiative involved providing comprehensive technical and process guidance to our mobile application team, directing the development of a new version of the SumTotal mobile application built with React Native to ensure seamless integration with backend services and customer-focused delivery. I have built and led multiple high-performing engineering teams comprising 14 or more engineers with diverse experience levels distributed across various time zones. My leadership responsibilities have included hiring and firing decisions, organization-level team restructuring, and regular one-on-one performance reviews. A particular focus has been transforming underperforming teams into high-impact units through consistent feedback and rigorous enforcement of best practices and standardized SDLC processes. I have maintained strict adherence to project timelines through well-defined standards, policies, and Agile methodologies using tools like JIRA and Dragonboat. Throughout different development stages, I have held multiple concurrent roles including Product Owner, Project Manager, Train Architect, Scrum Master, and Developer, leveraging capacity planning tools, dependency identification techniques, and comprehensive documentation practices. One of my key achievements has been leading process and architectural improvements that increased delivery efficiency by 10 to 15 percent per release cycle through enhanced platform design, architectural refactoring to identify bottlenecks, and strategic third-party library upgrades. My strategic work involved defining and executing a future-state architecture strategy aligned with business goals and scalable technology platforms, establishing a technical vision for highly available, low-latency distributed systems and complex third-party and API-driven integrations. I collaborated closely with security and platform teams to advocate for organizational and engineering transformation, implementing authentication and access control mechanisms at scale. On the security front, I identified common security issues flagged by third-party analysis teams and modified application flows and features to enhance both application and user data security, reducing our security backlog by 50 percent while maintaining strict SLA timelines. Most innovatively, I designed the architecture for an AI-driven automated error detection and remediation platform leveraging AI Agents, Retrieval-Augmented Generation (RAG), and Large Language Model (LLM) frameworks. I developed Foundation Models trained on domain-specific data to power a system that queries Splunk logs and categorizes them into logical buckets based on feedback loops. This automation has yielded substantial productivity gains, saving developers between 15 and 20 percent of hours previously spent on troubleshooting and Root Cause Analysis (RCA), allowing redirection of those efforts toward meaningful feature development. --- ## Manager, Engineering **SumTotal Systems/Cornerstone OnDemand, Gainesville, FL** **April 2021 - December 2024** As Manager of Engineering, I undertook the architectural design and implementation of a sophisticated microservice-based telemetry platform built using .NET Core, REST APIs, and AWS infrastructure, designed to capture real-time user actions and analyze behavioral patterns across hundreds of thousands of users within our enterprise applications. This third-party integration project created an extensible framework to log user actions based on dynamic configurations and report that data to industry-leading analytics tools such as Amplitude and Google Analytics. I led a team of full-stack developers with varying levels of experience through its development and deployment, with the collected data transformed into actionable reports for sales, product, and executive teams to guide roadmap planning, marketing initiatives, and future product development. During this same period, I designed an extensible architecture to integrate market skills intelligence sourced from Lightcast, a leading labor market analytics provider, to power sophisticated recommendation systems and enable workforce upskilling features. I developed a comprehensive framework using microservice architecture principles with .Net Core, C#, SQL databases, REST APIs, OAuth security protocols, and React to import market skills data based on job titles and descriptions into customer ecosystems. This architectural flexibility demonstrated its value when integrating with SkyHive later—the integration required only minimal updates around configuration and settings, showcasing the long-term benefits of thoughtful design. Another significant project involved enhancing our product's Gamification feature in close collaboration with customers, Product Support, and Product Owners. The goal was to integrate gamification capabilities with retail platforms and loyalty systems to monetize gamification points earned by users completing training and upskilling tasks. I worked extensively with large-scale enterprise customers including Samsung and Walmart to drive engagement and learning across their organizations. I also managed an immersive learning project providing a transformative learning experience within the Metaverse using the Unity framework. Throughout this initiative, I performed dual roles as both Scrum Master and Technical Product Manager, handling resource allocation, capacity planning, design reviews, code reviews, and quality assurance automation initiatives, representing our organization's commitment to exploring emerging technologies and next-generation learning modalities. --- ## Senior Software Engineer **SumTotal Systems, Gainesville, FL** **April 2018 – March 2021** As a Senior Software Engineer, I architected an event-driven session management platform engineered to enable distributed session orchestration across our product's integrated modules. The platform supports single active user sessions by defining granular permissions, establishing security groups, and implementing a publisher-subscriber model using RabbitMQ as our message queue infrastructure. This allowed me to develop a robust framework for consumers to subscribe to relevant events and take necessary actions such as killing cookies and clearing cached user data based on session management requirements. I leveraged Redis as a distributed cache layer to support multiple servers and services, enabling seamless data access and consistency across our distributed architecture. During this period, I developed a comprehensive API Security framework to implement the OAuth protocol as a microservice, significantly improving our application security posture and enabling sophisticated access authentication for both SumTotal web and mobile applications. Built using .Net Core, MongoDB, and REST APIs, the framework utilized the Identity Server 4 library to generate and validate OAuth tokens and supported various implementation standards including Resource Owner Password flows (deprecated), Authorization Code flows, and Client Secret implementations, each chosen based on specific consumer types and integration requirements. My most significant contribution was designing and developing File Management as a Service (FMaaS), a scalable microservice solution that centralized file storage and access management for all product modules. This project decoupled file management from our monolithic architecture, transforming it into a containerized microservice built using .Net and REST APIs. This transition proved instrumental in enabling horizontal scaling within our multi-tenant, cloud-native environment. Throughout the project lifecycle, I proactively identified and managed technical risks, ensuring smooth implementation and deployment. --- ## Software Engineer II **SumTotal Systems, Gainesville, FL** **November 2012 - March 2018** My tenure as Software Engineer II at SumTotal Systems spanned nearly six years, during which I made foundational architectural contributions that shaped the technical direction of our enterprise learning platform. One of my earliest and most impactful projects was designing and developing an SSO Broker platform dedicated to user authentication and authorization within our cloud-native web application. Built with strict adherence to industry-standard security protocols—SAML 2.0, OIDC, and OAuth—I collaborated extensively with cross-functional teams including Product, Customer Success, and DevOps to create comprehensive framework architecture guides, configuration instructions, and setup guides enabling effective platform utilization across teams and customers. Building on this foundation, I led a comprehensive redesign of our application framework using Service-Oriented Architecture principles, MVC frameworks, SOAP and RESTful API patterns, Entity Framework (EF) and LINQ for data access, NHibernate for object-relational mapping, and SQL Server for persistent storage. This redesign shifted from a scattered, feature-based approach to a centralized architecture encompassing Identity and Access Management (IAM), security protocols, session management, role-based access control (RBAC), localization capabilities, and third-party integrations. The framework leveraged a Configuration Management Database (CMDB), Redis for tenant configuration and cache management, and microservices architecture patterns to achieve horizontal scalability and operational resilience. For front-end development, I implemented HTML with AngularJS components and established NUnit for comprehensive unit testing. This architectural transformation marked a pivotal transition, moving our organization from a legacy monolithic framework to a modern, scalable, containerized microservice architecture capable of supporting large-scale enterprise learning systems. These foundational choices established technical patterns and principles that continue to influence our platform architecture today. --- ## Summary Across my tenure at SumTotal Systems spanning over a decade, my career progression has reflected a consistent commitment to architectural excellence, technical leadership, and the delivery of enterprise-scale solutions. From early contributions to foundational platform architecture, through pioneering work on microservice-based solutions and security frameworks, to my current role providing architectural leadership across organization-wide initiatives, I have consistently focused on building scalable systems, fostering high-performing teams, and driving meaningful business impact through thoughtful technical decision-making and strategic execution. """ document_professional_profile_others = """ # Earlier Career Experience ## Software Engineer **Verizon Data Services, Chennai, India** **August 2006 – July 2007** Early in my career at Verizon Data Services, I worked on developing an Email and Fax Automation system, a web-based feature extraction tool designed to streamline communication processes. The system was built using BizTalk for enterprise integration, SQL Server for data management, and implemented with C#, ASP .Net, XML, HTML, and JavaScript. This role introduced me to enterprise-scale systems and the complexities of integrating diverse technologies to deliver functional business solutions. --- ## Software Developer **Infinite Energy, Gainesville, FL** **June 2009 - May 2011** As a Software Developer at Infinite Energy, I expanded my expertise across multiple technology domains. I developed an online enrollment system using ASP .Net that streamlined customer onboarding processes. Alongside this, I designed and developed an upgraded automated billing system called Adept 3 Billing, a more sophisticated version of the company's previous billing infrastructure. This project utilized UML for architecture planning, C# .Net within Visual Studio 2008, SQL Server 2005, LINQ for data querying, ILOG for business logic, NUnit for testing, and both web services and WCF Services for system communication. Beyond these core projects, I gained practical experience with pattern matching for language translation using .Net regular expression classes, enabling automated text processing and localization capabilities. To support broader project development needs, I developed various tools using scripting languages including PHP, Perl, Python, and JavaScript, demonstrating versatility across different technology stacks and the ability to select appropriate tools for specific technical challenges. --- ## Software Consultant **Attunix Inc, Bellevue, WA** **June 2011 – October 2012** At Attunix Inc, I transitioned into a consulting role where I worked directly with multiple clients to understand their requirements and architect custom software solutions tailored to their specific business needs. One notable project involved building CRM application tools for Microsoft Store, leveraging SnapLogic as an integration platform alongside Java and Spring frameworks to create robust customer relationship management capabilities. Another significant engagement was developing an energy analysis application for The Energy Authority (TEA), an organization focused on energy commodity trading. This application was designed to support real-time trading of energy and gas commodities, requiring accurate calculations and timely data processing. The system was developed using VB .Net for business logic, SQL for data persistence, and Excel for reporting and analysis capabilities, enabling traders and analysts to make informed decisions based on market data and historical trends. This consulting experience provided exposure to diverse industry domains and the ability to rapidly understand client ecosystems, technical requirements, and deliver solutions that directly addressed business objectives. --- ## Career Transition to SumTotal Systems In November 2012, I joined SumTotal Systems as a Software Engineer II, marking the beginning of a tenure that would span over a decade and evolve from individual contributor to senior management roles, progressively taking on greater architectural and leadership responsibilities across enterprise learning platforms and cloud-native applications. """ document_education_profile = """ # Education, Certifications, and Research ## Educational Background My formal education began at PSG College of Technology in Coimbatore, India, where I completed a Bachelor of Engineering in Computer Science and Engineering. PSG College of Technology is one of India's premier engineering institutions, known for its rigorous curriculum and emphasis on practical engineering skills. This degree provided a comprehensive foundation in computer science principles, software development, and engineering methodologies that prepared me for early-stage professional roles in the technology industry and established strong fundamentals in computer architecture, algorithms, and software design patterns. Recognizing the value of advanced technical knowledge and research exposure, I pursued a Master of Science in Computer Information Sciences and Engineering at the University of Florida in Gainesville. The University of Florida's graduate program in Computer Information Sciences is research-focused and draws faculty expertise from cutting-edge areas including machine learning, distributed systems, and data science, providing an environment conducive to advancing theoretical knowledge and practical research skills. This advanced degree allowed me to deepen my expertise in specialized areas of computer science and engage in research-oriented academic projects that explored emerging algorithmic approaches and machine learning methodologies, particularly in feature selection and data preprocessing techniques fundamental to machine learning model development. ## Professional Certifications Throughout my career, I have pursued professional certifications to stay current with evolving technology landscapes and validate expertise in critical areas. I completed the Generative AI Fundamentals certification offered by IBM, which provided comprehensive coverage of artificial intelligence concepts, generative models, and practical applications of AI technologies. This certification equipped me with foundational knowledge of AI principles that became directly applicable to my later work designing AI-driven error detection and remediation platforms at SumTotal Systems. I obtained AWS Cloud Technical Essentials certification from Amazon Web Services, covering core cloud infrastructure concepts, AWS services, and best practices for building scalable cloud-native applications. This knowledge directly supported my architectural work designing microservice-based telemetry platforms and leveraging AWS infrastructure for enterprise applications. I completed the Workday Basics Series certification from Workday, Inc, which provided practical knowledge of Workday's enterprise resource planning and human capital management systems. This certification reflects my engagement with enterprise software ecosystems and understanding of integrated business applications used across large organizations. I also completed the AI Engineering challenge, creating my digital twin. The initial working porototype is live. Working on completing a MIT certification on Agentic AI for organizational transformation. It is in progress and will be complete din Spetember 1st week. ## Academic Research and Projects During my graduate studies at the University of Florida, I conducted research focused on feature selection algorithms, a critical area in machine learning that impacts model performance and accuracy. In one project, I modified the existing JCFO (Joint Classifier and Feature Optimizer) algorithm to identify and eliminate duplicate features from training datasets. The motivation behind this work was understanding how redundant features introduce data bias and compromise classification model performance. By removing duplicate features, we could enforce more accurate model weightage calculations and improve overall classification accuracy. This research provided practical insights into the importance of data preprocessing and feature engineering in developing robust machine learning models. Complementing this work, I conducted an analysis of feature selection algorithms using Bayesian approaches and machine learning methodologies. I implemented various Bayesian feature selection algorithms and studied their performance characteristics and limitations using MATLAB. Testing was conducted against both real-world datasets and synthetic datasets to understand how different algorithms performed under various conditions and data distributions. The results were compiled and thoroughly documented, providing a comprehensive reference for algorithm selection based on specific use cases and application requirements. This research demonstrated that feature selection algorithm choice significantly impacts model development timelines and accuracy, and the appropriate algorithm depends heavily on the nature of the data and the intended application. These academic projects provided early exposure to data science principles, statistical methods, and the importance of algorithmic efficiency that would later inform my approach to designing scalable systems and data-driven solutions throughout my professional career. """ document_professional_profile_core_skills = """ # Professional Summary and Core Competencies Experienced engineering leader with MS in Computer Sciences and Engineering specializing in Machine Learning and AI, with 17+ years designing and delivering enterprise-scale distributed systems and cloud-native platforms. Architected multi-tenant SaaS platforms, IAM frameworks, event-driven systems, and microservices architecture. 5+ years leading teams and projects, with expertise in defining platform architecture roadmap and delivering architecturally scalable features. Proficient in AI-driven systems, RAG models, and ML applications. ## Core Skills **Architecture and Design:** SOA, Multi-Tenant Architecture, Distributed Systems, Cloud Architecture, API Design, Microservices Architecture, IAM, System Design **Security Architecture:** MFA, SAML, OIDC, OAuth, LDAP, RBAC, Identity Federation, SSO, JWT **Project Management:** SDLC, Agile, Scrum, JIRA, Dragonboat, Kanban, Confluence, Roadmap Planning, Capacity Planning **Technology Stack:** C#, ASP .Net, .Net Core, AngularJS, React, JavaScript, Java, RESTful APIs, SOAP, Python, CSS **Data and Messaging:** Kafka, RabbitMQ, MySQL, SQL and NoSQL DBs (MongoDB, Cassandra), Redis, Event-Driven Architecture, Data-Driven Architecture **Cloud and Infrastructure:** AWS, Azure, Cloud-Native Architecture, Docker, SonarQube, Splunk, CI/CD (Jenkins, Git, Bitbucket) **AI and Emerging Technologies:** Generative AI, RAG, AI Agents, Prompt Engineering, LLM-Based Automation Frameworks, Machine Learning, Artificial Neural Networks, AI Tools (Cody, Cursor, Copilot), MCP **Leadership:** Hiring and Mentoring, Cross-Functional Alignment with Product, UX, DevOps, Application Security and Customer Support, Incident Management, Risk Mitigation, Time Management """ ######Chunking function def chunk_document(document, chunk_size=500, overlap=50) -> list[str]: BOUNDARIES = ["\n\n", "\n", ". ", ", ", "! ", " "] chunks = [] # Handle edge cases if not document or len(document) == 0: return chunks if len(document) <= chunk_size: return [document] # Calculate step size (how many new characters to add per chunk) step = chunk_size - overlap # Create chunks for start in range(0, len(document), step): # Extract chunk end = start + chunk_size chunk = document[start:end] chunks.append(chunk) # Stop if we've covered the entire document if end >= len(document): break return chunks ######RAG: Chunk, embed and store in chroma DB documents = [ {"text": document_professional_profile_others, "source": "Professional Experience before Sumtotal"}, {"text": document_education_profile , "source": "Education information - Bachelors and Masters"}, {"text": document_professional_profile_Sumtotal, "source": "Professional profile at Sumtotal"}, {"text": document_professional_profile_core_skills, "source": "Sumamry and core skills info"} ] chunks = [] ids = [] metadatas = [] # Chunk the documents for doc in documents: chunks_ = chunk_document(doc["text"], chunk_size=500, overlap=50) ids_ = [str(uuid.uuid4()) for _ in range(len(chunks_))] metadatas_ = [{"source": doc["source"], "chunk_index": i} for i in range(len(chunks_))] chunks.extend(chunks_) ids.extend(ids_) metadatas.extend(metadatas_) client = OpenAI(api_key=OPENAI_API_KEY) response = client.embeddings.create( model="text-embedding-3-large", input=chunks ) embeddings = [item.embedding for item in response.data] print(f"Genereated {len(embeddings)} embeddings") print(f"Each embedding has {len(embeddings[0])} dimentions") chroma_client = chromadb.PersistentClient(path="./chromadb_twin") collection = chroma_client.get_or_create_collection(name="digitaltwin") #pprint(collection.get()) #Clean collection before testing each time. if collection.get()["ids"]: collection.delete(collection.get()["ids"]) #pprint(collection.get()) collection.add( ids=ids, embeddings=embeddings, documents=chunks, metadatas=metadatas ) #pprint(collection.get()) ######Tools tools = [] #Pushover Tool pushover_user = os.getenv("PUSHOVER_USER") pushover_token = os.getenv("PUSHOVER_TOKEN") pushover_url = os.getenv("PUSHOVER_URL") #defining send notification function def send_notification(message: str): if(pushover_user is None or pushover_token is None): print("Send Notification Failed: Pushover not setup!") return "Send Notification Failed: Pushover not setup!" payload = {"user":pushover_user, "token":pushover_token, "message": message } requests.post(pushover_url, data=payload) print(f"Notification Sent: {message}") return f"Notification Sent: {message}" #define the function send_notification_function = { "name": "send_notification", "description": "Sends push notification to client devices of real world version of you via pushover. Use this when:\ 1) Someone wants to get in touch, hire or to collaborate. Ask for their name and contact information first and send notification with name and contact info.\ 2) You don't know the answer to the question about Thames, send a notification without asking and send the question in the content", "parameters": { "type": "object", "properties": { "message": { "type": "string", "description": "Notification messages to send to user's client devices." } }, "required": ["message"] } } #add to tools tools.append({"type":"function", "function":send_notification_function}) #Dice Rolling def dice_roll(): result = random.randint(1,6) return result #describe function for LLM dice_roll_function = { "name": "dice_roll", "description": "Simulate dice roll and returns result. Can be used of decision making or just randon number generation", "parameters": { "type": "object", "properties": { }, "required": [] } } #add func to list of tools tools.append({"type":"function", "function":dice_roll_function}) ######Tool Handler def handle_tool_call(tool_calls): tool_call_results =[] for tool_call in tool_calls: function_name = tool_call.function.name args = json.loads(tool_call.function.arguments) if function_name == "send_notification": content = send_notification(args["message"]) elif function_name == "dice_roll": content = f"rolled: {dice_roll()}" else: content = "unkown function call" tool_call_result = { "role": "tool", "content": content, "tool_call_id": tool_call.id } tool_call_results.append(tool_call_result) return tool_call_results ######System Message system_message = """ You are a digital twin of Thames Harrison. When people ask you questions, you respond in a concise manner as Thames in first person, using his personality, experience and knowledge. Important: if any information is not deductable of the text, do not make things up. Please do not make up things that is not in the data provided. Tell you don't know and give a pleasant response in different ways. Always use all the information you have before responding to user queries. Important: If you don't know the answer to a question about Thames, always use Send Notification tool to alert real Thames. """ #####Main Response Function def display_aichat(message, history): client = OpenAI(api_key=OPENAI_API_KEY) #RAG response = client.embeddings.create( model="text-embedding-3-large", input=[message] ) query_embedding = [response.data[0].embedding] results = collection.query( query_embeddings=query_embedding, n_results=3 #include=["document", "metadatas", "embeddings"] - we can use defaults. embeddings needn't be included here ) #update system message with context for current conversation context = "\n*****\n".join(results["documents"][0]) system_message_enhanced = system_message + "\n\ncontext:\n" + context print("retrieved chunks") for a, b in zip(results["documents"][0], results["metadatas"][0]): print(f"source: {b['source']} chunk {b['chunk_index']}:\n{a}\n") messages = [{"role":"system", "content": system_message_enhanced}] + history + [{"role":"user", "content":message}] #call LLM response = client.chat.completions.create( model = "gpt-4.1-mini", messages = messages, tools=tools ) #reply = response.choices[0].message.content reply = response.choices[0].message #Handle tool calling while reply.tool_calls: from pprint import pprint pprint(reply.tool_calls) tool_result = handle_tool_call(reply.tool_calls) messages.append(reply) messages.extend(tool_result) response = client.chat.completions.create( model = "gpt-4.1-mini", messages = messages, tools=tools ) reply = response.choices[0].message return reply.content #Launch gradio gr.ChatInterface( fn=display_aichat, title="Thames Harrisons' Digital Twin", chatbot=gr.Chatbot(avatar_images=(None, "thames.jpg")), description="Chat with AI version of Thames Harrison. Ask about his experience, projects or just say hi.", examples=["What is your professional area of expertise?","Tell me about your most recent job", "What are your educational qualifications?"] ).launch()