Compare commits

..

42 Commits

Author SHA1 Message Date
github-actions[bot] 768d99a488 Release (#2209) 2025-09-29 12:04:57 -06:00
Logan b4c55319da initial sonnet 4 5 support (#2208) 2025-09-29 11:58:03 -06:00
Laurie Voss d3a8b764f0 Fix broken links from Astro migration (#2206) 2025-09-17 11:14:23 -07:00
Laurie Voss 676e3f8993 Add GitHub Actions workflow for Vercel deployment of developer hub (#2205) 2025-09-16 13:43:56 -07:00
dependabot[bot] 7283909755 chore(deps): bump next from 15.3.3 to 15.4.7 (#2183)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 12:29:08 +08:00
github-actions[bot] 19e5c318a0 Release 0.12.0 (#2204)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-09-15 12:28:24 +08:00
Marcus Schiesser d49301555f chore: replace cloud package with llama-cloud-services (#2145)
Co-authored-by: Thuc Pham <thuc@lingble.com>
2025-09-15 12:09:17 +08:00
dependabot[bot] f648bb7b90 chore(deps): bump hono from 4.7.7 to 4.9.7 (#2203)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 10:52:50 +08:00
Thuc Pham 06f884a437 feat: return structured object from llm.exec (#2198) 2025-09-15 10:51:06 +08:00
dependabot[bot] 9e66861d07 chore(deps): bump vite from 5.4.19 to 6.3.6 (#2199)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-12 10:32:22 +08:00
Marcus Schiesser ae74f70d7d chore: update @llamaindex/workflow-docs (#2197) 2025-09-11 15:47:46 +08:00
github-actions[bot] 5b4a53177e Release 0.11.29 (#2188)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-09-11 10:44:29 +08:00
Thuc Pham 5da1cda939 feat: support zod v4 & v3 (#2186)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2025-09-11 10:34:45 +08:00
Thuc Pham 1285e381bd feat: add ci-build script for size limit testing (#2194) 2025-09-10 18:09:47 +08:00
Neha Prasad 5d5cd44276 fix: anthropic temperature parameter not respecting value 0 (#2190)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
2025-09-10 11:45:12 +08:00
hunter ed37c645af chore: addition of apac claude 4 sonnet to aws records (#2189) 2025-09-10 11:44:57 +08:00
hunter c40adafecc chore: add latest google models (#2191) 2025-09-10 11:44:30 +08:00
dependabot[bot] 995b465205 chore(deps-dev): bump vite from 6.3.3 to 6.3.6 (#2193)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-10 10:46:55 +08:00
Jeremy B. Merrill 8929dcf1dd vectorStoreIndex has new option progressCallback (#2187)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
2025-09-05 10:37:22 +08:00
github-actions[bot] af0b79f1cd Release 0.11.28 (#2174)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-08-28 17:28:15 +08:00
Thuc Pham 1995b38660 chore: bump @llamaindex/workflow-core in @llamaindex/workflow package (#2181) 2025-08-27 17:30:09 +08:00
Raj Shrestha 001a5159cf chore: add minimal reasoning effort for gpt5 (#2177)
Co-authored-by: Raj Shrestha <raj.shrestha@carelon.com>
2025-08-27 11:52:58 +08:00
Zhanghao 9d7d2052e7 fix: fix the problem that the usage field in the streaming response was not handled correctly (#2173) 2025-08-24 12:33:14 +08:00
Orry fd90e25f0e Docs settings per request (#2166)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
2025-08-20 16:31:26 +08:00
github-actions[bot] 97c00d67c3 Release 0.11.27 (#2169)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-08-19 12:11:06 +08:00
Daniel 6ebd7c2f13 fix: bedrock complete using actual modelId (#2172) 2025-08-19 11:04:32 +08:00
Clelia (Astra) Bertelli 0267bb0e8e feat: add responseFormat to llm.exec (#2167) 2025-08-13 12:39:37 +08:00
Marcus Schiesser 7875ee91e6 chore: update chat-ui docs (#2168) 2025-08-13 12:26:22 +08:00
Orry e3405fca44 chore: point the local llm full example to the correct URL (#2162)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2025-08-08 14:56:35 +08:00
github-actions[bot] f3bc2b61e7 Release (#2164) 2025-08-07 15:18:42 -06:00
Logan 4c703767b7 Adding GPT-5 support (#2163) 2025-08-07 13:39:47 -06:00
github-actions[bot] a27648200d Release (#2161) 2025-08-07 13:39:20 -06:00
abdeliibrahim c93bb02002 #2159 Remove unneeded console logs from gemini stream (#2160)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2025-08-07 11:38:35 +08:00
github-actions[bot] e9ded4e65f Release (#2154)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-08-06 12:18:06 +08:00
Marcus Schiesser 47a6f5fe5a chore: bump ollama (#2156) 2025-08-06 12:11:17 +08:00
Marcus Schiesser b80f33e264 chore: add opus 4.1 and fix prompt caching (#2155) 2025-08-06 11:54:27 +08:00
Alex Yang b6409b6823 chore: bump openai (#2152)
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
2025-08-06 10:58:45 +08:00
github-actions[bot] db3f556cb4 Release 0.11.26 (#2149)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: marcusschiesser <17126+marcusschiesser@users.noreply.github.com>
2025-08-05 12:00:17 +08:00
Marcus Schiesser 4b5179169b chore: add deprecation to readme (#2150) 2025-08-05 11:53:35 +08:00
abdeliibrahim 971d37ceba fix(deepseek): add 'as const' assertion to DEEPSEEK_MODELS for correct TypeScript inference (#2148)
Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
2025-08-05 10:30:13 +08:00
github-actions[bot] 3e0ffdc688 Release 0.11.25 (#2144)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-31 12:18:18 +08:00
Marcus Schiesser 049471bade chore: deprecate cloud packages (#2143) 2025-07-31 12:12:56 +08:00
338 changed files with 6414 additions and 42834 deletions
@@ -0,0 +1,13 @@
name: Trigger Vercel Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Vercel deployment
run: |
curl -X POST "${{ secrets.DEVELOPER_HUB_DEPLOY_HOOK }}"
+3 -3
View File
@@ -105,6 +105,7 @@ jobs:
run: |
pnpm pack --pack-destination ${{ runner.temp }} -C packages/llamaindex
pnpm pack --pack-destination ${{ runner.temp }} -C packages/workflow
pnpm pack --pack-destination ${{ runner.temp }} -C packages/core
- name: Install packed packages
run: npm add ${{ runner.temp }}/*.tgz
working-directory: e2e/npm
@@ -121,7 +122,6 @@ jobs:
- nextjs-edge-runtime
- nextjs-node-runtime
- waku-query-engine
- llama-parse-browser
- vite-import-llamaindex
runs-on: ubuntu-latest
name: Build LlamaIndex Example (${{ matrix.packages }})
@@ -162,7 +162,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: e2e/examples/vite-import-llamaindex
skip_step: "install"
build_script: build
build_script: ci-build
package_manager: pnpm
typecheck-examples:
@@ -203,7 +203,7 @@ jobs:
fi
done
- name: Install
run: npm add ${{ runner.temp }}/*.tgz
run: npm add ${{ runner.temp }}/*.tgz --legacy-peer-deps
working-directory: ${{ runner.temp }}/examples
- name: Run Type Check
run: npx tsc --project ./tsconfig.json
+90
View File
@@ -1,5 +1,95 @@
# @llamaindex/doc
## 0.2.56
### Patch Changes
- b4c5531: Add initial sonnet 4.5 support
## 0.2.55
### Patch Changes
- Updated dependencies [06f884a]
- Updated dependencies [06f884a]
- Updated dependencies [d493015]
- @llamaindex/core@0.6.22
- @llamaindex/workflow@1.1.24
- llamaindex@0.12.0
- @llamaindex/node-parser@2.0.22
- @llamaindex/openai@0.4.20
- @llamaindex/readers@3.1.21
## 0.2.54
### Patch Changes
- ed37c64: Addition of APAC_ANTHROPIC_CLAUDE_4_SONNET type/record in @llamaindex/aws for APAC support for claude 4 sonnet per issue 2184.
- Updated dependencies [8929dcf]
- Updated dependencies [5da1cda]
- llamaindex@0.11.29
- @llamaindex/core@0.6.21
- @llamaindex/workflow@1.1.23
- @llamaindex/openai@0.4.19
- @llamaindex/cloud@4.1.3
- @llamaindex/node-parser@2.0.21
- @llamaindex/readers@3.1.20
## 0.2.53
### Patch Changes
- Updated dependencies [1995b38]
- Updated dependencies [001a515]
- Updated dependencies [9d7d205]
- @llamaindex/workflow@1.1.22
- @llamaindex/openai@0.4.18
- llamaindex@0.11.28
## 0.2.52
### Patch Changes
- Updated dependencies [0267bb0]
- @llamaindex/core@0.6.20
- @llamaindex/cloud@4.1.2
- llamaindex@0.11.27
- @llamaindex/node-parser@2.0.20
- @llamaindex/openai@0.4.17
- @llamaindex/readers@3.1.19
- @llamaindex/workflow@1.1.21
## 0.2.51
### Patch Changes
- Updated dependencies [4c70376]
- @llamaindex/openai@0.4.16
## 0.2.50
### Patch Changes
- Updated dependencies [b6409b6]
- @llamaindex/openai@0.4.15
## 0.2.49
### Patch Changes
- Updated dependencies [4b51791]
- @llamaindex/cloud@4.1.1
- llamaindex@0.11.26
## 0.2.48
### Patch Changes
- Updated dependencies [049471b]
- Updated dependencies [049471b]
- @llamaindex/cloud@4.1.0
- llamaindex@0.11.25
## 0.2.47
### Patch Changes
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/doc",
"version": "0.2.47",
"version": "0.2.56",
"private": true,
"scripts": {
"postinstall": "fumadocs-mdx",
@@ -15,14 +15,14 @@
"dependencies": {
"@huggingface/transformers": "^3.5.0",
"@icons-pack/react-simple-icons": "^10.1.0",
"@llamaindex/chat-ui-docs": "^0.0.5",
"@llamaindex/cloud": "workspace:*",
"@llamaindex/chat-ui-docs": "^0.1.0",
"llama-cloud-services": "^0.3.5",
"@llamaindex/core": "workspace:*",
"@llamaindex/node-parser": "workspace:*",
"@llamaindex/openai": "workspace:*",
"@llamaindex/readers": "workspace:*",
"@llamaindex/workflow": "workspace:*",
"@llamaindex/workflow-docs": "0.1.1",
"@llamaindex/workflow-docs": "0.1.4",
"@mdx-js/mdx": "^3.1.0",
"@monaco-editor/react": "^4.7.0",
"@next/third-parties": "^15.3.4",
@@ -50,7 +50,7 @@
"hast-util-to-jsx-runtime": "^2.3.2",
"llamaindex": "workspace:*",
"lucide-react": "^0.460.0",
"next": "^15.3.3",
"next": "^15.4.7",
"next-themes": "^0.4.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
+1 -1
View File
@@ -1,8 +1,8 @@
import { upsertBatchPipelineDocumentsApiV1PipelinesPipelineIdDocumentsPut } from "@llamaindex/cloud/api";
import fg from "fast-glob";
import { fileGenerator, remarkDocGen, remarkInstall } from "fumadocs-docgen";
import { remarkAutoTypeTable } from "fumadocs-typescript";
import matter from "gray-matter";
import { upsertBatchPipelineDocumentsApiV1PipelinesPipelineIdDocumentsPut } from "llama-cloud-services/api";
import * as fs from "node:fs/promises";
import path, { relative } from "node:path";
import { fileURLToPath } from "node:url";
-109
View File
@@ -1,109 +0,0 @@
import { ClientMDXContent } from "@/components/mdx";
import { BotMessage } from "@/components/message";
import { Skeleton } from "@/components/ui/skeleton";
import { LlamaCloudRetriever } from "@/deps/cloud";
import { ContextChatEngine } from "@llamaindex/core/chat-engine";
import { Settings } from "@llamaindex/core/global";
import { ChatMessage } from "@llamaindex/core/llms";
import { OpenAI } from "@llamaindex/openai";
import { createAI, createStreamableUI, getMutableAIState } from "ai/rsc";
import { ReactNode } from "react";
Settings.llm = new OpenAI({
model: "gpt-4o",
});
const retriever = new LlamaCloudRetriever({
apiKey: process.env.LLAMA_CLOUD_API_KEY!,
baseUrl: "https://api.cloud.llamaindex.ai/",
pipelineId: process.env.LLAMA_CLOUD_PIPELINE_ID!,
});
const initialAIState = {
messages: [],
} as {
messages: ChatMessage[];
};
export type UIMessage = {
id: number;
display: ReactNode;
};
const initialUIState = {
messages: [],
} as {
messages: UIMessage[];
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const runAsyncFnWithoutBlocking = (fn: (...args: any) => Promise<any>) => {
fn().catch((error) => {
console.error(error);
});
};
export const AIProvider = createAI({
initialAIState,
initialUIState,
actions: {
query: async (message: string): Promise<UIMessage> => {
"use server";
const chatEngine = new ContextChatEngine({ retriever });
const id = Date.now();
const aiState = getMutableAIState<typeof AIProvider>();
aiState.update({
...aiState.get(),
messages: [
...aiState.get().messages,
{
role: "user",
content: message,
},
],
});
const ui = createStreamableUI(
<div className="space-y-2">
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
</div>,
);
runAsyncFnWithoutBlocking(async () => {
const response = await chatEngine.chat({
message,
chatHistory: aiState.get().messages,
stream: true,
});
let content = "";
for await (const { delta } of response) {
content += delta;
ui.update(<ClientMDXContent id={id} content={content} />);
}
ui.done();
aiState.done({
...aiState.get(),
messages: [
...aiState.get().messages,
{
role: "assistant",
content,
},
],
});
});
return {
id,
display: <BotMessage>{ui.value}</BotMessage>,
};
},
},
});
+1 -4
View File
@@ -1,4 +1,3 @@
import { AIProvider } from "@/actions";
import { TooltipProvider } from "@/components/ui/tooltip";
import { GoogleAnalytics, GoogleTagManager } from "@next/third-parties/google";
import { RootProvider } from "fumadocs-ui/provider";
@@ -39,9 +38,7 @@ export default function Layout({ children }: { children: ReactNode }) {
<GoogleTagManager gtmId="GTM-WWRFB36R" />
<body className="flex min-h-screen flex-col">
<TooltipProvider>
<AIProvider>
<RootProvider>{children}</RootProvider>
</AIProvider>
<RootProvider>{children}</RootProvider>
</TooltipProvider>
</body>
<GoogleAnalytics gaId="G-NB9B8LW9W5" />
-143
View File
@@ -1,143 +0,0 @@
"use client";
import type { AIProvider, UIMessage } from "@/actions";
import { UserMessage } from "@/components/message";
import { useActions, useUIState } from "ai/rsc";
import { Info } from "lucide-react";
import { ButtonHTMLAttributes, useState } from "react";
import { Alert, AlertDescription, AlertTitle } from "./ui/alert";
import { Button } from "./ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogOverlay,
DialogPortal,
DialogTitle,
DialogTrigger,
} from "./ui/dialog";
import { Textarea } from "./ui/textarea";
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
type AITriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;
function ChatList({ messages }: { messages: UIMessage[] }) {
if (messages.length === 0) {
return null;
}
return (
<div className="relative mx-auto w-full px-4">
{messages.map((message, index) => (
<div key={index} className="pb-4">
{message.display}
</div>
))}
</div>
);
}
export const AITrigger = (props: AITriggerProps) => {
const [{ messages }, setUIState] = useUIState<typeof AIProvider>();
const { query } = useActions<typeof AIProvider>();
const [inputValue, setInputValue] = useState("");
return (
<Dialog>
<DialogTrigger {...props} />
<DialogPortal>
<DialogOverlay className="bg-fd-background/50 data-[state=closed]:animate-fd-fade-out data-[state=open]:animate-fd-fade-in fixed inset-0 z-50 backdrop-blur-sm" />
<DialogContent
onOpenAutoFocus={(e) => {
document.getElementById("nd-ai-input")?.focus();
e.preventDefault();
}}
className="bg-fd-popover text-fd-popover-foreground data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in fixed left-1/2 z-50 my-[5vh] flex max-h-[90dvh] w-[98vw] max-w-[860px] origin-left -translate-x-1/2 flex-col rounded-lg border shadow-lg focus-visible:outline-none"
>
<DialogHeader>
<DialogTitle className="sr-only">Search AI</DialogTitle>
<DialogDescription className="sr-only">
Ask AI some questions.
</DialogDescription>
<Alert>
<Info className="size-4" />
<AlertTitle>Heads up!</AlertTitle>
<AlertDescription>
Answers from LlamaCloud may be inaccurate, please use with
discretion.
</AlertDescription>
</Alert>
</DialogHeader>
<div className="mt-4 flex-grow overflow-scroll">
<ChatList messages={messages} />
</div>
<form
className="space-y-4 px-4 py-2"
action={async () => {
const value = inputValue.trim();
setInputValue("");
if (!value) return;
// Add user message UI
setUIState((state) => ({
...state,
messages: [
...state.messages,
{
id: Date.now(),
display: <UserMessage>{value}</UserMessage>,
},
],
}));
try {
// Submit and get response message
const responseMessage = await query(value);
setUIState((state) => ({
...state,
messages: [...state.messages, responseMessage],
}));
} catch (error) {
// You may want to show a toast or trigger an error state.
console.error(error);
}
}}
>
<div className="flex w-full flex-row items-center gap-2">
<Textarea
tabIndex={0}
placeholder="Ask AI about documentation."
className="w-full resize-none bg-transparent px-4 focus-within:outline-none sm:text-sm"
onKeyDown={(event) => {
if (event.key === "Enter" && !event.shiftKey) {
event.preventDefault();
event.currentTarget.form?.requestSubmit(null);
}
}}
autoFocus
spellCheck={false}
autoComplete="off"
autoCorrect="off"
name="message"
rows={1}
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
/>
<Tooltip>
<TooltipTrigger asChild>
<Button
type="submit"
size="icon"
disabled={inputValue === ""}
>
<span className="sr-only">Send message</span>
</Button>
</TooltipTrigger>
<TooltipContent>Send message</TooltipContent>
</Tooltip>
</div>
</form>
</DialogContent>
</DialogPortal>
</Dialog>
);
};
@@ -0,0 +1,2 @@
label: Getting Started
collapsed: true
@@ -21,7 +21,7 @@ While the definition of an agentic application is broad, there are several key c
- **Orchestration**: A hierarchical structure of LLMs is used to orchestrate lower-level actions and LLMs.
- **Reflection**: The LLM is used to reflect and validate outputs of previous steps or LLM calls, which can be used to guide the application to the next appropriate step or state.
In LlamaIndex, you can build agentic applications by using the workflows to orchestrate a sequence of steps and LLMs. You can [learn more about workflows](/docs/llamaindex/tutorials/workflows).
In LlamaIndex, you can build agentic applications by using the workflows to orchestrate a sequence of steps and LLMs. You can [learn more about workflows](/typescript/framework/tutorials/workflows).
## Agents
@@ -34,27 +34,27 @@ What this means in practice, is something like:
- If tools are used, the agent will then interpret the tool outputs and use them to inform the next action
- Once the agent stops taking actions, it returns the final output to the user
You can [learn more about agents](/docs/llamaindex/tutorials/basic_agent).
You can [learn more about agents](/typescript/framework/tutorials/basic_agent).
## Retrieval Augmented Generation (RAG)
Retrieval-Augmented Generation (RAG) is a core technique for building data-backed LLM applications with LlamaIndex. It allows LLMs to answer questions about your private data by providing it to the LLM at query time, rather than training the LLM on your data. To avoid sending **all** of your data to the LLM every time, RAG indexes your data and selectively sends only the relevant parts along with your query. You can [learn more about RAG](/docs/llamaindex/tutorials/rag).
Retrieval-Augmented Generation (RAG) is a core technique for building data-backed LLM applications with LlamaIndex. It allows LLMs to answer questions about your private data by providing it to the LLM at query time, rather than training the LLM on your data. To avoid sending **all** of your data to the LLM every time, RAG indexes your data and selectively sends only the relevant parts along with your query. You can [learn more about RAG](/typescript/framework/tutorials/rag).
## Use cases
There are endless use cases for data-backed LLM applications but they can be roughly grouped into four categories:
[**Agents**](/docs/llamaindex/tutorials/basic_agent):
An agent is an automated decision-maker powered by an LLM that interacts with the world via a set of [tools](/docs/llamaindex/modules/agents/tool). Agents can take an arbitrary number of steps to complete a given task, dynamically deciding on the best course of action rather than following pre-determined steps. This gives it additional flexibility to tackle more complex tasks.
[**Agents**](/typescript/framework/tutorials/basic_agent):
An agent is an automated decision-maker powered by an LLM that interacts with the world via a set of [tools](/typescript/framework/modules/agents/tool). Agents can take an arbitrary number of steps to complete a given task, dynamically deciding on the best course of action rather than following pre-determined steps. This gives it additional flexibility to tackle more complex tasks.
[**Workflows**](/docs/llamaindex/tutorials/workflows):
[**Workflows**](/typescript/framework/tutorials/workflows):
A Workflow in LlamaIndex is a specific event-driven abstraction that allows you to orchestrate a sequence of steps and LLMs calls. Workflows can be used to implement any agentic application, and are a core component of LlamaIndex.
[**Structured Data Extraction**](/docs/llamaindex/tutorials/structured_data_extraction):
[**Structured Data Extraction**](/typescript/framework/tutorials/structured_data_extraction):
Pydantic extractors allow you to specify a precise data structure to extract from your data and use LLMs to fill in the missing pieces in a type-safe way. This is useful for extracting structured data from unstructured sources like PDFs, websites, and more, and is key to automating workflows.
[**Query Engines**](/docs/llamaindex/modules/rag/query_engines):
[**Query Engines**](/typescript/framework/modules/rag/query_engines):
A query engine is an end-to-end flow that allows you to ask questions over your data. It takes in a natural language query, and returns a response, along with reference context retrieved and passed to the LLM.
[**Chat Engines**](/docs/llamaindex/modules/rag/chat_engine):
[**Chat Engines**](/typescript/framework/modules/rag/chat_engine):
A chat engine is an end-to-end flow for having a conversation with your data (multiple back-and-forth instead of a single question-and-answer).
@@ -0,0 +1,2 @@
label: Installation
collapsed: true
@@ -138,28 +138,28 @@ Choose your deployment target:
<Card
title="Server APIs & Backends"
description="Express, Fastify, Koa, standalone Node.js servers"
href="/docs/llamaindex/getting_started/installation/server-apis"
href="/typescript/framework/getting_started/installation/server-apis"
/>
<Card
title="Serverless Functions"
description="Vercel, Netlify, AWS Lambda, Cloudflare Workers"
href="/docs/llamaindex/getting_started/installation/serverless"
href="/typescript/framework/getting_started/installation/serverless"
/>
<Card
title="Next.js Applications"
description="API routes, server components, edge runtime"
href="/docs/llamaindex/getting_started/installation/nextjs"
href="/typescript/framework/getting_started/installation/nextjs"
/>
<Card
title="Troubleshooting"
description="Common issues, bundle optimization, compatibility"
href="/docs/llamaindex/getting_started/installation/troubleshooting"
href="/typescript/framework/getting_started/installation/troubleshooting"
/>
</Cards>
## LLM/Embedding Providers
Go to [LLM APIs](/docs/llamaindex/modules/models/llms) and [Embedding APIs](/docs/llamaindex/modules/models/embeddings) to find out how to use different LLM and embedding providers beyond OpenAI.
Go to [LLM APIs](/typescript/framework/modules/models/llms) and [Embedding APIs](/typescript/framework/modules/models/embeddings) to find out how to use different LLM and embedding providers beyond OpenAI.
## What's Next?
@@ -167,11 +167,11 @@ Go to [LLM APIs](/docs/llamaindex/modules/models/llms) and [Embedding APIs](/doc
<Card
title="Learn LlamaIndex.TS"
description="Learn how to use LlamaIndex.TS by starting with one of our tutorials."
href="/docs/llamaindex/tutorials/basic_agent"
href="/typescript/framework/tutorials/basic_agent"
/>
<Card
title="Show me code examples"
description="Explore code examples using LlamaIndex.TS."
href="/docs/llamaindex/getting_started/examples"
href="/typescript/framework/getting_started/examples"
/>
</Cards>
@@ -1,4 +0,0 @@
{
"title": "Installation",
"pages": ["server-apis", "serverless", "nextjs", "troubleshooting"]
}
@@ -400,6 +400,6 @@ export default function ChatInterface() {
## Next Steps
- Learn about [serverless deployment](/docs/llamaindex/getting_started/installation/serverless)
- Explore [server APIs](/docs/llamaindex/getting_started/installation/server-apis)
- Check [troubleshooting guide](/docs/llamaindex/getting_started/installation/troubleshooting) for common issues
- Learn about [serverless deployment](/typescript/framework/getting_started/installation/serverless)
- Explore [server APIs](/typescript/framework/getting_started/installation/server-apis)
- Check [troubleshooting guide](/typescript/framework/getting_started/installation/troubleshooting) for common issues
@@ -206,6 +206,6 @@ app.post('/api/chat-stream', async (req, res) => {
## Next Steps
- Learn about [serverless deployment](/docs/llamaindex/getting_started/installation/serverless)
- Explore [Next.js integration](/docs/llamaindex/getting_started/installation/nextjs)
- Check [troubleshooting guide](/docs/llamaindex/getting_started/installation/troubleshooting) for common issues
- Learn about [serverless deployment](/typescript/framework/getting_started/installation/serverless)
- Explore [Next.js integration](/typescript/framework/getting_started/installation/nextjs)
- Check [troubleshooting guide](/typescript/framework/getting_started/installation/troubleshooting) for common issues
@@ -235,6 +235,6 @@ export const handler: Handler = async (event, context) => {
## Next Steps
- Learn about [Next.js integration](/docs/llamaindex/getting_started/installation/nextjs)
- Explore [server deployment](/docs/llamaindex/getting_started/installation/server-apis)
- Check [troubleshooting guide](/docs/llamaindex/getting_started/installation/troubleshooting) for common issues
- Learn about [Next.js integration](/typescript/framework/getting_started/installation/nextjs)
- Explore [server deployment](/typescript/framework/getting_started/installation/server-apis)
- Check [troubleshooting guide](/typescript/framework/getting_started/installation/troubleshooting) for common issues
@@ -492,9 +492,9 @@ Include:
If you're still experiencing issues:
1. **Check specific deployment guides:**
- [Server APIs](/docs/llamaindex/getting_started/installation/server-apis)
- [Serverless Functions](/docs/llamaindex/getting_started/installation/serverless)
- [Next.js Applications](/docs/llamaindex/getting_started/installation/nextjs)
- [Server APIs](/typescript/framework/getting_started/installation/server-apis)
- [Serverless Functions](/typescript/framework/getting_started/installation/serverless)
- [Next.js Applications](/typescript/framework/getting_started/installation/nextjs)
2. **Open an issue** on GitHub with a minimal reproduction
@@ -1,4 +0,0 @@
{
"title": "Getting Started",
"pages": ["concepts", "installation", "create_llama", "examples"]
}
+12 -12
View File
@@ -43,19 +43,19 @@ Built for modern JavaScript runtimes like <SiNodedotjs className="inline" color=
### What are agents?
[Agents](/docs/llamaindex/tutorials/agents/1_setup) are LLM-powered assistants that can reason, use external tools, and take actions to accomplish tasks such as research, data extraction, and automation.
[Agents](/typescript/framework/tutorials/agents/1_setup) are LLM-powered assistants that can reason, use external tools, and take actions to accomplish tasks such as research, data extraction, and automation.
LlamaIndex.TS provides foundational building blocks for creating and orchestrating these agents.
### What are workflows?
[Workflows](/docs/llamaindex/tutorials/workflows) are multi-step, event-driven processes that combine agents, data connectors, and other tools to solve complex problems.
[Workflows](/typescript/framework/tutorials/workflows) are multi-step, event-driven processes that combine agents, data connectors, and other tools to solve complex problems.
With LlamaIndex.TS you can chain together retrieval, generation, and tool-calling steps and then deploy the entire pipeline as a microservice.
### What is context engineering?
LLMs come pre-trained on vast public corpora, but not on **your** private or domain-specific data.
Context engineering bridges that gap by injecting the right pieces of your data into the LLM prompt at the right time.
The most popular example is [Retrieval-Augmented Generation (RAG)](/docs/llamaindex/getting_started/concepts), but the same idea powers agent memory, evaluation, extraction, summarisation, and more.
The most popular example is [Retrieval-Augmented Generation (RAG)](/typescript/framework/getting_started/concepts), but the same idea powers agent memory, evaluation, extraction, summarisation, and more.
LlamaIndex.TS gives you:
@@ -65,16 +65,16 @@ LlamaIndex.TS gives you:
- **Workflows** for fine-grained orchestration of your data and LLM-powered agents.
- **Observability** integrations so you can iterate with confidence.
You can learn more about these concepts in our [concepts guide](/docs/llamaindex/getting_started/concepts).
You can learn more about these concepts in our [concepts guide](/typescript/framework/getting_started/concepts).
## Use cases
Popular scenarios include:
- [LLM-Powered Agents](/docs/llamaindex/tutorials/agents/1_setup)
- [Indexing and Retrieval](/docs/llamaindex/tutorials/rag)
- [Extracting Structured Data](/docs/llamaindex/tutorials/structured_data_extraction)
- [Custom Orchestration with Workflows](/docs/llamaindex/tutorials/workflows)
- [LLM-Powered Agents](/typescript/framework/tutorials/agents/1_setup)
- [Indexing and Retrieval](/typescript/framework/tutorials/rag)
- [Extracting Structured Data](/typescript/framework/tutorials/structured_data_extraction)
- [Custom Orchestration with Workflows](/typescript/framework/tutorials/workflows)
## Getting started
@@ -89,10 +89,10 @@ The fastest way to get started is in StackBlitz below — no local setup require
Want to learn more? We have several tutorials to get you started:
- [Installation + Runtime Guide](/docs/llamaindex/getting_started/installation)
- [Create your first agent](/docs/llamaindex/tutorials/agents/1_setup)
- [Learn how to index data and chat with it](/docs/llamaindex/tutorials/rag)
- [Learn how to write your own workflows and agents](/docs/llamaindex/tutorials/workflows)
- [Installation + Runtime Guide](/typescript/framework/getting_started/installation)
- [Create your first agent](/typescript/framework/tutorials/agents/1_setup)
- [Learn how to index data and chat with it](/typescript/framework/tutorials/rag)
- [Learn how to write your own workflows and agents](/typescript/framework/tutorials/workflows)
---
@@ -0,0 +1,2 @@
label: Integration
collapsed: true
@@ -1,5 +0,0 @@
{
"title": "Integration",
"description": "See our integrations",
"pages": ["open-llm-metry", "lang-trace", "mcp-toolbox", "vercel"]
}
@@ -38,7 +38,8 @@ Here's how to create a simple vector store index and query it using Vercel's AI
import { openai } from "@ai-sdk/openai";
import { llamaindex } from "@llamaindex/vercel";
import { streamText } from "ai";
import { Document, VectorStoreIndex } from "llamaindex";
import { Document } from "llamaindex";
import { LlamaCloudIndex } from "llama-cloud-services";
// Create an index from your documents
const document = new Document({ text: yourText, id_: "unique-id" });
@@ -69,7 +70,7 @@ streamText({
For production deployments, you can use LlamaCloud to store and manage your documents:
```typescript
import { LlamaCloudIndex } from "@llamaindex/cloud";
import { LlamaCloudIndex } from "llama-cloud-services";
// Create a LlamaCloud index
const index = await LlamaCloudIndex.fromDocuments({
@@ -35,7 +35,7 @@ import { OpenAI } from "@llamaindex/openai";
npm i @llamaindex/openai
```
For more details on available AI model providers and their configuration, see the [LLMs documentation](/docs/llamaindex/modules/models/llms) and the [Embedding Models documentation](/docs/llamaindex/modules/models/embeddings).
For more details on available AI model providers and their configuration, see the [LLMs documentation](/typescript/framework/modules/models/llms) and the [Embedding Models documentation](/typescript/framework/modules/models/embeddings).
### 2. Storage Providers
@@ -49,7 +49,7 @@ Now:
import { PineconeVectorStore } from "@llamaindex/pinecone";
```
For more information about available storage options, refer to the [Data Stores documentation](/docs/llamaindex/modules/data/stores).
For more information about available storage options, refer to the [Data Stores documentation](/typescript/framework/modules/data/stores).
### 3. Data Loaders
@@ -63,7 +63,7 @@ Now:
import { SimpleDirectoryReader } from "@llamaindex/readers/directory";
```
For more details about available data loaders and their usage, check the [Loading Data](/docs/llamaindex/modules/data/readers).
For more details about available data loaders and their usage, check the [Loading Data](/typescript/framework/modules/data/readers).
### 4. Prefer using `llamaindex` instead of `@llamaindex/core`
@@ -0,0 +1,2 @@
label: Migration
collapsed: true
@@ -0,0 +1,2 @@
label: Deprecated
collapsed: true
@@ -0,0 +1,2 @@
label: Agent
collapsed: true
@@ -2,7 +2,7 @@
title: Agents
---
**Note**: Agents are deprecated, use [Agent Workflows](/docs/llamaindex/modules/agents/agent_workflow) instead.
**Note**: Agents are deprecated, use [Agent Workflows](/typescript/framework/modules/agents/agent_workflow) instead.
An “agent” is an automated reasoning and decision engine. It takes in a user input/query and can make internal decisions for executing that query in order to return the correct result. The key agent components can include, but are not limited to:
@@ -1,5 +0,0 @@
{
"title": "Migration",
"description": "Migration between different versions",
"pages": ["0.8-to-0.9", "deprecated"]
}
@@ -0,0 +1,2 @@
label: Modules
collapsed: true
@@ -0,0 +1,2 @@
label: Agents
collapsed: true
@@ -3,7 +3,7 @@ title: Agent Workflows
---
Agent Workflows are a powerful system that enables you to create and orchestrate one or multiple agents with tools to perform specific tasks. It's built on top of the base [`Workflow`](/docs/llamaindex/modules/agents/workflows) system and provides a streamlined interface for agent interactions.
Agent Workflows are a powerful system that enables you to create and orchestrate one or multiple agents with tools to perform specific tasks. It's built on top of the base [`Workflow`](/typescript/framework/modules/agents/workflows) system and provides a streamlined interface for agent interactions.
## Usage
@@ -37,6 +37,58 @@ console.log(result.data.result); // Baby Llama is called cria
console.log(result.data.message); // { role: 'assistant', content: 'Baby Llama is called cria' }
```
### Structured Output
You can extract structured data from agent responses by providing a `responseFormat` with a Zod schema. This is useful when you need the agent's response in a specific format for further processing:
```typescript
import { z } from "zod";
import { tool } from "llamaindex";
import { agent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";
// Define a weather tool
const weatherTool = tool({
name: "weatherTool",
description: "Get weather information",
parameters: z.object({
location: z.string(),
}),
execute: ({ location }) => {
return `The weather in ${location} is sunny. The temperature is 72 degrees. The humidity is 50%. The wind speed is 10 mph.`;
},
});
// Define the structure you want for the response
const responseSchema = z.object({
temperature: z.number(),
humidity: z.number(),
windSpeed: z.number(),
});
// Create the agent
const weatherAgent = agent({
name: "weatherAgent",
tools: [weatherTool],
llm: openai({ model: "gpt-4.1-mini" }),
});
// Run with structured output
const result = await weatherAgent.run("What's the weather in Tokyo?", {
responseFormat: responseSchema,
});
console.log("Natural language result:", result.data.result);
console.log("Structured data:", result.data.object);
// Output: { temperature: 72, humidity: 50, windSpeed: 10 }
```
The agent will:
1. Use the weather tool to get the raw weather information
2. Process that information through the LLM
3. Extract structured data according to your schema
4. Return both the natural language response and the structured object
### Event Streaming
Agent Workflows provide a unified interface for event streaming, making it easy to track and respond to different events during execution:
@@ -7,8 +7,9 @@ Sometimes your need more control over LLM interactions than what high-level agen
## When to Use `llm.exec`
Use `llm.exec` when you need to:
- Build custom agent logic in [workflow](/docs/llamaindex/modules/agents/workflows) steps
- Build custom agent logic in [workflow](/typescript/framework/modules/agents/workflows) steps
- Have precise control over message handling and tool execution
- Extract structured data from LLM responses
## Basic Usage
@@ -51,6 +52,38 @@ messages.push(...newMessages);
> `newMessages` is an array as each tool call generates two messages: a tool call message and the tool call result message.
## Structured Output
You can use `responseFormat` with a Zod schema to get structured data from the LLM response:
```ts
import { openai } from "@llamaindex/openai";
import { ChatMessage } from "llamaindex";
import z from "zod";
const llm = openai({ model: "gpt-4.1-mini" });
const schema = z.object({
title: z.string(),
author: z.string(),
year: z.number(),
});
const messages = [
{
role: "user",
content: "I have been reading La Divina Commedia by Dante Alighieri, published in 1321",
} as ChatMessage,
];
const { newMessages, toolCalls, object } = await llm.exec({
messages,
responseFormat: schema,
});
console.log(object); // { title: "La Divina Commedia", author: "Dante Alighieri", year: 1321 }
```
## Agent Loop Pattern
A common pattern is to use `llm.exec` in a loop until the LLM stops making tool calls:
@@ -102,7 +135,7 @@ For real-time responses, use the `stream` option to get the assistant's response
```ts
import { openai } from "@llamaindex/openai";
import { tool } from "llamaindex";
import { ChatMessage, tool } from "llamaindex";
import z from "zod";
async function streamingAgentLoop() {
@@ -153,6 +186,7 @@ async function streamingAgentLoop() {
- **`newMessages`**: Array of new chat messages including the LLM response and any tool call messages (call or result). This is a function return the array when streaming.
- **`toolCalls`**: Array of tool calls made by the LLM
- **`object`**: The structured object when using `responseFormat` with a Zod schema (undefined if no schema is provided)
- **`stream`**: Async iterable for streaming responses (only when `stream: true`)
## Best Practices
@@ -161,4 +195,4 @@ For using `llm.exec` in an agent loop, take care to:
1. **Maintain message history**: Always add `newMessages` to your conversation history
2. **Set exit conditions**: Implement proper logic to avoid infinite loops
3. **Handle structured output**: When using `responseFormat`, the `object` property contains your parsed data
@@ -1,10 +0,0 @@
{
"title": "Agents",
"pages": [
"tool",
"agent_workflow",
"workflows",
"low-level",
"natural_language_workflow"
]
}
@@ -0,0 +1,2 @@
label: Tool
collapsed: true
@@ -102,7 +102,7 @@ const agent = agent({
```
You can also use [MCP Toolbox for
Databases](/docs/llamaindex/integration/mcp-toolbox) to interact with MCP tools.
Databases](/typescript/framework/integration/mcp-toolbox) to interact with MCP tools.
## Function tool
@@ -0,0 +1,2 @@
label: Data
collapsed: true
@@ -0,0 +1,2 @@
label: Data Index
collapsed: true
@@ -2,7 +2,7 @@
title: Index
---
An index is the basic container for organizing your data. Besides managed indexes using [LlamaCloud](/docs/llamaindex/modules/data/data_index/managed), LlamaIndex.TS supports three indexes:
An index is the basic container for organizing your data. Besides managed indexes using [LlamaCloud](/typescript/framework/modules/data/data_index/managed), LlamaIndex.TS supports three indexes:
- `VectorStoreIndex` - will send the top-k `Node`s to the LLM when generating a response. The default top-k is 2.
@@ -28,5 +28,4 @@ Here's an example of how to use a managed index together with a chat engine:
## API Reference
- [LlamaCloudIndex](/docs/api/classes/LlamaCloudIndex)
- [LlamaCloudRetriever](/docs/api/classes/LlamaCloudRetriever)
- [LlamaCloud Documentation](https://docs.cloud.llamaindex.ai/)
@@ -0,0 +1,2 @@
label: Ingestion Pipeline
collapsed: true
@@ -0,0 +1,2 @@
label: Transformations
collapsed: true
@@ -6,9 +6,9 @@ A transformation is something that takes a list of nodes as an input, and return
Currently, the following components are Transformation objects:
- [SentenceSplitter](/docs/llamaindex/modules/data/ingestion_pipeline/transformations/node-parser)
- [MetadataExtractor](/docs/llamaindex/modules/data/ingestion_pipeline/transformations/metadata_extraction)
- [Embeddings](/docs/llamaindex/modules/models/embeddings)
- [SentenceSplitter](/typescript/framework/modules/data/ingestion_pipeline/transformations/node-parser)
- [MetadataExtractor](/typescript/framework/modules/data/ingestion_pipeline/transformations/metadata_extraction)
- [Embeddings](/typescript/framework/modules/models/embeddings)
## Usage Pattern
@@ -3,7 +3,7 @@ title: Node Parsers / Text Splitters
description: Learn how to use Node Parsers and Text Splitters to extract data from documents.
---
Node parsers are a simple abstraction that take a list of `Document` objects, and chunk them into `Node` objects, such that each node is a specific chunk of the parent document. When a document is broken into nodes, all of it's attributes are inherited to the children nodes (i.e. `metadata`, text and metadata templates, etc.). You can read more about `Node` and `Document` properties [here](/docs/llamaindex/modules/data).
Node parsers are a simple abstraction that take a list of `Document` objects, and chunk them into `Node` objects, such that each node is a specific chunk of the parent document. When a document is broken into nodes, all of it's attributes are inherited to the children nodes (i.e. `metadata`, text and metadata templates, etc.). You can read more about `Node` and `Document` properties [here](/typescript/framework/modules/data).
By default, we will use `Settings.nodeParser` to split the document into nodes. You can also assign a custom `NodeParser` to the `Settings` object.
@@ -0,0 +1,2 @@
label: Memory
collapsed: true
@@ -1,11 +0,0 @@
{
"title": "Data",
"pages": [
"index",
"memory",
"readers",
"data_index",
"ingestion_pipeline",
"stores"
]
}
@@ -0,0 +1,2 @@
label: Readers
collapsed: true
@@ -78,7 +78,7 @@ As the `PDFReader` is not working with the Edge runtime, here's how to use the `
```typescript
import { SimpleDirectoryReader } from "@llamaindex/readers/directory";
import { LlamaParseReader } from "@llamaindex/cloud";
import { LlamaParseReader } from "llama-cloud-services";
export const DATA_DIR = "./data";
@@ -0,0 +1,2 @@
label: Llama Parse
collapsed: true
@@ -7,7 +7,7 @@ LlamaParse `json` mode supports extracting any images found in a page object by
## Installation
```package-install
npm i llamaindex @llamaindex/cloud @llamaindex/openai
npm i llamaindex llama-cloud-services @llamaindex/openai
```
## Usage
@@ -26,7 +26,7 @@ You can create an index across both text and image nodes by requesting alternati
```ts
import { Document, ImageNode, VectorStoreIndex } from "llamaindex";
import { LlamaParseReader } from "@llamaindex/cloud";
import { LlamaParseReader } from "llama-cloud-services";
import { OpenAI } from "@llamaindex/openai";
import { createMessageContent } from "llamaindex";
@@ -7,7 +7,7 @@ In JSON mode, LlamaParse will return a data structure representing the parsed ob
## Installation
```package-install
npm i llamaindex @llamaindex/cloud
npm i llamaindex llama-cloud-services
```
## Usage
@@ -16,7 +16,7 @@ For Json mode, you need to use `loadJson`. The `resultType` is automatically set
More information about indexing the results on the next page.
```ts
import { LlamaParseReader } from "@llamaindex/cloud";
import { LlamaParseReader } from "llama-cloud-services";
const reader = new LlamaParseReader();
async function main() {
@@ -68,7 +68,7 @@ However, a simple work around is to create a new reader class that extends `Llam
```ts
import { Document } from "llamaindex";
import { LlamaParseReader } from "@llamaindex/cloud";
import { LlamaParseReader } from "llama-cloud-services";
class LlamaParseReaderWithJson extends LlamaParseReader {
// Override the loadData method
@@ -0,0 +1,2 @@
label: Stores
collapsed: true
@@ -0,0 +1,2 @@
label: Chat Stores
collapsed: true
@@ -6,7 +6,7 @@ Chat stores manage chat history by storing sequences of messages in a structured
## Available Chat Stores
- [SimpleChatStore](/docs/api/classes/SimpleChatStore): A simple in-memory chat store with support for [persisting](/docs/llamaindex/modules/data/stores#local-storage) data to disk.
- [SimpleChatStore](/docs/api/classes/SimpleChatStore): A simple in-memory chat store with support for [persisting](/typescript/framework/modules/data/stores#local-storage) data to disk.
Check the [LlamaIndexTS Github](https://github.com/run-llama/LlamaIndexTS) for the most up to date overview of integrations.
@@ -0,0 +1,2 @@
label: Doc Stores
collapsed: true
@@ -2,12 +2,12 @@
title: Document Stores
---
Document stores contain ingested document chunks, i.e. [Node](/docs/llamaindex/modules/data)s.
Document stores contain ingested document chunks, i.e. [Node](/typescript/framework/modules/data)s.
## Available Document Stores
- [SimpleDocumentStore](/docs/api/classes/SimpleDocumentStore): A simple in-memory document store with support for [persisting](/docs/llamaindex/modules/data/stores#local-storage) data to disk.
- [PostgresDocumentStore](/docs/api/classes/PostgresDocumentStore): A PostgreSQL document store, see [PostgreSQL Storage](/docs/llamaindex/modules/data/stores#postgresql-storage).
- [SimpleDocumentStore](/docs/api/classes/SimpleDocumentStore): A simple in-memory document store with support for [persisting](/typescript/framework/modules/data/stores#local-storage) data to disk.
- [PostgresDocumentStore](/docs/api/classes/PostgresDocumentStore): A PostgreSQL document store, see [PostgreSQL Storage](/typescript/framework/modules/data/stores#postgresql-storage).
Check the [LlamaIndexTS Github](https://github.com/run-llama/LlamaIndexTS) for the most up to date overview of integrations.
@@ -0,0 +1,2 @@
label: Index Stores
collapsed: true
@@ -2,12 +2,12 @@
title: Index Stores
---
Index stores are underlying storage components that contain metadata(i.e. information created when indexing) about the [index](/docs/llamaindex/modules/data/data_index) itself.
Index stores are underlying storage components that contain metadata(i.e. information created when indexing) about the [index](/typescript/framework/modules/data/data_index) itself.
## Available Index Stores
- [SimpleIndexStore](/docs/api/classes/SimpleIndexStore): A simple in-memory index store with support for [persisting](/docs/llamaindex/modules/data/stores#local-storage) data to disk.
- [PostgresIndexStore](/docs/api/classes/PostgresIndexStore): A PostgreSQL index store, , see [PostgreSQL Storage](/docs/llamaindex/modules/data/stores#postgresql-storage).
- [SimpleIndexStore](/docs/api/classes/SimpleIndexStore): A simple in-memory index store with support for [persisting](/typescript/framework/modules/data/stores#local-storage) data to disk.
- [PostgresIndexStore](/docs/api/classes/PostgresIndexStore): A PostgreSQL index store, , see [PostgreSQL Storage](/typescript/framework/modules/data/stores#postgresql-storage).
Check the [LlamaIndexTS Github](https://github.com/run-llama/LlamaIndexTS) for the most up to date overview of integrations.
@@ -0,0 +1,2 @@
label: Kv Stores
collapsed: true
@@ -2,12 +2,12 @@
title: Key-Value Stores
---
Key-Value Stores represent underlying storage components used in [Document Stores](/docs/llamaindex/modules/data/stores/doc_stores) and [Index Stores](/docs/llamaindex/modules/data/stores/index_stores)
Key-Value Stores represent underlying storage components used in [Document Stores](/typescript/framework/modules/data/stores/doc_stores) and [Index Stores](/typescript/framework/modules/data/stores/index_stores)
## Available Key-Value Stores
- [SimpleKVStore](/docs/api/classes/SimpleKVStore): A simple Key-Value store with support of [persisting](/docs/llamaindex/modules/data/stores#local-storage) data to disk.
- [PostgresKVStore](/docs/api/classes/PostgresKVStore): A PostgreSQL Key-Value store, see [PostgreSQL Storage](/docs/llamaindex/modules/data/stores#postgresql-storage).
- [SimpleKVStore](/docs/api/classes/SimpleKVStore): A simple Key-Value store with support of [persisting](/typescript/framework/modules/data/stores#local-storage) data to disk.
- [PostgresKVStore](/docs/api/classes/PostgresKVStore): A PostgreSQL Key-Value store, see [PostgreSQL Storage](/typescript/framework/modules/data/stores#postgresql-storage).
Check the [LlamaIndexTS Github](https://github.com/run-llama/LlamaIndexTS) for the most up to date overview of integrations.
@@ -0,0 +1,2 @@
label: Vector Stores
collapsed: true
@@ -8,7 +8,7 @@ Vector stores save embedding vectors of your ingested document chunks.
Available Vector Stores are shown on the sidebar to the left. Additionally the following integrations exist without separate documentation:
- [SimpleVectorStore](/docs/api/classes/SimpleVectorStore): A simple in-memory vector store with optional [persistance](/docs/llamaindex/modules/data/stores#local-storage) to disk.
- [SimpleVectorStore](/docs/api/classes/SimpleVectorStore): A simple in-memory vector store with optional [persistance](/typescript/framework/modules/data/stores#local-storage) to disk.
- [AstraDBVectorStore](/docs/api/classes/AstraDBVectorStore): A cloud-native, scalable Database-as-a-Service built on Apache Cassandra, see [datastax.com](https://www.datastax.com/products/datastax-astra)
- [ChromaVectorStore](/docs/api/classes/ChromaVectorStore): An open-source vector database, focused on ease of use and performance, see [trychroma.com](https://www.trychroma.com/)
- [MilvusVectorStore](/docs/api/classes/MilvusVectorStore): An open-source, high-performance, highly scalable vector database, see [milvus.io](https://milvus.io/)
@@ -0,0 +1,2 @@
label: Evaluation
collapsed: true
@@ -29,6 +29,6 @@ These evaluation modules are in the following forms:
## Usage
- [Correctness Evaluator](/docs/llamaindex/modules/evaluation/correctness)
- [Faithfulness Evaluator](/docs/llamaindex/modules/evaluation/faithfulness)
- [Relevancy Evaluator](/docs/llamaindex/modules/evaluation/relevancy)
- [Correctness Evaluator](/typescript/framework/modules/evaluation/correctness)
- [Faithfulness Evaluator](/typescript/framework/modules/evaluation/faithfulness)
- [Relevancy Evaluator](/typescript/framework/modules/evaluation/relevancy)
@@ -1,4 +0,0 @@
{
"title": "Modules",
"pages": ["models", "agents", "data", "rag", "ui", "evaluation"]
}
@@ -0,0 +1,2 @@
label: Models
collapsed: true
@@ -0,0 +1,2 @@
label: Embeddings
collapsed: true
@@ -23,7 +23,7 @@ Settings.embedModel = new OpenAIEmbedding({
## Local Embedding
For local embeddings, you can use the [HuggingFace](/docs/llamaindex/modules/models/embeddings/huggingface) embedding model.
For local embeddings, you can use the [HuggingFace](/typescript/framework/modules/models/embeddings/huggingface) embedding model.
## Local Ollama Embeddings With Remote Host
@@ -0,0 +1,2 @@
label: Llms
collapsed: true
@@ -48,6 +48,9 @@ ANTHROPIC_CLAUDE_3_5_HAIKU = "anthropic.claude-3-5-haiku-20241022-v1:0";
ANTHROPIC_CLAUDE_3_7_SONNET = "anthropic.claude-3-7-sonnet-20250219-v1:0";
ANTHROPIC_CLAUDE_4_SONNET = "anthropic.claude-sonnet-4-20250514-v1:0";
ANTHROPIC_CLAUDE_4_OPUS = "anthropic.claude-opus-4-20250514-v1:0";
ANTHROPIC_CLAUDE_4_1_OPUS = "anthropic.claude-opus-4-1-20250805-v1:0";
ANTHROPIC_CLAUDE_4_5_SONNET = "anthropic.claude-sonnet-4-5-20250929-v1:0";
META_LLAMA2_13B_CHAT = "meta.llama2-13b-chat-v1";
META_LLAMA2_70B_CHAT = "meta.llama2-70b-chat-v1";
@@ -86,6 +89,8 @@ US_ANTHROPIC_CLAUDE_3_5_SONNET_V2 = "us.anthropic.claude-3-5-sonnet-20241022-v2:
US_ANTHROPIC_CLAUDE_3_7_SONNET = "us.anthropic.claude-3-7-sonnet-20250219-v1:0";
US_ANTHROPIC_CLAUDE_4_SONNET = "us.anthropic.claude-sonnet-4-20250514-v1:0";
US_ANTHROPIC_CLAUDE_4_OPUS = "us.anthropic.claude-opus-4-20250514-v1:0";
US_ANTHROPIC_CLAUDE_4_1_OPUS = "us.anthropic.claude-opus-4-1-20250805-v1:0";
US_ANTHROPIC_CLAUDE_4_5_SONNET = "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
US_META_LLAMA_3_2_1B_INSTRUCT = "us.meta.llama3-2-1b-instruct-v1:0";
US_META_LLAMA_3_2_3B_INSTRUCT = "us.meta.llama3-2-3b-instruct-v1:0";
US_META_LLAMA_3_2_11B_INSTRUCT = "us.meta.llama3-2-11b-instruct-v1:0";
@@ -104,6 +109,8 @@ EU_ANTHROPIC_CLAUDE_3_5_SONNET = "eu.anthropic.claude-3-5-sonnet-20240620-v1:0";
EU_ANTHROPIC_CLAUDE_3_7_SONNET = "eu.anthropic.claude-3-7-sonnet-20250219-v1:0";
EU_ANTHROPIC_CLAUDE_4_SONNET = "eu.anthropic.claude-sonnet-4-20250514-v1:0";
EU_ANTHROPIC_CLAUDE_4_OPUS = "eu.anthropic.claude-opus-4-20250514-v1:0";
EU_ANTHROPIC_CLAUDE_4_1_OPUS = "eu.anthropic.claude-opus-4-1-20250805-v1:0";
EU_ANTHROPIC_CLAUDE_4_5_SONNET = "eu.anthropic.claude-sonnet-4-5-20250929-v1:0";
EU_META_LLAMA_3_2_1B_INSTRUCT = "eu.meta.llama3-2-1b-instruct-v1:0";
EU_META_LLAMA_3_2_3B_INSTRUCT = "eu.meta.llama3-2-3b-instruct-v1:0";
EU_AMAZON_NOVA_PREMIER_1 = "eu.amazon.nova-premier-v1:0";
@@ -115,6 +122,7 @@ EU_AMAZON_NOVA_MICRO_1 = "eu.amazon.nova-micro-v1:0";
APAC_ANTHROPIC_CLAUDE_3_5_SONNET = "apac.anthropic.claude-3-5-sonnet-20240620-v1:0";
APAC_ANTHROPIC_CLAUDE_3_5_SONNET_V2 = "apac.anthropic.claude-3-5-sonnet-20241022-v2:0";
APAC_ANTHROPIC_CLAUDE_3_7_SONNET = "apac.anthropic.claude-3-7-sonnet-20250219-v1:0";
APAC_ANTHROPIC_CLAUDE_4_SONNET = "apac.anthropic.claude-sonnet-4-20250514-v1:0";
APAC_ANTHROPIC_CLAUDE_3_HAIKU = "apac.anthropic.claude-3-haiku-20240307-v1:0";
APAC_ANTHROPIC_CLAUDE_3_SONNET = "apac.anthropic.claude-3-sonnet-20240229-v1:0";
APAC_AMAZON_NOVA_PRO_1 = "apac.amazon.nova-pro-v1:0";
@@ -33,7 +33,7 @@ export AZURE_OPENAI_DEPLOYMENT="gpt-4" # or some other deployment name
## Local LLM
For local LLMs, currently we recommend the use of [Ollama](/docs/llamaindex/modules/models/llms/ollama) LLM.
For local LLMs, currently we recommend the use of [Ollama](/typescript/framework/modules/models/llms/ollama) LLM.
## Available LLMs
@@ -1,4 +0,0 @@
{
"title": "Models",
"pages": ["embeddings", "llms", "prompt"]
}
@@ -0,0 +1,2 @@
label: Prompt
collapsed: true
@@ -82,5 +82,5 @@ const response = await queryEngine.query({
## API Reference
- [Response Synthesizer](/docs/llamaindex/modules/rag/response_synthesizer)
- [Response Synthesizer](/typescript/framework/modules/rag/response_synthesizer)
- [CompactAndRefine](/docs/api/classes/CompactAndRefine)
@@ -0,0 +1,2 @@
label: RAG
collapsed: true
@@ -1,11 +0,0 @@
{
"title": "RAG",
"pages": [
"retriever",
"response_synthesizer",
"query_engines",
"chat_engine",
"node_postprocessors",
"evaluation"
]
}
@@ -0,0 +1,2 @@
label: Node Postprocessors
collapsed: true
@@ -0,0 +1,2 @@
label: Query Engines
collapsed: true
@@ -4,7 +4,6 @@ title: Retriever
A retriever in LlamaIndex is what is used to fetch `Node`s from an index using a query string.
- [LlamaCloudRetriever](/docs/api/classes/LlamaCloudRetriever) to retrieve nodes from a [managed index](/docs/llamaindex/modules/data/data_index/managed)
- [VectorIndexRetriever](/docs/api/classes/VectorIndexRetriever) will fetch the top-k most similar nodes. Ideal for dense retrieval to find most relevant nodes.
- [SummaryIndexRetriever](/docs/api/classes/SummaryIndexRetriever) will fetch all nodes no matter the query. Ideal when complete context is necessary, e.g. analyzing large datasets.
- [SummaryIndexLLMRetriever](/docs/api/classes/SummaryIndexLLMRetriever) utilizes an LLM to score and filter nodes based on relevancy to the query.
@@ -0,0 +1,2 @@
label: Chat UI
collapsed: true
@@ -5,7 +5,7 @@ description: Running LlamaIndex workflows with both API endpoints and a user int
# LlamaIndex Server
LlamaIndexServer is a Next.js-based application that allows you to quickly launch your [LlamaIndex Workflows](https://ts.llamaindex.ai/docs/llamaindex/modules/agents/workflows) and [Agent Workflows](https://ts.llamaindex.ai/docs/llamaindex/modules/agents/agent_workflow) as an API server with an optional chat UI. It provides a complete environment for running LlamaIndex workflows with both API endpoints and a user interface for interaction.
LlamaIndexServer is a Next.js-based application that allows you to quickly launch your [LlamaIndex Workflows](https://ts.llamaindex.ai/typescript/framework/modules/agents/workflows) and [Agent Workflows](https://ts.llamaindex.ai/typescript/framework/modules/agents/agent_workflow) as an API server with an optional chat UI. It provides a complete environment for running LlamaIndex workflows with both API endpoints and a user interface for interaction.
## Features
@@ -1,6 +0,0 @@
{
"title": "Chat UI",
"description": "Use chat-ui to add a chat interface to your LlamaIndexTS application.",
"defaultOpen": false,
"pages": ["index", "llamaindex-server"]
}
@@ -0,0 +1,2 @@
label: Tutorials
collapsed: true
@@ -0,0 +1,2 @@
label: Agent with RAG
collapsed: true
@@ -1,12 +0,0 @@
{
"title": "Agent with RAG",
"pages": [
"1_setup",
"2_create_agent",
"3_local_model",
"4_agentic_rag",
"5_rag_and_tools",
"6_llamaparse",
"7_qdrant"
]
}
@@ -2,7 +2,7 @@
title: Basic Agent
---
We have a comprehensive, step-by-step [guide to building agents in LlamaIndex.TS](/docs/llamaindex/tutorials/agents/1_setup) that we recommend to learn what agents are and how to build them for production. But building a basic agent is simple:
We have a comprehensive, step-by-step [guide to building agents in LlamaIndex.TS](/typescript/framework/tutorials/agents/1_setup) that we recommend to learn what agents are and how to build them for production. But building a basic agent is simple:
## Set up
@@ -0,0 +1,47 @@
---
title: Custom Model Per Request
---
There are scenarios, such as the case of a multi-tenant backend API, where it may be required to handle each request with a custom model.
In such a scenario, modifying the `Settings` object directly as follows is not recommended:
```typescript
import { Settings } from 'llamaindex';
import { OpenAIEmbedding } from '@llamaindex/embeddings-openai';
Settings.embedModel = new OpenAIEmbedding({ apiKey: 'CLIENT_API_KEY' });
Settings.llm = openai({ apiKey: key, model: 'gpt-4o' })
```
Setting `llm` and `embedModel` directly will lead to unpredictable responses, since `Settings` is global and mutable.
This can lead to race conditions, as each request modifies `Settings.embedModel` or `Settings.llm`.
The recommended approach is to use `Settings.withEmbedModel` or `Settings.withLLM` as follows:
```typescript
const embedModel = new OpenAIEmbedding({
apiKey: process.env.OPENAI_API_KEY,
});
const llm = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const llmResponse = await Settings.withEmbedModel(embedModel, async () => {
return Settings.withLLM(llm, async () => {
const path = "node_modules/llamaindex/examples/abramov.txt";
const essay = await fs.readFile(path, "utf-8");
// Create Document object with essay
const document = new Document({ text: essay, id_: path });
// Split text and create embeddings. Store them in a VectorStoreIndex
const index = await VectorStoreIndex.fromDocuments([document]);
// Query the index
const queryEngine = index.asQueryEngine();
const { message, sourceNodes } = await queryEngine.query({
query: "What did the author do in college?",
});
// Return response with sources
return message.content;
});
});
```
The full example can be found [here](https://github.com/run-llama/LlamaIndexTS/tree/main/examples/local-settings).
@@ -2,7 +2,7 @@
title: Local LLMs
---
LlamaIndex.TS supports OpenAI and [other remote LLM APIs](/docs/llamaindex/modules/models/llms). You can also run a local LLM on your machine!
LlamaIndex.TS supports OpenAI and [other remote LLM APIs](/typescript/framework/modules/models/llms). You can also run a local LLM on your machine!
## Using a local model via Ollama
@@ -93,4 +93,4 @@ async function main() {
main().catch(console.error);
```
You can see the [full example file](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/vectorIndexLocal.ts).
You can see the [full example file](https://github.com/run-llama/LlamaIndexTS/blob/main/examples/index/vectorIndexLocal.ts).
@@ -1,12 +0,0 @@
{
"title": "Tutorials",
"pages": [
"basic_agent",
"rag",
"agents",
"workflows",
"local_llm",
"chatbot",
"structured_data_extraction"
]
}
@@ -0,0 +1,2 @@
label: Rag
collapsed: true
@@ -30,12 +30,12 @@ LlamaIndex.TS help you prepare the knowledge base with a suite of data connector
![](/_static/concepts/indexing.jpg)
[**Data Loaders**](/docs/llamaindex/modules/data/readers):
[**Data Loaders**](/typescript/framework/modules/data/readers):
A data connector (i.e. `Reader`) ingest data from different data sources and data formats into a simple `Document` representation (text and simple metadata).
[**Documents / Nodes**](/docs/llamaindex/modules/data): A `Document` is a generic container around any data source - for instance, a PDF, an API output, or retrieved data from a database. A `Node` is the atomic unit of data in LlamaIndex and represents a "chunk" of a source `Document`. It's a rich representation that includes metadata and relationships (to other nodes) to enable accurate and expressive retrieval operations.
[**Documents / Nodes**](/typescript/framework/modules/data): A `Document` is a generic container around any data source - for instance, a PDF, an API output, or retrieved data from a database. A `Node` is the atomic unit of data in LlamaIndex and represents a "chunk" of a source `Document`. It's a rich representation that includes metadata and relationships (to other nodes) to enable accurate and expressive retrieval operations.
[**Data Indexes**](/docs/llamaindex/modules/data/data_index):
[**Data Indexes**](/typescript/framework/modules/data/data_index):
Once you've ingested your data, LlamaIndex helps you index data into a format that's easy to retrieve.
Under the hood, LlamaIndex parses the raw documents into intermediate representations, calculates vector embeddings, and stores your data in-memory or to disk.
@@ -58,19 +58,19 @@ These building blocks can be customized to reflect ranking preferences, as well
#### Building Blocks
[**Retrievers**](/docs/llamaindex/modules/rag/retriever):
[**Retrievers**](/typescript/framework/modules/rag/retriever):
A retriever defines how to efficiently retrieve relevant context from a knowledge base (i.e. index) when given a query.
The specific retrieval logic differs for different indices, the most popular being dense retrieval against a vector index.
[**Response Synthesizers**](/docs/llamaindex/modules/rag/response_synthesizer):
[**Response Synthesizers**](/typescript/framework/modules/rag/response_synthesizer):
A response synthesizer generates a response from an LLM, using a user query and a given set of retrieved text chunks.
#### Pipelines
[**Query Engines**](/docs/llamaindex/modules/rag/query_engines):
[**Query Engines**](/typescript/framework/modules/rag/query_engines):
A query engine is an end-to-end pipeline that allow you to ask question over your data.
It takes in a natural language query, and returns a response, along with reference context retrieved and passed to the LLM.
[**Chat Engines**](/docs/llamaindex/modules/rag/chat_engine):
[**Chat Engines**](/typescript/framework/modules/rag/chat_engine):
A chat engine is an end-to-end pipeline for having a conversation with your data
(multiple back-and-forth instead of a single question & answer).
@@ -2,7 +2,7 @@
title: Retrieval Augmented Generation (RAG)
---
One of the most common use-cases for LlamaIndex is Retrieval-Augmented Generation or RAG, in which your data is indexed and selectively retrieved to be given to an LLM as source material for responding to a query. You can learn more about the [concepts behind RAG](/docs/llamaindex/tutorials/rag/concepts).
One of the most common use-cases for LlamaIndex is Retrieval-Augmented Generation or RAG, in which your data is indexed and selectively retrieved to be given to an LLM as source material for responding to a query. You can learn more about the [concepts behind RAG](/typescript/framework/tutorials/rag/concepts).
## Set up the project
@@ -14,9 +14,9 @@ npm i -D typescript @types/node
npm i llamaindex
```
Then, check out the [installation](/docs/llamaindex/getting_started/installation) steps to install LlamaIndex.TS and prepare an OpenAI key.
Then, check out the [installation](/typescript/framework/getting_started/installation) steps to install LlamaIndex.TS and prepare an OpenAI key.
You can use [other LLMs](/docs/llamaindex/modules/models/llms) via their APIs; if you would prefer to use local models check out our [local LLM example](/docs/llamaindex/tutorials/local_llm).
You can use [other LLMs](/typescript/framework/modules/models/llms) via their APIs; if you would prefer to use local models check out our [local LLM example](/typescript/framework/tutorials/local_llm).
## Run queries
@@ -2,9 +2,9 @@
title: Structured data extraction
---
Make sure you have installed LlamaIndex.TS and have an OpenAI key. If you haven't, check out the [installation](/docs/llamaindex/getting_started/installation) guide.
Make sure you have installed LlamaIndex.TS and have an OpenAI key. If you haven't, check out the [installation](/typescript/framework/getting_started/installation) guide.
You can use [other LLMs](/docs/llamaindex/modules/models/llms) via their APIs; if you would prefer to use local models check out our [local LLM example](/docs/llamaindex/tutorials/local_llm).
You can use [other LLMs](/typescript/framework/modules/models/llms) via their APIs; if you would prefer to use local models check out our [local LLM example](/typescript/framework/tutorials/local_llm).
## Set up
@@ -46,3 +46,31 @@ You should expect output something like:
]
}
```
## Using the `exec` method
Many LLMs do not natively support structured output, and often rely exclusively on prompt or context engineering.
In this sense, we proved you with an alternative for structured data extraction, using the `exec` method with `responseFormat`.
For example, you can, in a new folder, install our Anthropic integration and `zod` v3:
```package-install
npm init
npm i -D typescript @types/node
npm i @llamaindex/anthropic zod@3.25.76
```
And then try extracting data with this code:
<include cwd>../../examples/agents/tools/response-format-exec.ts</include>
The output should look like this:
```json
{
"title": "La Divina Commedia",
"author": "Dante Alighieri",
"year": 1321
}
```
@@ -173,4 +173,4 @@ You can combine these utilities with other stream operators like `filter` and `m
## Next Steps
To learn more about workflows, check out [the Workflows documentation](/docs/llamaindex/modules/agents/workflows).
To learn more about workflows, check out [the Workflows documentation](/typescript/framework/modules/agents/workflows).
-96
View File
@@ -1,96 +0,0 @@
import {
type MetadataFilter,
type MetadataFilters,
type RetrievalParams,
runSearchApiV1PipelinesPipelineIdRetrievePost,
type TextNodeWithScore,
} from "@llamaindex/cloud/api";
import { QueryBundle } from "@llamaindex/core/query-engine";
import { BaseRetriever } from "@llamaindex/core/retriever";
import { jsonToNode, NodeWithScore, ObjectType } from "@llamaindex/core/schema";
import { extractText } from "@llamaindex/core/utils";
export type CloudRetrieveParams = Omit<
RetrievalParams,
"query" | "search_filters" | "dense_similarity_top_k"
> & { similarityTopK?: number; filters?: MetadataFilters };
export type LlamaCloudRetrieverParams = {
apiKey: string;
baseUrl: string;
pipelineId: string;
} & CloudRetrieveParams;
export class LlamaCloudRetriever extends BaseRetriever {
baseUrl: string;
apiKey: string;
retrieveParams: CloudRetrieveParams;
organizationId?: string;
pipelineId: string;
private resultNodesToNodeWithScore(
nodes: TextNodeWithScore[],
): NodeWithScore[] {
return nodes.map((node: TextNodeWithScore) => {
const textNode = jsonToNode(node.node, ObjectType.TEXT);
textNode.metadata = {
...textNode.metadata,
...node.node.extra_info,
};
return {
node: textNode,
score: node.score ?? undefined,
};
});
}
private convertFilter(filters?: MetadataFilters): MetadataFilters | null {
if (!filters) return null;
const processFilter = (
filter: MetadataFilter | MetadataFilters,
): MetadataFilter | MetadataFilters => {
if ("filters" in filter) {
// type MetadataFilters
return { ...filter, filters: filter.filters.map(processFilter) };
}
return { ...filter, value: filter.value ?? null };
};
return { ...filters, filters: filters.filters.map(processFilter) };
}
constructor(params: LlamaCloudRetrieverParams) {
super();
this.baseUrl = params.baseUrl;
this.apiKey = params.apiKey;
this.retrieveParams = params;
this.pipelineId = params.pipelineId;
}
override async _retrieve(query: QueryBundle): Promise<NodeWithScore[]> {
const filters = this.convertFilter(this.retrieveParams.filters);
const pipelineId = this.pipelineId;
const { data: results } =
await runSearchApiV1PipelinesPipelineIdRetrievePost({
throwOnError: true,
path: {
pipeline_id: pipelineId,
},
baseUrl: this.baseUrl,
body: {
...this.retrieveParams,
query: extractText(query),
search_filters: filters,
dense_similarity_top_k: this.retrieveParams.similarityTopK!,
},
headers: {
authorization: `Bearer ${this.apiKey}`,
},
});
return this.resultNodesToNodeWithScore(results.retrieval_nodes);
}
}
+1 -1
View File
@@ -15,6 +15,6 @@
"wrangler": "^3.89.0"
},
"dependencies": {
"hono": "^4.6.11"
"hono": "^4.9.7"
}
}
@@ -1,5 +1,44 @@
# @llamaindex/cloudflare-worker-agent-test
## 0.0.191
### Patch Changes
- Updated dependencies [d493015]
- llamaindex@0.12.0
## 0.0.190
### Patch Changes
- Updated dependencies [8929dcf]
- llamaindex@0.11.29
## 0.0.189
### Patch Changes
- llamaindex@0.11.28
## 0.0.188
### Patch Changes
- llamaindex@0.11.27
## 0.0.187
### Patch Changes
- llamaindex@0.11.26
## 0.0.186
### Patch Changes
- Updated dependencies [049471b]
- llamaindex@0.11.25
## 0.0.185
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.185",
"version": "0.0.191",
"type": "module",
"private": true,
"scripts": {
@@ -1,24 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
@@ -1,537 +0,0 @@
# @llamaindex/llama-parse-browser-test
## 0.0.83
### Patch Changes
- Updated dependencies [c3bf3c7]
- @llamaindex/cloud@4.0.28
## 0.0.82
### Patch Changes
- @llamaindex/cloud@4.0.27
## 0.0.81
### Patch Changes
- @llamaindex/cloud@4.0.26
## 0.0.80
### Patch Changes
- Updated dependencies [2967d57]
- @llamaindex/cloud@4.0.25
## 0.0.79
### Patch Changes
- @llamaindex/cloud@4.0.24
## 0.0.78
### Patch Changes
- Updated dependencies [a1b1598]
- @llamaindex/cloud@4.0.23
## 0.0.77
### Patch Changes
- Updated dependencies [d2be868]
- @llamaindex/cloud@4.0.22
## 0.0.76
### Patch Changes
- Updated dependencies [579ca0c]
- @llamaindex/cloud@4.0.21
## 0.0.75
### Patch Changes
- Updated dependencies [48b0d88]
- Updated dependencies [f185772]
- @llamaindex/cloud@4.0.20
## 0.0.74
### Patch Changes
- Updated dependencies [5a0ed1f]
- Updated dependencies [5a0ed1f]
- @llamaindex/cloud@4.0.19
## 0.0.73
### Patch Changes
- Updated dependencies [47a7555]
- @llamaindex/cloud@4.0.18
## 0.0.72
### Patch Changes
- @llamaindex/cloud@4.0.17
## 0.0.71
### Patch Changes
- @llamaindex/cloud@4.0.16
## 0.0.70
### Patch Changes
- @llamaindex/cloud@4.0.15
## 0.0.69
### Patch Changes
- @llamaindex/cloud@4.0.14
## 0.0.68
### Patch Changes
- @llamaindex/cloud@4.0.13
## 0.0.67
### Patch Changes
- @llamaindex/cloud@4.0.12
## 0.0.66
### Patch Changes
- Updated dependencies [76ff23d]
- @llamaindex/cloud@4.0.11
## 0.0.65
### Patch Changes
- @llamaindex/cloud@4.0.10
## 0.0.64
### Patch Changes
- Updated dependencies [3703f90]
- @llamaindex/cloud@4.0.9
## 0.0.63
### Patch Changes
- @llamaindex/cloud@4.0.8
## 0.0.62
### Patch Changes
- Updated dependencies [40f5f41]
- @llamaindex/cloud@4.0.7
## 0.0.61
### Patch Changes
- @llamaindex/cloud@4.0.6
## 0.0.60
### Patch Changes
- Updated dependencies [2225ffd]
- @llamaindex/cloud@4.0.5
## 0.0.59
### Patch Changes
- @llamaindex/cloud@4.0.4
## 0.0.58
### Patch Changes
- Updated dependencies [41191d0]
- @llamaindex/cloud@4.0.3
## 0.0.57
### Patch Changes
- @llamaindex/cloud@4.0.2
## 0.0.56
### Patch Changes
- @llamaindex/cloud@4.0.1
## 0.0.55
### Patch Changes
- Updated dependencies [bf56fc0]
- Updated dependencies [5189b44]
- @llamaindex/cloud@4.0.0
## 0.0.54
### Patch Changes
- @llamaindex/cloud@3.0.9
## 0.0.53
### Patch Changes
- @llamaindex/cloud@3.0.8
## 0.0.52
### Patch Changes
- @llamaindex/cloud@3.0.7
## 0.0.51
### Patch Changes
- @llamaindex/cloud@3.0.6
## 0.0.50
### Patch Changes
- @llamaindex/cloud@3.0.5
## 0.0.49
### Patch Changes
- @llamaindex/cloud@3.0.4
## 0.0.48
### Patch Changes
- @llamaindex/cloud@3.0.3
## 0.0.47
### Patch Changes
- Updated dependencies [c902fcb]
- @llamaindex/cloud@3.0.2
## 0.0.46
### Patch Changes
- @llamaindex/cloud@3.0.1
## 0.0.45
### Patch Changes
- @llamaindex/cloud@3.0.0
## 0.0.44
### Patch Changes
- Updated dependencies [1c908fd]
- @llamaindex/cloud@2.0.24
## 0.0.43
### Patch Changes
- Updated dependencies [cb608b5]
- @llamaindex/cloud@2.0.23
## 0.0.42
### Patch Changes
- Updated dependencies [d6c270e]
- @llamaindex/cloud@2.0.22
## 0.0.41
### Patch Changes
- Updated dependencies [5dec9f9]
- Updated dependencies [fd9c829]
- @llamaindex/cloud@2.0.21
## 0.0.40
### Patch Changes
- Updated dependencies [012495b]
- @llamaindex/cloud@2.0.20
## 0.0.39
### Patch Changes
- @llamaindex/cloud@2.0.19
## 0.0.38
### Patch Changes
- @llamaindex/cloud@2.0.18
## 0.0.37
### Patch Changes
- @llamaindex/cloud@2.0.17
## 0.0.36
### Patch Changes
- Updated dependencies [8be4589]
- @llamaindex/cloud@2.0.16
## 0.0.35
### Patch Changes
- @llamaindex/cloud@2.0.15
## 0.0.34
### Patch Changes
- @llamaindex/cloud@2.0.14
## 0.0.33
### Patch Changes
- Updated dependencies [90d265c]
- @llamaindex/cloud@2.0.13
## 0.0.32
### Patch Changes
- @llamaindex/cloud@2.0.12
## 0.0.31
### Patch Changes
- @llamaindex/cloud@2.0.11
## 0.0.30
### Patch Changes
- @llamaindex/cloud@2.0.10
## 0.0.29
### Patch Changes
- @llamaindex/cloud@2.0.9
## 0.0.28
### Patch Changes
- @llamaindex/cloud@2.0.8
## 0.0.27
### Patch Changes
- @llamaindex/cloud@2.0.7
## 0.0.26
### Patch Changes
- @llamaindex/cloud@2.0.6
## 0.0.25
### Patch Changes
- @llamaindex/cloud@2.0.5
## 0.0.24
### Patch Changes
- @llamaindex/cloud@2.0.4
## 0.0.23
### Patch Changes
- @llamaindex/cloud@2.0.3
## 0.0.22
### Patch Changes
- @llamaindex/cloud@2.0.2
## 0.0.21
### Patch Changes
- @llamaindex/cloud@2.0.1
## 0.0.20
### Patch Changes
- @llamaindex/cloud@2.0.0
## 0.0.19
### Patch Changes
- @llamaindex/cloud@1.0.8
## 0.0.18
### Patch Changes
- @llamaindex/cloud@1.0.7
## 0.0.17
### Patch Changes
- @llamaindex/cloud@1.0.6
## 0.0.16
### Patch Changes
- @llamaindex/cloud@1.0.5
## 0.0.15
### Patch Changes
- Updated dependencies [06f632b]
- @llamaindex/cloud@1.0.4
## 0.0.14
### Patch Changes
- @llamaindex/cloud@1.0.3
## 0.0.13
### Patch Changes
- @llamaindex/cloud@1.0.2
## 0.0.12
### Patch Changes
- Updated dependencies [4c38c1b]
- Updated dependencies [24d065f]
- Updated dependencies [a75af83]
- @llamaindex/cloud@1.0.1
## 0.0.11
### Patch Changes
- @llamaindex/cloud@1.0.0
## 0.0.10
### Patch Changes
- @llamaindex/cloud@0.2.14
## 0.0.9
### Patch Changes
- @llamaindex/cloud@0.2.13
## 0.0.8
### Patch Changes
- @llamaindex/cloud@0.2.12
## 0.0.7
### Patch Changes
- Updated dependencies [0b20ff9]
- @llamaindex/cloud@0.2.11
## 0.0.6
### Patch Changes
- Updated dependencies [981811e]
- @llamaindex/cloud@0.2.10
## 0.0.5
### Patch Changes
- Updated dependencies [df441e2]
- @llamaindex/cloud@0.2.9
## 0.0.4
### Patch Changes
- Updated dependencies [ac41ed3]
- @llamaindex/cloud@0.2.8
## 0.0.3
### Patch Changes
- Updated dependencies [fb36eff]
- Updated dependencies [d24d3d1]
- @llamaindex/cloud@0.2.7
## 0.0.2
### Patch Changes
- Updated dependencies [b42adeb]
- @llamaindex/cloud@0.2.6
## 0.0.1
### Patch Changes
- Updated dependencies [85c2e19]
- @llamaindex/cloud@0.2.5
-111
View File
@@ -1,111 +0,0 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with the LlamaParse Browser Test example.
## Package Overview
The `@llamaindex/llama-parse-browser-test` package is a minimal browser-based example that demonstrates how to use LlamaParse (from `@llamaindex/cloud`) in a web browser environment. This serves as both an integration test and a reference implementation for browser compatibility with LlamaIndexTS cloud services.
## Purpose
This example validates that:
- `@llamaindex/cloud` package works correctly in browser environments
- LlamaParse functionality can be bundled and run in web applications
- The build process properly handles WASM dependencies and browser-specific requirements
- TypeScript compilation works with DOM APIs and modern bundler tooling
## Development Commands
- `npm run dev` - Start Vite development server with hot reload
- `npm run build` - Build for production (TypeScript compilation + Vite build)
- `npm run preview` - Preview the production build locally
## Architecture
### Build Setup
**Bundler**: Vite 6.x with TypeScript support
**WASM Support**: Uses `vite-plugin-wasm` for WebAssembly module handling
**Module System**: ESM-only (`"type": "module"`)
**Target Environment**: Modern browsers (ES2020+)
### Key Configuration
**Vite Config (`vite.config.ts`):**
- `vite-plugin-wasm` - Enables WASM module imports
- `ssr.external: ["tiktoken"]` - Excludes tiktoken from SSR bundling (browser-only)
**TypeScript Config (`tsconfig.json`):**
- Extends root monorepo TypeScript configuration
- DOM and DOM.Iterable libraries enabled for browser APIs
- Bundler module resolution for optimal Vite integration
- References `@llamaindex/cloud` package for type checking
### Application Structure
**Entry Point (`src/main.ts`):**
- Imports `LlamaParseReader` from `@llamaindex/cloud`
- Instantiates the reader to test browser compatibility
- Minimal DOM manipulation for visual feedback
**Styling (`src/style.css`):**
- Modern CSS with light/dark theme support
- Responsive design with flexbox layout
- Clean, minimal UI suitable for testing environment
**HTML (`index.html`):**
- Standard Vite HTML template
- Single-page application structure
- Module script loading for ES6 imports
## Dependencies
**Core Dependency:**
- `@llamaindex/cloud` (workspace) - LlamaCloud integration including LlamaParse
**Development Dependencies:**
- `vite` - Modern build tool and development server
- `vite-plugin-wasm` - WebAssembly support for Vite
- `typescript` - TypeScript compiler and language support
## Testing Integration
This example functions as an end-to-end test by:
1. **Import Validation**: Verifies `@llamaindex/cloud` can be imported in browser context
2. **Instantiation Testing**: Tests that `LlamaParseReader` can be created without errors
3. **Bundle Compatibility**: Ensures the build process handles all dependencies correctly
4. **Runtime Verification**: Validates the application loads and runs in actual browsers
## Browser Compatibility
The application targets modern browsers with:
- ES2020 language features
- ES Modules support
- WebAssembly support (for potential WASM dependencies)
- Modern DOM APIs
## Development Notes
- **Minimal Implementation**: Keeps the example simple to focus on integration testing
- **Cloud Service Focus**: Specifically tests browser compatibility with LlamaCloud services
- **Build Validation**: Ensures the build process works end-to-end without browser-specific issues
- **WASM Preparation**: Configured for WASM dependencies even if not currently used
- **Type Safety**: Full TypeScript integration with proper DOM type definitions
## Common Issues
- **WASM Loading**: The `vite-plugin-wasm` handles WebAssembly module loading complexities
- **SSR Exclusions**: Tiktoken is excluded from SSR to prevent Node.js-specific dependencies in browser builds
- **Module Resolution**: Uses bundler module resolution for optimal compatibility with modern web tooling
This example serves as a foundation for integrating LlamaIndexTS cloud services into web applications and validates that the core cloud functionality works correctly in browser environments.

Some files were not shown because too many files have changed in this diff Show More