= Build an Neo4j-backed Chatbot using TypeScript
This repository accompanies the link:https://graphacademy.neo4j.com/courses/llm-chatbot-typescript/?ref=github[Build an Neo4j-backed Chatbot using TypeScript^] course on link:https://graphacademy.neo4j.com/?ref=github[Neo4j GraphAcademy^].
It was originally link:https://nextjs.org/[Next.js] project bootstrapped with link:https://github.com/vercel/next.js/tree/canary/packages/create-next-app[`create-next-app`]. We added:
- link:https://tailwindcss.com/docs/guides/nextjs[TailwindCSS^]
- link:src/pages/api/[A
/api/chatAPI route for handling chat requests^] - link:src/hooks[A React hook for calling the
/api/chatendpoint^] - link:src/components[some chat components to display the messages].
For a complete walkthrough of this repository, link:https://graphacademy.neo4j.com/courses/llm-chatbot-typescript/?ref=github[enrol now^].
== Setup your Config
To set config, create a .env.local with connection details for your Neo4j Sandbox instance and an OpenAI API Key.
You can also configure the name and description of the chatbot, and the initial greeting message.
[source]
NEO4J_URI=bolt://12.34.56.789:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-generated-password
OPENAI_API_KEY=sk-...
NEXT_PUBLIC_CHATBOT_NAME=Ebert
NEXT_PUBLIC_CHATBOT_DESCRIPTION="The Movie Recommendation Chatbot"
NEXT_PUBLIC_CHATBOT_GREETING="Hello, I'm Ebert, your movie recommendation bot! How can I help you today?"
== Running the application
To run the application, you must install the dependencies listed in package.json.
[source,sh]
npm i
Then run the npm run dev command to start the app on link:http://localhost:3000/[http://localhost:3000/^].
[source,sh]
npm run dev
== Questions, Comments, Feedback
If you have any questions, experience any problems, or have any general feedback, feel free to open an Issue or you can reach out to us on link:https://dev.neo4j.com/chat[Discord] or link:https://dev.neo4j.com/form[Discourse].