Skip to content

Build Travel Assistant Agent (Strands) #196

@aarora79

Description

@aarora79

Parent Issue: #195

Quick Links

Objective

Create a Strands-based agent that helps users plan trips and discover flights.

Important Architecture Clarification

Agent Skills (Tools) work directly with embedded SQLite databases for all CRUD operations. There is NO API layer between agent tools and the database:

  • Agent tools invoke Python SQLite methods directly
  • Query results are returned immediately to the agent
  • Agent skills communicate with other agents via REST API (A2A protocol)
  • Each agent has its own embedded SQLite database (not shared)

Tech Stack

  • Framework: Strands (Python agentic framework)
  • Database: SQLite (in-process, embedded, direct CRUD from agent tools)
  • API: REST (A2A protocol - only for inter-agent communication)
  • Container: Docker

Agent Skills (Tools)

These tools interact directly with the embedded SQLite database:

  1. search_flights - Query flights table by cities/dates, return results sorted by price

    • Direct SQLite: SELECT * FROM flights WHERE departure_city=? AND arrival_city=? AND DATE(departure_time)=?
    • No API call
    • Returns: List of matching flights
  2. check_prices - Get pricing and seat availability for specific flight

    • Direct SQLite: SELECT price, available_seats FROM flights WHERE id=?
    • No API call
    • Returns: Price and availability details
  3. get_recommendations - Recommend flights based on customer preferences

    • Direct SQLite: SELECT * FROM flights WHERE price <= ? AND airline IN (?)
    • Applies filters in-memory
    • No API call
    • Returns: Recommended flight list
  4. create_trip_plan - Create and save trip planning record

    • Direct SQLite: INSERT INTO trip_plans (...) VALUES (...)
    • No API call
    • Returns: Trip plan ID and confirmation

Data Flow

User Query
    ↓
[Travel Assistant Agent (Strands)]
    ├─→ Skill: search_flights
    │   └─→ Direct SQLite CRUD: SELECT from flights table
    ├─→ Skill: check_prices  
    │   └─→ Direct SQLite CRUD: SELECT pricing & availability
    ├─→ Skill: get_recommendations
    │   └─→ Direct SQLite CRUD: SELECT with filters
    └─→ Need Booking? Query Registry
        └─→ A2A REST API Call to Flight Booking Agent
            └─→ [Flight Booking Agent REST endpoint]

SQLite Schema (Flights Table)

CREATE TABLE flights (
  id INTEGER PRIMARY KEY,
  flight_number TEXT UNIQUE NOT NULL,
  airline TEXT NOT NULL,
  departure_city TEXT NOT NULL,
  arrival_city TEXT NOT NULL,
  departure_time DATETIME NOT NULL,
  arrival_time DATETIME NOT NULL,
  duration_minutes INTEGER,
  price DECIMAL(10,2),
  available_seats INTEGER DEFAULT 100,
  aircraft_type TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

Sample Data (Seed Flights)

INSERT INTO flights VALUES
(1,'UA101','United','SF','NY','2025-11-15 08:00','2025-11-15 16:30',330,250.00,85,'B737'),
(2,'AA202','American','SF','NY','2025-11-15 10:15','2025-11-15 18:45',330,280.00,45,'A320'),
(3,'DL303','Delta','SF','NY','2025-11-15 14:30','2025-11-15 23:00',330,220.00,120,'B757'),
(4,'UA104','United','SF','LA','2025-11-16 07:00','2025-11-16 08:30',90,120.00,95,'B737');

REST API Endpoints

These endpoints are ONLY for A2A communication (calling Flight Booking Agent):

  • POST /api/search-flights - Expose search results (called by other agents)
  • POST /api/check-prices - Expose pricing (called by other agents)
  • GET /api/recommendations - Return recommendations (called by other agents)
  • POST /api/create-trip-plan - Create trip plan with booking (calls Flight Booking Agent)
  • GET /api/health - Health check

Note: These REST endpoints receive requests from other agents (A2A protocol), they do NOT handle database queries directly. The agent's internal skills (tools) handle all database CRUD operations.

Acceptance Criteria

  • Built with Strands framework
  • All skills (tools) use direct SQLite CRUD (no backend API)
  • Agent registers with A2A Registry
  • Docker image builds and runs
  • SQLite initialized with schema + seed data on startup
  • Discovers Flight Booking Agent via semantic search
  • Calls Flight Booking Agent via REST A2A API
  • Error handling and logging for database operations
  • Follows patterns from referenced repos
  • Architecture clarification documented

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions