Langbase SDK
Langbase provides a TypeScript AI SDK with a phenomenal developer experience to help developers write less code and move fast. Use any LLM, build complex memory agents, compose pipe agents into a pipeline. The SDK is designed to work with JavaScript, TypeScript, Node.js, Next.js, React, and the likes.
Langbase is an API-first platform delivering exceptional developer experience. Our APIs are simple, intuitive, and designed for seamless integration. With clear documentation, practical code examples, and responsive community support, we help you build quickly and efficiently.
Authentication
The Langbase SDK uses API keys for authentication. You can create API keys at a user or org account level. Some SDK methods like when running a pipe allow you to specify a pipe specific API key as well.
All API requests should include your API key in an Authorization HTTP header as follows:
Authorization: Bearer LANGBASE_API_KEY
With Langbase SDK, you can set your API key as follows:
import {Langbase} from 'langbase';
const langbase = new Langbase({
apiKey: process.env.LANGBASE_API_KEY
});
Core functionality
Langbase SDK provides the following core functionality:
Pipe
Use the SDK to manage the pipes in your Langbase account. Create, update, list, and run AI Pipes
Memory
Use the SDK to programmatically manage memories in your Langbase account. Since documents are stored in memories, you can also manage documents using the SDK.
- List memory
- Create memory
- Delete memory
- Retrieve memory
- List documents
- Delete document
- Upload document
- Embeddings Retry
Next steps
Time to build. Check out the quickstart examples or Explore the API reference.