Code Velocity
एंटरप्राइज़ एआई

Amazon Bedrock: एजेंटकोर रनटाइम पर स्टेटफुल एमसीपी क्लाइंट क्षमताएं

·7 मिनट पढ़ें·AWS·मूल स्रोत
शेयर करें
Amazon Bedrock एजेंटकोर रनटाइम पर इंटरैक्टिव एआई एजेंट फ्लो के साथ स्टेटफुल एमसीपी क्लाइंट क्षमताओं को दर्शाने वाला आरेख।

इस ध्वज के अलावा, एक बार जब एमसीपी क्लाइंट प्रारंभिक हैंडशेक के दौरान उनके लिए समर्थन घोषित करता है, तो तीन क्लाइंट क्षमताएं स्वचालित रूप से उपलब्ध हो जाती हैं।

नई क्लाइंट क्षमताओं में गहनता से: एलिसिटेशन, सैंपलिंग और प्रगति

स्टेटफुल मोड में संक्रमण के साथ, Amazon Bedrock AgentCore Runtime MCP विशिष्टता से तीन शक्तिशाली क्लाइंट क्षमताओं को अनलॉक करता है, जिनमें से प्रत्येक को उन्नत एआई एजेंटों के लिए महत्वपूर्ण विशिष्ट इंटरैक्शन पैटर्न को संबोधित करने के लिए डिज़ाइन किया गया है। ये क्षमताएं एक कठोर, एकतरफा कमांड निष्पादन को एमसीपी सर्वर और उसके जुड़े क्लाइंट के बीच एक तरल, दो-तरफ़ा संवाद में बदल देती हैं। यह ध्यान रखना महत्वपूर्ण है कि ये सुविधाएँ ऑप्ट-इन हैं, जिसका अर्थ है कि क्लाइंट प्रारंभिककरण के दौरान अपना समर्थन घोषित करते हैं, और सर्वर को केवल उन क्षमताओं का उपयोग करना चाहिए जिनकी जुड़े क्लाइंट ने विज्ञापन किया है।

एलिसिटेशन: एआई एजेंटों में गतिशील उपयोगकर्ता इनपुट को सक्षम करना

एलिसिटेशन इंटरैक्टिव एआई का एक आधारशिला है, जो एक एमसीपी सर्वर को अपने निष्पादन को विवेकपूर्ण ढंग से रोकने और क्लाइंट के माध्यम से उपयोगकर्ता से विशिष्ट, संरचित इनपुट का अनुरोध करने की अनुमति देता है। यह क्षमता टूल को अपने वर्कफ़्लो के भीतर उपयुक्त क्षणों पर सटीक प्रश्न पूछने में सशक्त बनाती है, चाहे वह किसी निर्णय की पुष्टि करना हो, उपयोगकर्ता की प्राथमिकता एकत्र करना हो, या पिछली कार्रवाइयों से प्राप्त मूल्य एकत्र करना हो। सर्वर एक elicitation/create JSON-RPC अनुरोध भेजकर इसे शुरू करता है, जिसमें एक मानव-पठनीय संदेश और अपेक्षित प्रतिक्रिया संरचना को दर्शाने वाला एक वैकल्पिक requestedSchema शामिल होता है।

एमसीपी विशिष्टता एलिसिटेशन के लिए दो मजबूत मोड प्रदान करती है:

  • फॉर्म मोड: यह एमसीपी क्लाइंट के माध्यम से सीधे संरचित डेटा एकत्र करने के लिए आदर्श है, जैसे कॉन्फ़िगरेशन पैरामीटर, उपयोगकर्ता प्राथमिकताएं, या साधारण पुष्टिकरण जहां संवेदनशील डेटा शामिल नहीं है।
  • यूआरएल मोड: उन इंटरैक्शन के लिए जिन्हें एक सुरक्षित, आउट-ऑफ-बैंड प्रक्रिया की आवश्यकता होती है, जैसे OAuth फ़्लो, भुगतान प्रसंस्करण, या संवेदनशील क्रेडेंशियल का इनपुट, यूआरएल मोड उपयोगकर्ता को एक बाहरी यूआरएल पर निर्देशित करता है। यह सुनिश्चित करता है कि संवेदनशील जानकारी एमसीपी क्लाइंट को पूरी तरह से बायपास कर दे, जिससे सुरक्षा और अनुपालन बढ़ता है।

