Skip to main content
Documentation Update

Garnet Framework has evolved with architectural improvements for better cost efficiency and scalability. This documentation is current and reflects these changes, though we continue to expand certain sections with additional examples and detailed guidance.

Thank you for your patience as we complete this update.

Building Context Consumers

Context Consumers are applications and services that consume data from Garnet Framework to extract insights, detect patterns, and trigger actions. These range from traditional applications like dashboards displaying real-time operational conditions and analytics platforms processing historical trends, to intelligent systems such as autonomous agents making decisions based on contextual awareness, notification systems triggering alerts when specific conditions are met, and ML inference engines analyzing patterns to predict outcomes.

Context Consumers can also act as Context Producers, creating intelligent feedback loops - for example, an autonomous AI agent performing an action based on current context can store the results back into the knowledge graph, or a system performing ML inference can contribute its predictions either as new contextual entities or as attributes on existing entities, such as adding a predicted maintenance state to a machine entity or weather forecasts to location entities, enabling other consumers to leverage these insights.

The key advantage for Context Consumers is that Garnet Framework provides data with a standardized NGSI-LD information model, regardless of the original data source. This consistency enables applications to focus on business logic rather than data integration challenges, while the ability to contribute back to the knowledge graph creates powerful feedback loops that enhance the overall system intelligence.

Building Context Consumer Applications

Context Consumers can access data from Garnet through multiple flexible patterns designed to meet diverse application requirements. Pull-based patterns enable applications to fetch data on-demand using the NGSI-LD Context Broker API, while push-based patterns provide real-time updates through NGSI-LD subscriptions. Historical analysis is available through Amazon Athena querying data stored in S3 for analytics and reporting, while hybrid approaches combine multiple access patterns to meet specific requirements.

Real-time applications can leverage AWS Amplify Pub/Sub to subscribe to MQTT topics where NGSI-LD subscription notifications are sent, enabling responsive dashboards and applications. AI agents can fetch data directly from Garnet Framework as a tool for decision-making, with an upcoming MCP (Model Context Protocol) interface to streamline AI agent integration.

When Context Consumers need to consume data in specific formats due to existing system constraints or legacy requirements, Garnet Framework provides the flexibility to create in-flight mapping between NGSI-LD and the required format. This capability enables seamless integration with existing applications that cannot be modified to consume NGSI-LD directly. Through transformation layers, API gateways, or middleware components, you can convert the standardized NGSI-LD data into any format your existing systems expect, whether it's proprietary JSON schemas, XML formats, or database-specific structures. This approach demonstrates Garnet's flexibility and ensures that adopting the framework doesn't require replacing existing systems, but rather enhances them with unified contextual data.

Garnet Framework is completely agnostic in terms of visualization and analytics tools, enabling flexible integration through the access patterns described above. Grafana (or its fully managed version Amazon Managed Grafana) provides powerful dashboarding capabilities for both real-time API data and historical data queried through Athena, while Amazon QuickSight creates interactive dashboards and reports from historical data stored in S3 and queried through Athena. For 3D visualization and digital twins, tools like Cesium (a platform for 3D geospatial applications) and Matterport (a platform for creating digital twins of physical spaces) can be easily integrated with Garnet Framework.

Context Consumer Examples

Let's explore practical implementations for different consumption patterns, demonstrating how to leverage Garnet's unified data model in various scenarios. These are code snippets and implementation tips to provide direction rather than comprehensive guides. For more detailed implementation guidance, refer to the tutorials section.

Monitoring with Grafana

Grafana provides powerful visualization capabilities for both current state and historical data from Garnet Framework. You can configure Grafana to query the NGSI-LD Context Broker API for current entity states and use Amazon Athena as a data source for historical analysis.

Scenario: Smart Building Operations Dashboard

Consider a facility management company that needs to monitor environmental conditions, energy consumption, and occupancy across multiple buildings. The dashboard must display current sensor readings alongside historical trends to identify patterns and optimize building operations.

The Grafana dashboard integrates with Garnet by:

  1. Configuring the NGSI-LD API as a data source for current state queries
  2. Setting up Amazon Athena connection for historical data analysis
  3. Creating panels that combine current state with temporal trends
  4. Enabling drill-down capabilities from summary views to detailed entity information

This approach enables facility managers to monitor current conditions while analyzing historical patterns to optimize HVAC systems and predict maintenance needs.

City-Scale Digital Twin with Cesium

Cesium enables the creation of 3D visualizations by fetching entity data from Garnet and displaying them on interactive 3D maps. This approach is particularly useful for applications where spatial context enhances data understanding and decision-making.

Scenario: Bike Sharing Station Monitoring

Consider a city that operates bike sharing stations and wants to visualize station locations, bike availability, and usage patterns on a 3D map. This helps city planners understand usage patterns and optimize station placement.

The Cesium integration works by:

  1. Setting up a Cesium Ion account and obtaining an access token
  2. Installing Cesium dependencies in your project (this example uses Angular, but the same approach works with React, Vue, or any other framework)
  3. Fetching bike station data from Garnet's NGSI-LD API
  4. Visualizing stations as color-coded bike icons and 3D striped boxes based on availability
  5. Creating interactive 3D elements that can be selected and extended with custom functionality

The result is an interactive 3D map where city operators can quickly assess bike station status across the entire network, identify stations that need restocking or maintenance, and understand usage patterns in their spatial context.

For comprehensive Cesium development guidance with different frameworks, see the Cesium QuickStart Guide.

This simple implementation creates a 3D map showing bike station locations with color-coded availability indicators. Stations with high availability (>50%) display green icons, while stations with low availability (≤50%) display red icons, helping city operators quickly identify stations that need attention.

Cesium Digital Twin Demo showing bike stations on 3D map

Advanced Integration Demo: For a comprehensive demonstration of Cesium digital twins integrated with AI agents and advanced Garnet Framework capabilities, see our LEAP 2024 Demo blog post showcasing real-world applications.

For more complex urban planning scenarios, this same approach can be extended to visualize comprehensive city data including bus routes, traffic patterns, employment centers, and demographic information. Such integrated visualizations enable policy makers to identify service gaps, optimize resource allocation, and simulate the impact of infrastructure changes before implementation. The 3D spatial context helps stakeholders understand complex urban relationships that traditional charts and graphs cannot effectively communicate.

Additional Context Consumer Examples

Documentation Update in Progress

We are currently updating this documentation with additional Context Consumer examples and implementation guides. The following sections are being reviewed and enhanced:

  • Immersive Visualization with Matterport - 3D spatial model integration for retail analytics and facility management
  • Real-time Applications with AWS Amplify Pub/Sub - Building responsive applications with NGSI-LD subscriptions
  • AI Agent Integration - Leveraging Garnet as a data source for intelligent decision-making systems

Please check back regularly for updates as we continue to expand and improve our documentation.

Next Steps

With Context Consumers accessing data from your knowledge graph, you can build sophisticated applications that leverage unified contextual intelligence. The flexibility of Garnet's data access patterns enables everything from simple dashboards to complex AI-driven systems.

You can explore practical examples in the tutorials section that demonstrate complete end-to-end implementations combining Context Producers with various Context Consumer patterns.