Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewsAI - Agentic News Summary App

NewsAI is a sample Android application demonstrating how to build a voice-activated, AI-agentic workflow using the MobileGraph SDK. It allows users to ask for news in a specific genre and provides a summarized, text-to-speech (TTS) readout of the latest articles.

Overview

Traditional apps rely on hardcoded logic. NewsAI uses an Agentic Workflow, where autonomous agents collaborate to understand user intent, fetch real-time data, and process it into a user-friendly format.

Key Features

  • Voice Interaction: Leverages Android's Speech-to-Text and Text-to-Speech.
  • AI-Driven Orchestration: Uses MobileGraph to manage a multi-step agent workflow.
  • Dynamic Summarization: Summarizes multiple news articles using LLMs (OpenAI).
  • Personalized Experience: Tailors news based on natural language queries (e.g., "Tell me about tech news").

Architecture & MobileGraph Workflow

The heart of the application is the NewsWorkflowBuilder, which defines a state-aware graph of agents and nodes.

1. The Workflow Graph

The app uses a stateGraph to orchestrate the following steps:

  1. Genre Identification (Agent): An LLM-powered agent that parses the user's query to identify the requested news category (e.g., "Technology", "Sports").
  2. News Fetcher (Graph Node): A functional node that calls the NewsTool to fetch real-back live news articles via a News API.
  3. Summarizer (Agent): An agent that iterates through the fetched articles and generates concise, TTS-friendly summaries.
  4. State Management: NewsState holds the conversation variables (genre, articles, summaries) and is updated immutably as it passes through the graph.

2. MobileGraph Components Used

  • MobileGraph: The entry point for SDK initialization and model configuration.
  • AgentNode: Wraps an Agent to participate in the graph execution.
  • DefaultExecutionEngine & DefaultAgentRuntime: The engines that navigate the graph and handle LLM interactions.
  • StateGraph: Defines the edges and conditional transitions between nodes.

How to Run

  1. API Keys:
    • Add your API keys to local.properties in the root directory:
      OPENAI_API_KEY=your_openai_key_here
      NEWS_API_KEY=your_news_api_key_here
  2. Build: Run ./gradlew assembleDebug or use Android Studio. The keys are automatically injected into the app via BuildConfig.
  3. Use: Tap the microphone icon, say a news category (e.g., "Business news"), and listen as the AI agents fetch and summarize the latest updates for you.

Technologies

  • Language: Kotlin
  • UI: Jetpack Compose
  • AI Framework: MobileGraph SDK
  • Model: OpenAI GPT-4o (or configured default)
  • TTS: Android Text-to-Speech (Customized for Indian Male Voice)

Built with MobileGraph - Empowering Android Developers with Agentic AI.

About

NewsAI is a sample Android application demonstrating how to build a voice-activated, AI-agentic workflow using the MobileGraph SDK. It allows users to ask for news in a specific genre and provides a summarized, text-to-speech (TTS) readout of the latest articles.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages