Friday, 18 April 2025

Create your own Personal Agent


I decided to create my own Personal Agent, called “Product Guru” using several GenAI capabilities that I learned during the 5 day GenAI Intensive course by Google. The objective for this Agent is to help me answer the day to day product queries that I keep getting from various internal and external sources being a Product Manager. I wanted to save time around finding the right answers and responding quickly to all such queries..To achieve this I am planning to  leverage Agents, Retrieval Augmented Generation (RAG), and Function Calling.


Here's the 6 step approach:


Step 1: Define the Agent's Purpose and Capabilities

To begin with, my agent will be designed to answer product-related queries and provide information based on the product’s documentation.


Step 2: Implement Retrieval Augmented Generation (RAG) for Grounded Responses

To ensure the agent provides accurate and up-to-date information, I'll use Retrieval Augmented Generation (RAG). This involves retrieving relevant information from a data store and using it to ground the agent's responses, reducing hallucinations. I will do this by:


  1. Creating a data store: This is the collection of my product manuals, FAQs, and other product related documents.

  2. Generating embeddings: Process my documents and generate embeddings (numerical representations) for each chunk of text. I am planning to use Vertex AI LLM text embeddings for this.

  3. Setting up a vector store: Use a vector store (like Vertex AI Vector Search) to store these embeddings, allowing for efficient similarity search.

  4. Implementing the retrieval process: When someone asks a question, embed their query and use the vector store to retrieve the most relevant document chunks.

  5. Augmenting the prompt: Include these retrieved chunks in the prompt sent to the language model that powers my agent. This provides the model with the necessary context to answer the question accurately.


Step 3: Define and Implement Functions for Specific Actions

To extend the agent's capabilities beyond just answering questions, I will use Function Calling. This allows the agent to interact with external systems and perform actions based on the user's request.

Identify potential functions: For a Product Guru, this might include functions like:

get_compatibility_matrix(product_version): To retrieve the compatibility matrix of a specific product version


get_product_details(product_query): To fetch detailed information about a specific product related query.


Define the function signatures: Here I will describe each function to the language model, including its name, parameters, and a brief description of its purpose.

Implement the functions: I will then write the actual code for each function that interacts with my internal systems or APIs.

Integrate with the agent: The agent's orchestration layer (discussed in Step 4) will decide when and how to call these functions based on the user's input.


Step 4: Build the Agent with an Orchestration Layer

An Agent combines a language model with instructions and tools (like our RAG system and defined functions) to achieve a goal.

Choose a foundation model: I will select a suitable language model, such as one from the Gemini family available on Vertex AI.

Define the agent's instructions: Next is to provide clear instructions to the agent about its role, how it should interact with customers, and when to use its tools (RAG and functions). I am planning to use system prompting to define this role.

Implement the orchestration layer: This is the "brain" of the agent that decides what to do at each step. I am planning to use cognitive architectures like ReAct (Reasoning and Acting), where the agent reasons about the situation and then decides to either act (e.g., call a function or retrieve information) or respond to the user. You can use libraries like LangChain with the Vertex AI SDK to build this orchestration.

Tool integration: The orchestration layer will analyze the user's input and determine if it needs to retrieve information using the RAG system or call a specific function.


Step 5: Implement Gen AI Evaluation

To ensure the agent is performing effectively, I will also implement Gen AI evaluation.

Define evaluation metrics: Determine what constitutes a successful interaction. Include metrics like accuracy of answers, relevance of information retrieved, successful execution of functions, and customer satisfaction..

Create evaluation datasets: I will prepare a set of example customer queries and expected responses or actions to test the agent's performance.

Utilize Vertex AI Evaluation: Vertex AI provides tools for both ground truth-based metrics and LLM-based evaluation. I am planning to use a large model as an "autorater" to assess the quality and accuracy of the agent's responses.

Evaluate trajectory and tool use: For agents, I will also evaluate the reasoning process and how effectively the agent uses its tools.


Step 6: Consider MLOps for GenAI

To manage and deploy my Product Guru effectively, I will consider MLOps for GenAI practices.

Version control: I will manage different versions of your agent's code, prompts, function definitions, and trained models.

Continuous integration and continuous delivery (CI/CD): I will automate the process of building, testing, and deploying new versions of your agent.

Monitoring and logging: I will track the agent's performance, identify errors, and monitor its usage in production by using Cloud observability.

Governance: It is also important to implement policies and procedures to ensure responsible and ethical use of the agent. I am planning to use Vertex AI Feature Store, Model Registry, and Dataplex can help with governance of data and models.


By following these steps and leveraging the capabilities of Agents, RAG, and Function Calling within the Vertex AI platform, I am planning to build a sophisticated and helpful Product Guru.

Friday, 17 January 2025

Glimpses from 2024 Events

 

My Standup Act at Milton Keynes



Hosted Council Diwali Event



Singing at Varun Prabhakar's Show



Monday, 2 October 2023

Fascism and Democracy by George Orwell - Quick Synopsis

About the book

This is a quick synopsis of Fascism and Democracy book written by George Orwell.

I have decided to keep it simple and just give you the AWW factor of the book. Yes, the same Aww, that you get on whatsapp messages, when you do something cute.. :)

Except, this time A will tell 'About' the Book, give you an overview – First W means – 'What’s' in the book – go a little bit deeper and lastly W – 'Who' should read it?


This book is a collection of 5 editorials written by George Orwell during World War 2 days in 1940s.