एलिसिटेशन अनुरोध प्राप्त होने पर, क्लाइंट एक उपयुक्त इनपुट इंटरफ़ेस प्रस्तुत करता है। उपयोगकर्ता की बाद की कार्रवाई सर्वर पर एक तीन-क्रिया प्रतिक्रिया मॉडल को ट्रिगर करती है: accept (उपयोगकर्ता ने अनुरोधित डेटा प्रदान किया), decline (उपयोगकर्ता ने स्पष्ट रूप से अनुरोध को अस्वीकार कर दिया), या cancel (उपयोगकर्ता ने कोई विकल्प चुने बिना प्रॉम्प्ट को खारिज कर दिया)। बुद्धिमान सर्वर इन प्रत्येक परिदृश्य को सहजता से संभालने के लिए डिज़ाइन किए गए हैं, जिससे एक मजबूत और उपयोगकर्ता के अनुकूल अनुभव सुनिश्चित होता है। उदाहरण के लिए, एक add_expense_interactive टूल, जैसा कि स्रोत सामग्री में प्रदर्शित किया गया है, उपयोगकर्ता को डेटा को Amazon DynamoDB जैसे बैकएंड में कमिट करने से पहले प्रश्नों की एक श्रृंखला—राशि, विवरण, श्रेणी और अंतिम पुष्टि—के माध्यम से मार्गदर्शन कर सकता है। प्रत्येक चरण अपेक्षित इनपुट को परिभाषित करने के लिए Pydantic मॉडल का लाभ उठाता है, जिसे FastMCP elicitation/create अनुरोध के लिए आवश्यक JSON स्कीमा में सहजता से परिवर्तित करता है।

सैंपलिंग और प्रगति सूचनाएं: एलएलएम इंटरैक्शन और पारदर्शिता को बढ़ावा देना

प्रत्यक्ष उपयोगकर्ता इंटरैक्शन के अलावा, सैंपलिंग एमसीपी सर्वर को sampling/createMessage के माध्यम से सीधे क्लाइंट से एलएलएम-जेनरेटेड सामग्री का अनुरोध करने की क्षमता प्रदान करती है। यह एक महत्वपूर्ण तंत्र है क्योंकि यह सर्वर पर टूल लॉजिक को अपने स्वयं के एलएलएम क्रेडेंशियल या सीधे एपीआई एकीकरण का प्रबंधन करने की आवश्यकता के बिना शक्तिशाली भाषा मॉडल क्षमताओं का उपयोग करने की अनुमति देता है। सर्वर बस एक प्रॉम्प्ट और वैकल्पिक मॉडल प्राथमिकताएं प्रदान करता है, और क्लाइंट, एक मध्यस्थ के रूप में कार्य करते हुए, अनुरोध को अपने जुड़े एलएलएम को अग्रेषित करता है और जेनरेट की गई प्रतिक्रिया वापस कर देता है। यह व्यक्तिगत सारांश तैयार करने, संरचित डेटा से प्राकृतिक-भाषा स्पष्टीकरण उत्पन्न करने, या चल रही बातचीत के आधार पर संदर्भ-जागरूक सिफारिशें तैयार करने सहित व्यावहारिक अनुप्रयोगों की एक भीड़ खोलता है।

उन परिचालनों के लिए जो समय के साथ विस्तारित होते हैं, प्रगति सूचनाएं अमूल्य हो जाती हैं। यह क्षमता एक एमसीपी सर्वर को लंबे समय तक चलने वाले कार्यों के दौरान वृद्धिशील अपडेट की रिपोर्ट करने की अनुमति देती है। ctx.report_progress(progress, total) का उपयोग करके, सर्वर निरंतर अपडेट उत्सर्जित कर सकता है जिसे क्लाइंट दृश्य प्रतिक्रिया में अनुवादित कर सकते हैं, जैसे कि एक प्रगति बार या एक स्थिति संकेतक। चाहे वह विशाल डेटा स्रोतों में खोज करना हो या जटिल कम्प्यूटेशनल कार्यों को निष्पादित करना हो, पारदर्शी प्रगति अपडेट यह सुनिश्चित करते हैं कि उपयोगकर्ता सूचित रहें, निराशा को रोकते हैं और समग्र उपयोगकर्ता अनुभव को बढ़ाते हैं, बजाय इसके कि उन्हें एक खाली स्क्रीन पर घूरते हुए छोड़ दिया जाए और यह सोचने पर मजबूर किया जाए कि सिस्टम अभी भी सक्रिय है या नहीं।

Bedrock AgentCore Runtime के साथ एआई एजेंट विकास को भविष्य-प्रूफिंग करना

