Ask questions from your personal knowledgebase
- OpenAI API Key
- AstraDB credentials
- Access Token
- DataBase Endpoint
Run the following command to clone the repo
git clone https://github.com/harshil1712/langchain-astradb.git
Navigate into the project directory and run the following command to install the required dependencies
npm run install
Rename the .env.example
file to .env.local
. Add your credentials in the .env.local
file.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
Create a Severless Vector Database if you don't already have one. Next, navigate to the /api/createCollection
. This will create a new collection called demo
in your database.
To create embeds and ingest the vectors, navigate to the /api/ingestData
endpoint.
This endpoint will use the content from ./data/blog
folder.
Navigate to the homepage. You can now ask questions to your assistant!
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- AstraDB
- Vercel AI SDK
- LangChain - an interactive Next.js tutorial.
Check out the Next.js deployment documentation for more details.