Posts

Springing into AI - Part 12: MCP Server - Resources Playground

Image
About In MCP Server, we can expose certain kind of information (statis or dynamic) through means of Resources. The information here can be media, documents, images etc. Typical example of its use in real world can be a company server offering its portfolio, guidelines, work ethics etc to its employee.  Project Our company Hobbits Inc will be providing informtation related to hobbit portfolios, their mughosts as dynamic resources from our file path. MCP Inspector will be used as a testing tool for validating our sanity of the project. Some of the other capabilities would also demonstrate auto completion so that end user may search and select information for a given hobbit. An architecture overview is shown below: Setup Our project setup encompasses of the following setup: Java:                    17 Spring AI :           1.1.2 Spring Boot:        4.0.3 Testing tool :    ...

Springing into AI - Detour - MCP Inspector

Image
Problem MCP Server is enriched with a lot of capabilities. As enterpris grade GenAI applications are developed, it is imperative to be able to test and improve upon in isolation. Would it not be amazing, if we had a tool offering allowing us the freedom to debug, diagnose, test and observer the interactions that occur ? Solution MCP Inspector is a nice UI utility tool that can empower the developer in refining their applications as it is being prepared for A grade quality deliverable. The utility tool is hoste on a github repo  here . It allows us the ability to entier manually install the entire setup locally on our machine or the ability to run it as a docker container for quick getting started. Do note that if you running it with a setup of a docker container and your application is running locally, you may also have to switch to " host" network for the container to be communicating with the local application.  docker run -p 6274 :6274 -p 6277 :6277 --network h...

Springing into AI - Part 11: Model Context Protocol (MCP) - Theory

Image
Problem As we introduce more LLM models, we have to adapt our custom tools to each kind of model. This make it very tedious to develop, difficult to maintain and introduces a level of complexity. Often referred to as N x M problem where N is the number of models and M is the number of tools. So, say we using 5 different models, and have 10 different tools we would like to expose. This means we would end up with 50 permutations that we would have to manage, ouch !!.  Solution Anthropic designed an open source standard known as Model Context Protocol (MCP) that in its simplest form acts as a universal interface allowing LLM's to discover, communicate and securely use our external tools, resources, etc. This reduces the N x M problem by N + M problem. So, given the problem statement, instead of having an overhead of 50 permutations to manage,  it reduces drastically to mere 15 ( 5 models and 10 tools ) permutations.       It achieves this by having a client-se...

Springing into AI - Part 10: RAG

Image
Problem We have static resources such as company policies, employee guidelines, portfolios etc that we would like to expose to LLM and offer customers ability for them to query on that information. Since LLM's are pre-trained models they lack information about the content in our own resources. We want to empower our end users with ability to query on our resources for wide variety of use cases. Solution Retrieval Augmented Generation   (RAG) is the solution we have been waiting for to enrich our  application. It can summarized as a two step process.  In the first step, we store our information content through a custom ETL process into a special kind of persistence store named Vector Store where each chunk is stored as a series of multi dimension N dimension vectors through process called Vector Embeddings . In the second step, a semantical similar search is performed between these vectors and the user chat prompt so that it maybe augmented before presented to the LLM for...

Springing into AI - Part 9: Tool Calling

Image
Problem In GenAI applications, the LLM's are pre-trained models for information relative to a point in time. This does solve for cases when certain prompts are made for that information. However, they fail to provide adequate response to request for information outside its knowledge bank. The demand for this can vary per business use case and the problem we trying to solve to provide that information to LLM. Information can be static such as a resource, or a dynamic information obtained from your own knowledge bank from business information to wide variety of application use cases.  Solution For static resources such as document, we have a solution that we will discover in upcoming posts. For dynamic information such as retrieving information from our database or a custom business logic where we return the data back to the LLM for it to make sense of it, we can use a concept termed Tool Calling.    In its simplest form this is merely your custom business logic done as a f...