Skip to main content
Backends are the bridge between the LLM Gateway and your product data. The gateway defines clean interfaces that you implement to connect any data source.

Core Interfaces

ProductBackend

Handles product search, details, and inventory:

CartBackend

Handles shopping cart operations:

OrderBackend

Handles order creation and management:

Type Definitions

Product

Implementation Examples

In-Memory Backend

Perfect for development and testing:

Database Backend (Prisma)

Connect to your existing database:

Best Practices

You don’t need to implement everything. Start with ProductBackend, add CartBackend when needed.
The type definitions catch errors early and provide excellent IDE support.
Return null for not found items rather than throwing. Throw for actual errors.