It is a critical analysis of fascism and democracy. In this book, Orwell argues that fascism is a form of totalitarianism that is characterized by the suppression of individual liberty, the use of propaganda, and the glorification of violence. In the defence of Democracy, he argues that democracy is the only form of government that can protect individual liberty and promote human flourishing.

This is a brilliant work and makes you wonder that the ideas and thoughts shared in the book are still relevant today and how the words like democracy, fascism, free-speech are not just mere words but a part of life that impacts us as humanity. So, let’s quickly delve into 'What’s' in the book.

What's in the book?

As I mentioned earlier – This book contains 5 essays written by George Orwell. First one being - Fascism and Democracy, which was first published in The Left News in February 1941. This essay started with debunking the concept of Democracy by Fascists and Communists.

He starts of by saying .. “A 16 year old school boy can attack Democracy much better than he can defend it…. And then goes on to criticize the same.

Later on he argues in the favor of Democracy and mentions that even though it is not perfect but is the most preferable model for people live and practice their basic rights.

In this essay, we get to know how socio-political structure of England back in 1940s and how despite its short comings, it helped England to go through the hardships of the world war two and get better in due course.


The next editorial “Literature and Totalitarianism” was first broadcasted on BBC Radio on May 21st 1941. In this, essay he argues that totalitarianism and literature are incompatible, and hostile to each other. Totalitarianism is where state seeks to control every aspect of human life, including thought, emotion, and expression. Literature, on the other hand, is a form of art that depends on freedom of thought and expression.

He also touched upon the difference between an orthodox system and totalitarianism with an enlightening example of Bolshevik revolution. (where the Germans who were looking at Russian Bolshevism with horror and aversion up until September 1939, post which they must regard it with admiration and affection.)

Orwell concludes by arguing that it is essential to resist totalitarianism in order to preserve literature.


The third essay is "Freedom of the Park“ which appeared in Tribune on December 7th, 1945. In this editorial, George Orwell writes about the importance of freedom of speech in a democracy. Orwell begins by recounting an incident in which five people were arrested for selling newspapers outside the Hyde Park in London. The newspapers they were selling were all critical of the government, and Orwell suspects that the police were motivated by political considerations.

Orwell then goes on to discuss the importance of freedom of speech in general, that freedom of speech is necessary for the development of new ideas, for the discovery of truth and for the holding of the government to account. He also argues that freedom of speech is essential for the protection of individual liberty.

Orwell concludes by warning that freedom of speech is fragile and must be defended and fought for. He writes and I quote, “If large number of people are interested in the freedom of speech, there will be freedom of speech even if the law forbids it; if the public opinion is sluggish, inconvenient minorities will be persecuted, even if laws exist to protect them.”


Next in line is George Orwell's essay "Review of Invasion from Mars“. This appeared in The New Statesman and Nation on October 26th, 1940. This essay is a review of Hadley Cantril's book of the same name, which is a study of the public reaction to the infamous Orson Welles radio broadcast based on the book, The War of the Worlds by H G Wells. Orson Welles, did the radio broadcast, which was a play in the form of a news bulletin and it was so realistic that many people believed that an actual alien invasion was underway. This led to widespread panic and hysteria. Apparently, 6 million people heard the broadcast and over 1 million were somehow affected by the panic. The essay continued to show that most of the affected people were poor, ill-educated, who were economically insecure, or had unhappy private lives. It showed how easy it is to get trapped by media and people often believe in half-baked information.

This essay by Orwell is still so relevant. In recent years, we have seen numerous "fake news" and "deepfakes" which are both examples of how technology can be used to manipulate public opinion.

Orwell's review is a reminder that we must be vigilant in defending ourselves from the dangers of misinformation and manipulation. We must be critical of the information that we consume and we must be aware of the techniques that can be used to manipulate us.


"Visions of a Totalitarian Future" is the final essay in the book, taken from “Looking back on the Spanish War” written in 1942 by George Orwell. Even though this article is written on the backdrop of The Spanish Civil War, which began on July 17, 1936, when generals Emilio Mola and Francisco Franco launched an uprising aimed at overthrowing the country's democratically elected republic, this highlights few key points around the totalitarian future, like

How the use of propaganda can manipulate people's thoughts and emotions?

The objectivity of history, when he says – “ history being written not in terms of what happened but of what ought to have happened according to various ‘’party lines”

The use of torture and other forms of violence to suppress opposition

No room for dissent in a totalitarian framework

Orwell's essay is still relevant today, as there are many totalitarian regimes in the world. His essay is a reminder that we must always be cautious in defending our freedoms and preventing the rise of totalitarianism.


Who should read it?

Orwell's book is an important read for anyone who is interested in understanding the dangers of fascism and the importance of defending democracy.

It is a must-read for anyone who is interested in the power of the media or the psychology of mass panic.

This is a powerful book that remains relevant today.

Orwell's insights into the nature of fascism and the dangers of nationalism are thought provoking and will enlighten anyone who is looking for an understanding of the political landscape in both past and present.

In short, there is a takeaway for everyone, irrespective of which part of the world you belong to, which age group you are from and what profession you are into. I highly recommend this book, It’s a quick read of under 50 pages.


Hope you enjoy reading it – Happy Reading and Happy Sharing!



Thursday, 22 April 2021

Bella Ciao (Remix) with Indian musical background

Amidst all doom and gloom, music helps to remain sane! While trying my new toy over the weekend, I messed around with this Italian cult classic. It's an Indo-Italian remix. No, nothing political about it!!!



 

Monday, 6 July 2020

Jai Shri Ram!!!


Pencils Used: HB, 8B