Skip to content

feat(backend): add Node.js/TypeScript version with full parity #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

miguelsilv
Copy link

πŸš€ Node.js/TypeScript Backend Implementation

This PR adds a full Node.js/TypeScript version of the existing Python backend, using the OpenAI Agents SDK for JavaScript.

βœ… Implemented Features

Agents (5 total):

  • Triage Agent - Main Routing
  • Seat Booking Agent - Seat Reservation
  • Flight Status Agent - Flight Status
  • Cancellation Agent - Flight Cancellation
  • FAQ Agent - Frequently Asked Questions

Tools (6 total):

  • faq_lookup_tool - FAQ Search
  • update_seat - Update Seat
  • flight_status_tool - Flight Status
  • baggage_tool - Baggage Information
  • display_seat_map - Seat Map
  • cancel_flight - Cancel Flight

Advanced Features:

  • βœ… Persistent Conversation Memory
  • βœ… Guardrails (Relevance + Anti-Jailbreak)
  • βœ… Handoffs between Agents with Callbacks
  • βœ… Dynamic Shared Context
  • βœ… REST API identical to Python

πŸ”§ Technical Changes

  • Express.js + TypeScript
  • Full typing with interfaces
  • In-memory conversation store system
  • Error handling and guardrails
  • Full compatibility with existing UI

πŸ“– Documentation

  • Updated README with Node.js instructions
  • One-liner command for quick start
  • Documentation of all endpoints

πŸ§ͺ How to Test

cd node-backend && OPENAI_API_KEY=your_key npm run dev

The API is available at http://localhost:8000 with the same interface as Python.

Tests:

  • βœ… Multi-turn conversations with memory
  • βœ… Handoffs between all agents
  • βœ… Guardrails working
  • βœ… Context persistence
  • βœ… Tools running correctly

- Add backend for TypeScript using OpenAI Agents SDK
- Implement all 5 agents and 6 tools
- Add conversation memory system and guardrails
- Update README with execution instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants