Langbase SDK
Langbase provides a TypeScript, Python 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 for Python, 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.
Table of contents
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.
Create an .env file in the root of your project and add your Langbase API key.
.env
LANGBASE_API_KEY=xxxxxxxxx
Replace xxxxxxxxx with your Langbase API key.
With Langbase SDK, you can set your API key as follows:
TypeScript
import {Langbase} from 'langbase';
const langbase = new Langbase({
apiKey: process.env.LANGBASE_API_KEY
});
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.
- Create memory
- List memory
- Delete memory
- Retrieve memory
- List documents
- Delete document
- Upload document
- Embeddings Retry
Workflow
Use the SDK to programmatically manage workflows in your Langbase account.
Agent
Use the SDK to programmatically manage agents in your Langbase account.
Threads
Use the SDK to programmatically manage threads in your Langbase account.
Parser
Use the SDK to parse text into structured data.
Chunker
Use the SDK to chunk text into smaller pieces.
Embed
Use the SDK to embed text into a vector space.
Tools
Use the SDK to manage tools in your Langbase account.
Time to build. Check out the quickstart examples or Explore the API reference.