SDKs
AINative provides client SDKs for popular frameworks. Each SDK wraps the REST API with framework-native patterns.
Available SDKs
| SDK | Package | Install | Framework |
|---|---|---|---|
| React | @ainative/react-sdk | npm i @ainative/react-sdk | React 18+ |
| Next.js | @ainative/nextjs-sdk | npm i @ainative/nextjs-sdk | Next.js 13+ (App Router + Pages) |
| Svelte | @ainative/svelte-sdk | npm i @ainative/svelte-sdk | Svelte/SvelteKit |
| Vue | @ainative/vue-sdk | npm i @ainative/vue-sdk | Vue 3 |
| Python (LangChain) | langchain-zerodb | pip install langchain-zerodb | LangChain |
| Python (LlamaIndex) | llama-index-vector-stores-zerodb | pip install llama-index-vector-stores-zerodb | LlamaIndex |
| Python (Direct) | zerodb-mcp | pip install zerodb-mcp | Any Python |
| CLI | zerodb-cli | npx zerodb-cli init | Terminal |
React SDK
import { AINativeProvider, useChat, useCredits } from '@ainative/react-sdk';
function App() {
return (
<AINativeProvider apiKey="your-key" projectId="your-project">
<Chat />
</AINativeProvider>
);
}
function Chat() {
const { messages, sendMessage, isLoading } = useChat();
const { balance } = useCredits();
return (
<div>
<p>Credits: {balance}</p>
{messages.map(m => <p key={m.id}>{m.content}</p>)}
<button onClick={() => sendMessage("Hello")}>Send</button>
</div>
);
}
Next.js SDK
// app/api/chat/route.ts (App Router)
import { createServerClient } from '@ainative/nextjs-sdk';
export async function POST(req: Request) {
const client = createServerClient();
const { messages } = await req.json();
const stream = await client.chat.completions.create({
model: 'meta-llama/llama-3.3-70b-instruct',
messages,
stream: true,
});
return new Response(stream);
}
Python — LangChain
from langchain_zerodb import ZeroDBVectorStore
store = ZeroDBVectorStore(
api_key="your-api-key",
project_id="your-project-id",
)
# Add documents (embeddings free)
store.add_texts(["Your content here"])
# Search
results = store.similarity_search("your query", k=5)
Python — LlamaIndex
from llama_index_zerodb import ZeroDBVectorStore
from llama_index.core import VectorStoreIndex
store = ZeroDBVectorStore(api_key="key", project_id="id")
index = VectorStoreIndex.from_vector_store(store)
engine = index.as_query_engine()
response = engine.query("What is ZeroDB?")
Next Steps
- Quick Start — Get up and running
- API Reference — REST API docs
- MCP Setup — Agent tool integration