Amazon Bedrock एजेंटकोर रनटाइम पर स्टेटफुल एमसीपी क्लाइंट क्षमताओं का परिचय एआई एजेंट विकास में एक महत्वपूर्ण छलांग का प्रतिनिधित्व करता है। पहले के स्टेटलेस इंटरैक्शन को गतिशील, द्विदिश बातचीत में बदलकर, AWS डेवलपर्स को अधिक बुद्धिमान, प्रतिक्रियाशील और उपयोगकर्ता के अनुकूल एआई अनुप्रयोगों का निर्माण करने में सशक्त बनाता है। ये क्षमताएं – निर्देशित उपयोगकर्ता इनपुट के लिए एलिसिटेशन, ऑन-डिमांड एलएलएम जनरेशन के लिए सैंपलिंग, और वास्तविक समय की पारदर्शिता के लिए प्रगति सूचनाएं – सामूहिक रूप से इंटरैक्टिव एजेंट वर्कफ़्लो के एक नए युग को अनलॉक करती हैं। जैसे-जैसे एआई विकसित होता रहेगा, ये मूलभूत क्षमताएं परिष्कृत ऑपरेशनलाइजिंग एजेंटिक एआई बनाने के लिए महत्वपूर्ण होंगी जो जटिल व्यावसायिक प्रक्रियाओं में सहजता से एकीकृत हो सकें, उपयोगकर्ता की जरूरतों के अनुकूल हो सकें और असाधारण मूल्य प्रदान कर सकें।

अक्सर पूछे जाने वाले प्रश्न

What problem do stateful MCP client capabilities solve on Amazon Bedrock AgentCore Runtime?
Stateful Model Context Protocol (MCP) client capabilities on Amazon Bedrock AgentCore Runtime address the critical limitations of previous stateless AI agent implementations. Stateless agents struggled with interactive, multi-turn workflows, as they couldn't pause mid-execution to solicit user input for clarification, request dynamic large language model (LLM)-generated content, or provide real-time progress updates during lengthy operations. Each request was independent, lacking shared context. This new feature fundamentally transforms agent interactions by enabling bidirectional conversations, allowing agents to maintain conversational threads, gather necessary input precisely when needed, generate dynamic content on the fly, and transparently inform users about ongoing processes. This leads to the development of significantly more responsive, intelligent, and user-centric AI applications capable of complex, adaptive workflows.
How does the transition from stateless to stateful mode work on AgentCore Runtime?
The transition to stateful mode within Amazon Bedrock AgentCore Runtime is initiated by a simple configuration adjustment: setting `stateless_http=False` when starting your MCP server. Once enabled, AgentCore Runtime provisions a dedicated microVM for each individual user session. This microVM is designed for persistence throughout the session's duration, which can last up to 8 hours or expire after 15 minutes of inactivity, ensuring isolated CPU, memory, and filesystem resources for each session. Continuity across interactions is maintained through a unique `Mcp-Session-Id` header. This ID is established during the initial handshake and subsequently included by the client in all follow-up requests, ensuring they are accurately routed back to the correct, persistent session, thereby preserving context and enabling complex, interactive dialogues.
What is Elicitation, and how does it enhance AI agent interactions?
Elicitation is a powerful stateful MCP capability that allows an AI agent (acting as the MCP server) to intelligently pause its ongoing execution and request specific, structured input directly from the user via the client. This significantly enhances interactive agent workflows by enabling agents to ask targeted questions at precise, opportune moments within their operational flow. For example, an agent might use elicitation to confirm a decision, gather user preferences, or collect particular data values that are contingent on preceding steps. The feature supports two robust modes: 'Form mode' for direct structured data collection through the MCP client, and 'URL mode' for secure, out-of-band interactions that require directing the user to an external URL (e.g., for OAuth or sensitive credential entry). The user's response – whether accepting, declining, or canceling the request – is then returned to the server, allowing the agent to dynamically adapt its workflow based on real-time human feedback.
How does Sampling capability benefit AI agents without managing LLM credentials?
Sampling equips the MCP server with the ability to request sophisticated large language model (LLM)-generated content directly from the client using the `sampling/createMessage` mechanism. A key benefit is that the MCP server itself does not need to manage its own LLM credentials, API keys, or direct integrations with various LLM providers. Instead, the server simply provides a well-formed prompt and any optional model preferences to the client. The client then acts as an intelligent intermediary, forwarding this request to its connected LLM and returning the generated response back to the server. This abstraction allows AI agents to seamlessly leverage powerful language model capabilities for tasks such as crafting personalized summaries, generating natural-language explanations from complex structured data, or producing context-aware recommendations, all while simplifying the operational overhead and security concerns associated with LLM management on the server side.

अपडेट रहें

नवीनतम AI समाचार अपने इनबॉक्स में पाएं।

शेयर करें