This is a LlamaIndex project bootstrapped with create-llama.
First, install the dependencies:
npm install
Then check the parameters that have been pre-configured in the .env file in this directory.
Make sure you have set the OPENAI_API_KEY for the LLM.
Second, generate the embeddings of the example documents in the ./data directory:
npm run generate
Third, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the chat UI.
You can configure LLM model and embedding model in the settings file.
We have prepared an example workflow for the agentic RAG use case, where you can ask questions about the example documents in the ./data directory.
You can start by sending an request on the chat UI or you can test the /api/chat endpoint with the following curl request:
curl --location 'localhost:3000/api/chat' \
--header 'Content-Type: application/json' \
--data '{ "messages": [{ "role": "user", "content": "What standards for a letter exist?" }] }'If you want to fully customize the server UI and routes, you can use npm eject. It will create a normal Next.js project with the same functionality as @llamaindex/server.
npm run ejectTo learn more about LlamaIndex, take a look at the following resources:
- LlamaIndex Documentation - learn about LlamaIndex (Python features).
- LlamaIndexTS Documentation - learn about LlamaIndex (Typescript features).
- Agent Workflows Introduction - learn about LlamaIndexTS Agent Workflows.
You can check out the LlamaIndexTS GitHub repository - your feedback and contributions are welcome!