Prompt engineering setup for AI assistant in mobile app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Prompt engineering setup for AI assistant in mobile app
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Prompt Engineering Setup for AI Assistant in Mobile App

GPT-4o without proper prompt configuration answers one question verbosely, changes tone on the next, and returns JSON instead of text on the third. Prompt engineering isn't "write good instructions" — it's managing model behavior determinism via system prompts, few examples, and context window control.

System Prompt: Structure Matters

Bad system prompt: "You're a helpful assistant for our app. Answer briefly and relevantly."

Working system prompt contains four zones:

Role and domain constraints. "You are a personal finance app assistant. Answer only questions about budgeting, expense categorization, and financial planning. For off-topic questions say: 'I only help with personal finance questions.'"

Output format. If assistant returns structured data — describe schema directly in system prompt with example. Model adheres to format much more reliably seeing concrete sample.

Tone and style. "Answer briefly — max 3 sentences. No bullet lists in conversational responses. Don't start with 'Of course!' or 'Great question!'"

User context. Dynamic information injected: user name, current app section, recent actions.

// iOS — system prompt construction with context
func buildSystemPrompt(user: User, currentScreen: AppScreen) -> String {
    return """
    You are the financial assistant for MoneyMap app.
    User: \(user.name), currency: \(user.currency).
    Current section: \(currentScreen.description).
    Monthly budget: \(user.monthlyBudget). Spent: \(user.spent).
    Answer briefly in English without lists.
    """
}

Few-shot Examples and Context Window Management

Few-shot — 2–5 "question → correct answer" pairs at dialogue start. Work as behavior templates. Critical: examples must cover edge cases, not just "ideal" scenarios.

Mobile assistant problem — context window limitation in long sessions. gpt-4o-mini has 128K tokens but costs grow linearly. History management strategies:

  • Sliding window: keep only last N messages (usually 10–20). Cheap, but assistant "forgets" conversation start
  • Summary compression: periodically compress history: "User discussed expense categorization, added 3 transactions" — replaces 10 messages
  • Retrieval-augmented memory: important facts saved to vector store, retrieved by relevance. Complex, scales better

Temperature, top_p and When to Adjust

temperature=0 — deterministic output, model always picks highest probability token. For structured answers (JSON, numbers, classification) — set 0 or 0.1. For text generation "in style" — 0.7–0.9.

top_p=0.9 + temperature=0.7 — standard conversational assistant combo. Don't adjust both simultaneously — unpredictable interaction.

Timeline Estimates

System prompt design and testing — 2–4 days. Context window management implementation — 1–2 days. Total: 3–5 working days for basics. Iterative improvement post-launch — continuous process based on user feedback.