Wednesday, August 6, 2025

MIVC - Replit + Ruby on Rails for CommandHive

MIVC - Memory, Interface, Verifier, Client -- A MCP Server Design Framework

Memory MCP Servers

An MCP server requires fetching very specific information with the right context. We have already seen multiple memory fetching implementations in order to serve the current context length limitations. Even if context length is increased (Gemini 2.5 Pro), the ability to serve intelligently on vast data decreases. Thus, there seems to be a clear need for intelligent fetching systems for blobs of information. Multiple methods for the same have emerged:

1. LLM Schema Generation + Database Record Creation

In this technique, the information blob is understood and a schema is created. Then with this format, the information is stored in the database. Once the database is populated, the schema is conveyed to the LLM for writing queries on the database to fetch required information.

2. (1.) + Vector Columns

A lot of times LLMs need to understand the relational context for different records. The idea here is not direct inference (SQL) but contextual inference (vectorized words). This requires some columns to be vectorized.

3. Cyclic Knowledge Graphs

This is where LLMs generate knowledge graphs which are connected to each other in a cyclic pattern where edges denote relationships and nodes store specific information.

YADA YADA YADA.

Designing a memory layer should be able to encompass these use cases for information retrieval and any future implementations as well.

Example Code

Example code could look something like this:

fetch_gmail = MemoryClass(desc="fetch gmail email information via Vector Columns")
res = fetch_gmail.lookup(summary="flight tickets from india to new york")

The MemoryClass itself would look like:

# Schema
Id = email id 
Subject = string 
Summary = Vector DB 

def lookup(input):
    return model.summary.find(input)

This could also be cyclic knowledge graphs or Retrieval Augmented code.

Now one could load a compatible Vector Database from it like Pinecone, Milvus, or MongoDB. More thought needs to be put into how the actual code would look like. I'm happy to take feedback on the same. Right now this is akin to how models work in MVC architecture in Ruby on Rails.

Interface MCP Servers

Often these LLMs are required to act upon specific interfaces - e.g., Browsers, Software, Blender, Linux Terminals, Operating Systems. There are a limited number of interfaces where these LLMs can interact. The idea is to load an interface akin to a 'ruby gem'. The developer of these interfaces can constrain and define how the LLM talks to these interfaces. For example, in case of a browser, a DOM can be served as input, whereas output can be executed on the Browser console. In the case of software, the input can be different menus/clicks on the software and the output will be a screenshot of the software window after different actions.

Interface Components

Each interface will have three main components:

  1. Service Command - This is similar to MCP servers' commands with arguments. The difference is it points to terminal opening command, starting of docker command, running an operating system VM...

  2. Input Interface Experience - The inputs to these interfaces will be required to be constrained by the LLM. This will be based on the choice of interface developer.

  3. Output Interface Experience - The output design from the interface requires LLM communication. This again will be based on the choice of interface developer.

Unique Features of Interfaces

  • Each interface will be an MCP server in itself
  • Each interface can be loaded within another MCP server, to serve as a base layer to be built further

Example Interface Code

An example code can look like this for defining an interface:

Interface ABC

Service Commands:

@command
def start():
    args = ["commands"] / "start.sh"

@command
def stop():
    args = ["commands"] / "stop.sh"

Input Interface:

# take input as screenshot 
screenshot.validate(type: image) 
definition: "this image describes the state of the software, try to understand if the user is clicking something and how this image is different from base software..."

Output Interface:

# take output as actions on a software 
mouse.click(x: 123, y: 122)
keyboard.input("top players")
dom.execute("$('.find').click()")

More thought needs to be put into how the actual code would look like. I'm happy to take feedback on the same.

Verifier MCP Servers

The responses from the LLM need to be verified by a separate black box whose context is not visible to the LLM.

For example, the verifiers can be used to understand the LLM response, if it:

A. Serves the purpose or not. If the response further requires a deeper LLM probe or multiple subagents to complete the task.

B. Should be served to the individual asking it (based on role of the individual or personalization of the individual). If there is further personalization that can be done to the response.

Another example can be if the input is correct and needs to be further detailed or explained before giving it to the main interface/further passed on.

Verifier Features

These are basically a black box unit serving as an LLM which runs when the developer wants to. It can be:

  • Just after the LLM input
  • After the LLM response
  • During the interface communication

They can access the memory for personalization, fetching roles. They can modify the LLM response. We also want this to serve as an integral layer to integrate with other eval services for agents that exist such as TensorZero, LangChain evals. The idea, although, is that eval intelligence should be a black box to the definition of the agent.

Verifier Code Example

# response/input = as defined previously in code 
bool_access, sanitized_response = Verifier.verify(
    "this is meant for a HR professional in an organisation, check if they should have access to this answer/tool call"
)

if bool_access:
    return response
else: 
    return sanitized_response

Client

This can be a pub/sub Kafka on a socket, it can be terminal commands, it can be a chat interface. The idea here is to make the current IO for MCP servers more flexible to serve different clients. The client can be customized to have authentication, social OAuth, yada yada again loaded into the server with packages/gems/libraries which can act as proxy. The idea here is to build composable client units for main IO. Right now what's defined by Python decorators actually needs to be a lot more flexible serving more use cases. The idea here is to not restrict the intelligence by a single "chat client" design but allow more feature-rich clients to exist.

Example Agent Flow

Here is what an example flow and code for an agent may look like. This is an agent which checks my email address for specific flights, finds my passport information from a personal database and applies to VISA for a country I am travelling to:

# Initialize components
email_memory = MemoryClass(desc="Gmail flight information via Vector DB") # defined in Memory folder
personal_vault = MemoryClass(desc="Personal documents storage") # defined in Memory folder 
browser_interface = Interface("BrowserAutomation") # Similar to Importing a gem 
visa_verifier = Verifier("travel_document_validator") # defined in travel_document_validator.py
country_verifier = Verifier("country_verifier") # Verify LLM response 

# Agent workflow
def travel_visa_agent():
    # 1. Fetch flight information
    flights = email_memory.lookup("recent flight tickets")
    destination_country = email_memory.lookup(flights + " countries as an Indian I need visa to and can be given online")

    # 2. Verify the destination country obtained is correct from the email. 
    can_proceed, destination_country = country_verifier.verify("check if it is valid country, just return the country name, indian citizens require a visa and visa can be obtained online")
    if !can_proceed:
        return

    # 3. Retrieve passport details
    passport_info = personal_vault.lookup("passport document current")

    # 4. Verify eligibility
    can_proceed, sanitized_data = visa_verifier.verify(
        f"visa application for {destination_country}", 
        context={"flights": flights, "passport": passport_info}
    )

    if !can_proceed:
        return

    # 5. Interface with visa portal
    browser_interface.start()
    browser_interface.navigate("visa-portal.gov")
    browser_interface.fill_form(passport_info, flights)
    browser_interface.submit()

    return "Visa application submitted successfully"

Friday, December 27, 2024

What does post AGI world looks like and how to prepare for it?

 The LLM models are seemingly extremely good at making making decisions and doing the soft tasks, now that with down the road integrated with hardwares and robots would result in a lot of current human tasks being done by machines. So what do I think are going to be big themes of next few decades?

•⁠  ⁠Ideas that help unite people around common theme. Humans have had innate need to organise themeselves to accomplish complex and great ideas. If these ideas are decentralised then it does not need a central identity (like companies or nations) but decentralised communities (like religions and online forums/telegram groups). These communities will be driven by arts - memes, music, comedy, roasts and short form videos. So creativity and connecting with audience will still be important, the tools for the same could very well be driven by AI software and tools. These will lead to parallel economies which governments will definitely come for. Best way to prepare for it will be trying to build an audience organically by creating content (with or without AI). 

•⁠  ⁠⁠Deep research and experimentation will gain more prominence. Master of one should pursue research. 
If you are someone who has gained tremendous specialization in a specific field then try to be more creative and come up with original ideas that you wish to pursue. 

•⁠  ⁠⁠Experiences and anything to do with energy, travel and community will be big, so it translates to pure science, experiences and building audiences(communication)

•⁠  ⁠⁠every industry will have human conformism to take accountability and responsibility, this will be given to jack of all trades. Thus taking accountability for AI’s actions will be a major theme.

Monday, September 30, 2024

Bitcoin, Hinduism and Armies

Book titled - Bitcoin, Hinduism and Armies  

Chapter 1 - Temple Economies 

Chapter 2 - AI, Not one God but Many? 

Chapter 3 - 195 countries, 195 constitutions, 195 religions? 

Chapter 4 - By Guns, not by Choice 

Chapter 5 - Palestine, Ethereum and Ayodhya  

Chapter 6 - Vidhi se hi Vidhaan hai  

Chapter 7. - Bright and not so Bright Future

Chapter 8. - Data Religions 

Sunday, March 10, 2024

How to regulate cryptocurrencies? Nuanced viewpoint.

Cryptocurrency regulation remains a focal point of debate among financial institutions, governments, and users. The crux of the issue is balancing the innovation and freedom of cryptocurrencies with the need to prevent their misuse. The image you shared illustrates the problems faced by public institutions in monitoring and controlling illicit activities involving cryptocurrencies, and also suggests potential solutions to these challenges.





The flowchart in the image outlines the difficulties in tracking the movement of cryptocurrencies from legitimate to illegal usage and vice versa. It points out that once cryptocurrency is purchased, it cannot be frozen by government authorities, making it a potential tool for illegal activities. Even though fiat purchasers are vetted by governments, the conversion of illegal fiat currency into cryptocurrency remains an issue due to anonymity. Subsequently, these funds can be mixed and transferred multiple times to obscure their origin, ultimately being exchanged back into legal fiat currency.


The process raises concerns about the genuine use cases of cryptocurrencies, given that they can empower users through smart contracts and democratization of power. However, it's challenging to distinguish between legitimate and illicit transactions, as the decentralized nature of cryptocurrencies can be exploited by bad actors.


