Posts

LLM Tools & MCP - What are they and how to get started?

Image
LLMs, as powerful as they are, have a few disadvantages common to all of them: 1. Their knowledge and information are limited by their training data and, hence, are unaware of any new developments post a specific date. 2. They, by themselves, are unable to take any action based on the reasoning they have developed.   Tools This is where the concept of tools comes in to address both of these issues. Tools are callable interfaces that can be bound to an LLM. These can be functions, APIs, scripts, system calls, or anything callable, whose interface we expose to the LLM. Let’s consider a function for simplicity. When a tool gets bound to an LLM, we pass the function's name, its description, and the input parameters it takes, along with their data type and description, etc., to the LLM. From this data, especially the description, the LLM is now given context about the existence of a function that can be called to retrieve certain information or take some action.   Bas...

SQL/Postgres' Inner Workings & Optimizations - The Hidden Beauty

Image
Although SQL and its enterprise variant Postgres are heavily used by many, I have found that due to the sheer abstraction they provide, their inner workings remain a mystery to many. The difference mainly comes from the fact that SQL is a declarative language, unlike the imperative languages that we are used to, like C++ and Python. Instead of telling it what exactly to do, we rather declare what we want, then it figures out how to achieve the same.   In this post, I'll go over details of how SQL works and some findings I've found researching into optimizing Postgres queries as a part of my DBMS project at IIT Kanpur.     A case can be made that imperative languages themselves are declarative at the hardware level over assembly and system calls. Just like how the sort function in Python or C++ STL abstracts which exact sorting method is used here, SQL's 'order by' keyword also abstracts the same.  While there is a lot of truth to that st...