Close Menu
    Main Menu
    • Home
    • News
    • Tech
    • Robotics
    • ML & Research
    • AI
    • Digital Transformation
    • AI Ethics & Regulation
    • Thought Leadership in AI

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Unmasking the silent saboteur you didn’t know was operating the present

    June 9, 2025

    Explainer: Trump’s massive, stunning invoice, in 5 charts

    June 9, 2025

    New PathWiper Malware Strikes Ukraine’s Vital Infrastructure

    June 9, 2025
    Facebook X (Twitter) Instagram
    UK Tech Insider
    Facebook X (Twitter) Instagram Pinterest Vimeo
    UK Tech Insider
    Home»Machine Learning & Research»Construct a location-aware agent utilizing Amazon Bedrock Brokers and Foursquare APIs
    Machine Learning & Research

    Construct a location-aware agent utilizing Amazon Bedrock Brokers and Foursquare APIs

    Idris AdebayoBy Idris AdebayoApril 21, 2025Updated:April 29, 2025No Comments8 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Construct a location-aware agent utilizing Amazon Bedrock Brokers and Foursquare APIs
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    This publish is co-written with Vikram Gundeti and Nate Folkert from Foursquare.

    Personalization is vital to creating memorable experiences. Whether or not it’s recommending the right film or suggesting a brand new restaurant, tailoring strategies to particular person preferences could make all of the distinction. However on the subject of meals and actions, there’s extra to contemplate than simply private style. Location and climate additionally play an important position in shaping our decisions. Think about planning a time out: on a sunny afternoon, a leisurely picnic within the park is likely to be very best, but when it’s pouring rain, a comfy indoor café could be far more interesting. The problem, then, is to create an agent that may seamlessly combine these components—location, climate, and private preferences—to offer really personalised suggestions.

    To sort out this problem, we will mix Amazon Bedrock Brokers and Foursquare APIs. On this publish, we reveal how you should use a location-aware agent to convey personalised responses to your customers.

    Amazon Bedrock Brokers

    Amazon Bedrock that makes it easy to construct and scale generative AI purposes. It supplies entry to a wide range of high-performing basis fashions (FMs) from main AI corporations like AI21 Labs, Anthropic, Cohere, Luma, Meta, Mistral AI, Stability AI, and Amazon, all by a single API. This implies you don’t must handle infrastructure, as a result of it’s serverless and integrates with acquainted AWS companies for safety, privateness, and accountable AI. You’ll be able to experiment with fashions, customise them along with your information, and construct purposes with out writing advanced code.

    Amazon Bedrock Brokers is a function inside Amazon Bedrock that lets you create autonomous AI brokers. These brokers can perceive person requests, break them into steps, and full duties by connecting to your organization’s APIs and information sources. For instance, they’ll automate processes like processing insurance coverage claims or managing stock, making them environment friendly for enterprise duties. They deal with immediate engineering, reminiscence, and safety robotically, so you’ll be able to set them up shortly with out managing infrastructure.

    Foursquare Locations APIs

    Foursquare’s Locations APIs ship exact location intelligence for purposes requiring contextual consciousness. Constructed on prime of the open supply international Locations dataset with 100 million factors of curiosity spanning 1,500 classes, the Locations APIs remodel geographic coordinates into actionable enterprise context.

    The GeoTagging API precisely resolves GPS coordinates to a selected place with a excessive diploma of precision, enabling purposes to immediately decide if a person is at a neighborhood espresso store, inside a Macy’s division retailer, or standing in Central Park. The Place Search & Knowledge APIs remodel how purposes uncover places by offering nuanced filtering capabilities past easy proximity searches. Builders can filter locations by particular classes (discovering solely eating places, parks, or vacationer points of interest), apply attribute-based constraints (reminiscent of value vary or particular facilities), think about temporal components (like present working standing), and stability distance with relevance for really contextual outcomes. Every place returned comes enriched with contextual attributes, together with photographs, critiques, high quality scores, and real-time reputation information.

    When built-in with Amazon Bedrock Brokers, Foursquare’s Locations APIs allow the creation of purposes that perceive the whole context of a person’s location—leading to experiences which are related, well timed, and personalised.

    Answer overview

    To reveal the facility of including location to Amazon Bedrock Brokers, we created a easy structure that creates an Amazon Bedrock agent with the Foursquare Locations APIs and a Climate API. By combing these capabilities, we will create distinctive person experiences which are personalized to the context of the place the person is. The next diagram reveals how we architected the agent.

    Within the answer workflow, the person interacts with the agent by a Streamlit internet interface. The net utility makes use of the appliance logic that invokes the Amazon Bedrock agent within the cloud. The agent is aware of in regards to the location instruments and climate instruments despite the fact that these are hosted domestically inside the appliance. When the instruments are invoked by the agent, a return of management response is given to the appliance logic, which invokes the instrument and supplies the response from the instrument in a second invocation of the agent. Along with the instruments, the agent has primary directions on what sort of character it ought to have and what forms of behaviors it ought to assist.

    Let’s discover an instance of a short interplay with the agent the place we ask if there’s a park close by and a really useful restaurant close to the park for takeout meals.

    The next screenshot reveals the primary interplay with an agent, finding a park close by with the Foursquare APIs invoked by the agent.

    On this instance, you’ll be able to see the agent sending intermediate occasions to the person informing them of the actions happening (invoking the mannequin, invoking a instrument, considering, and so forth).

    The next screenshot reveals the record of eating places really useful by the Foursquare APIs close to the park.

    On this instance, the agent invokes the APIs based mostly on the person enter, and the Streamlit UI connects the output from Foursquare to a map.

    Within the following part, we element how one can construct the agent in your account and get began.

    Conditions

    To deploy this answer, you need to have an AWS account with the required permissions.

    Additionally, you will want a Foursquare Service API Key to permit your AI agent to entry Foursquare API endpoints. If you don’t have already got one, observe the directions on Foursquare Documentation – Handle Your Service API Keys to create one. You will want to log in to your Foursquare developer account or create one if you happen to should not have one (making a primary account is free and consists of starter credit score to your undertaking). Remember to copy the Service API key upon creation as you won’t be able to see it once more. 

    Construct the agent

    The supply code for the Foursquare agent is out there as open supply within the following GitHub repository. Full the next steps to up the agent in your native folder from the supply:

    1. Clone the repository to a neighborhood folder.
    2. Set surroundings variables to your Foursquare API token:

    export FOURSQUARE_SERVICE_TOKEN=

    1. Set surroundings variables to your AWS credentials:

    export AWS_ACCESS_KEY_ID=

    export AWS_SECRET_ACCESS_KEY=

    1. Set up necessities:

    pip set up necessities.txt

    1. Begin the Streamlit UI:

    streamlit run agent_ui.py

    Greatest practices

    If you’re creating an agent, we advocate beginning with a check dataset. Assume by the potential inputs and what are acceptable outputs. Use these pattern conversations to check the agent each time a change is made. As well as, Amazon Bedrock Brokers lets you configure guardrails to guard in opposition to malicious enter or forms of dialog that you wouldn’t need to use to your person expertise. We advocate for any manufacturing use circumstances to couple your agent with acceptable guardrails. To be taught extra, see Amazon Bedrock Guardrails.

    Clear up

    If you’re carried out utilizing the answer, take away any assets you created to keep away from ongoing costs.

    Conclusion

    Brokers present a mechanism to automate work in behalf of your prospects, whether or not by a chat interface or different inputs. Combining the automation potential with brokers with the location-aware APIs from Foursquare, you’ll be able to create highly effective UIs and experiences that can delight your prospects with new ranges of personalization. With Amazon Bedrock Brokers, you’ll be able to construct a cloud-centered answer that lets you use highly effective basis fashions on Amazon Bedrock to drive these experiences.

    Check out the answer to your personal use case, and share your suggestions within the feedback.


    In regards to the authors

    John Baker is a Principal SDE at AWS, the place he works on Amazon Bedrock and particularly Amazon Bedrock Brokers. He has been with Amazon for greater than 10 years and has labored throughout AWS, Alexa, and Amazon.com. In his spare time, John enjoys snowboarding and different out of doors actions all through the Pacific Northwest.

    Mark Roy is a Principal Machine Studying Architect for AWS, serving to prospects design and construct generative AI options. His focus since early 2023 has been main answer structure efforts for the launch of Amazon Bedrock, the flagship generative AI providing from AWS for builders. Mark’s work covers a variety of use circumstances, with a main curiosity in generative AI, brokers, and scaling ML throughout the enterprise. He has helped corporations in insurance coverage, monetary companies, media and leisure, healthcare, utilities, and manufacturing. Previous to becoming a member of AWS, Mark was an architect, developer, and know-how chief for over 25 years, together with 19 years in monetary companies. Mark holds six AWS Certifications, together with the ML Specialty Certification.

    Vikram Gundeti presently serves because the Chief Know-how Officer (CTO) of Foursquare, the place he leads the technical technique, choice making, and analysis for the corporate’s Geospatial Platform. Earlier than becoming a member of Foursquare, Vikram held the place of Principal Engineer at Amazon, the place he made his mark as a founding engineer on the Amazon Alexa workforce.

    Nate Folkert is a Senior Employees Engineer at Foursquare, the place he’s been since recognizing it trending close by when checking in at a Soho espresso store 14 years in the past. He builds the server API for Swarm and helps out on particular tasks. Outdoors of labor, he loves exploring the world (with Swarm, ofc, so is it actually outdoors of labor?) and is presently obsessive about discovering the entire irl filming places utilized in Apple TV’s Severance

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Idris Adebayo
    • Website

    Related Posts

    ML Mannequin Serving with FastAPI and Redis for sooner predictions

    June 9, 2025

    Construct a Textual content-to-SQL resolution for information consistency in generative AI utilizing Amazon Nova

    June 7, 2025

    Multi-account assist for Amazon SageMaker HyperPod activity governance

    June 7, 2025
    Leave A Reply Cancel Reply

    Top Posts

    Unmasking the silent saboteur you didn’t know was operating the present

    June 9, 2025

    How AI is Redrawing the World’s Electrical energy Maps: Insights from the IEA Report

    April 18, 2025

    Evaluating the Finest AI Video Mills for Social Media

    April 18, 2025

    Utilizing AI To Repair The Innovation Drawback: The Three Step Resolution

    April 18, 2025
    Don't Miss

    Unmasking the silent saboteur you didn’t know was operating the present

    By Declan MurphyJune 9, 2025

    You possibly can have the perfect firewalls, hermetic encryption and the newest SIEM instruments. But…

    Explainer: Trump’s massive, stunning invoice, in 5 charts

    June 9, 2025

    New PathWiper Malware Strikes Ukraine’s Vital Infrastructure

    June 9, 2025

    Soneium launches Sony Innovation Fund-backed incubator for Soneium Web3 recreation and shopper startups

    June 9, 2025
    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    UK Tech Insider
    Facebook X (Twitter) Instagram Pinterest
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms Of Service
    • Our Authors
    © 2025 UK Tech Insider. All rights reserved by UK Tech Insider.

    Type above and press Enter to search. Press Esc to cancel.