The image also outlines a series of solutions to address these bottlenecks, focusing on the off-ramp and on-ramp stages of crypto transactions. The proposed solutions are:


1. Having registered crypto users state the purpose of transactions to regulatory authorities, which can later be monitored by AI tracing mechanisms.

2. Maintaining the transparency of crypto transactions to ensure they can be traced by government entities.

3. Creating a portal for users to prove the legitimacy of their use cases and transaction flows.


For crypto-to-crypto issues, the suggestions include:


1. Regulating contract addresses based on liquidity and number of users and establishing a global database of contract classifications.

2. Ensuring that the purpose of the transaction is stated in such a way that the identity of the parties is not revealed, yet the parties cannot lie about the transaction's purpose.


This image reveals a nuanced view of cryptocurrency regulation, recognizing both its potential risks and its innovative benefits. It underscores the necessity for intelligent regulation that doesn't stifle technological advancement while ensuring that the financial system is not compromised. As the dialogue around cryptocurrency regulation evolves, the balancing act between innovation and security becomes increasingly vital for the future of digital finance.

Tuesday, January 30, 2024

Vision 2025

Hey, I think I am probably overreaching it but here is what I think the entire crypto-web3-AI dream will take us tomorrow. I wrote the article - Vision Electronic Cloud in 2012, it has been 12 years since I wrote that and we are nowhere near the Vision Electronic Cloud today. It seems that solving a problem is more important as compared to giving people vision. There are homes today which are like Electronic Cloud but there have not been massive transformations in energy, and the repair and maintenance cost of IOT devices ultimately acted as a negative proponent of Electronic Cloud. 


I don't think anyone is sitting on the realization here of how intelligent LLMs and GPT actually are. They can act as wonderful brains. However, there is still the problem of how to use them by providing the right context? How would the privacy of a user work if they are not given the right context? What if a third-party organization requests access to some of the results computed on such data? Who will own their personal data? 

Here is what the vision encapsulates - everyone will have their personal LLM which will be trained on their own data. This data will be stored in vectors and can be anything digital under the sun. - Images, Videos, Audios, Texts. There will be a schema along with each item which will tell how this data was captured and other statistics about the information. Each person will have cameras embedded into their glasses which will upload everything that they see to the cloud, and it will upload everything they hear to the cloud, this data composed with artificial intelligence will be revolutionary.  Everything they read, hear or write will be recorded. 

The personal LLM and 

How would privacy work?

This could potentially lead to privacy violations on an unimaginable scale. No entity should have entire control over this user's data, this could lead to changing privacy policy or being under government pressure to vilify someone's data. The request to access this data would be made using a smart contract transaction, 



Sunday, November 26, 2023

For Fun: Reading an old story.

This blog post holds a sense of nostalgia for me. 

In our 12th grade English class, we studied a story about a father telling a bedtime tale to his daughter. You can find that story here: [https://ncert.nic.in/ncerts/l/levt105.pdf](https://ncert.nic.in/ncerts/l/levt105.pdf).


Everyone in our English class got a chance to read stories aloud before we discussed them. I was chosen for the narration of this story and hence it is nostalgic for me personally. Unfortunately, we didn't take our English literature teacher very seriously, probably because she was the nicest person in the school. During discussions, some jokes and sarcasm were thrown around, which she never appreciated. For some reason, this story is deeply seeded in my memory.


Now, let's review the story from the perspective of 27-year-old Vaibhav.


**Q: What is the moral issue that the story raises?**


My favorite lines from the book 'Prince' go something like this: "It ought to be remembered that there is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success than to take the lead in the introduction of a new order of things. Because the innovator has for enemies all those who have done well under the old conditions and lukewarm defenders in those who may do well under the new. This coolness arises partly from fear of the opponents, who have the laws on their side, and partly from the incredulity of men, who do not readily believe in new things until they have had a long experience of them."


I think the dad was defending the actions of his own mother. The truth is, there are no absolutely right or wrong decisions, just familiar and unfamiliar ones. Our parents and caregivers, with the best intentions, always choose decisions that are familiar to them. Accepting unfamiliarity is hard, and it's even more difficult for those who are advocating for it. Technology breakthroughs, whether they are decentralization or artificial intelligence, are tools that represent hard-to-accept breakthroughs, even for the developers themselves. If you are not concerned about the moral implications and the potential disruptions caused by your innovation, then it's not truly innovation.


The daughter here wants Roger Skunk to smell like roses again, but her father says that he went back to smelling like a stinky skunk. To many, this may sound odd because the rational mind would always lean towards Roger smelling like roses rather than a skunk. However, being identified with a bad smell is part of the skunk's identity, and letting go of that narrative is extremely hard. We have seen this play out in different conflicts and settings. People often value their identity more than rational thought. Those who oppose such identities are often punished and demoralized by society. This occurs in every setting where communication is present, ex. on the Internet.

Kleo Network aims to bring communities closer and experience a richer version of people's life by data ownership, social networks on existing data, and creating a 10x communication layer for the people to give and receive help. Communications will be decentralized and communities can do commerce with the speed of thought.