An easy-to-use framework that turns your project documentation into a chatbot you can ask anything.
Free TypeScript template for a Smart Documentation Chatbot.
This project indexes your documentation and lets you query it through a chatbot.
It replicates how the Intlayer documentation works.
How it works:
- We use OpenAI embeddings and store them in a JSON file.
- We then use vector similarity search to find the documents most relevant to the user query.
- We return the most relevant documents to the user.
The project is divided into three main components:
- docs
- We index the docs
- We store embeddings in a JSON file
- website (Next.js)
- Renders and interprets the docs using
intlayerand Next.js route handlers - Uses OpenAI vector similarity search to find the most relevant documents
- Returns the most relevant results to the user
- Renders and interprets the docs using
- List and index all available documentation
- Generate an embedding for each document using OpenAI
- Store embeddings in a JSON file
- When a user asks a question or searches for a doc:
- Generate a new embedding for the user's query
- Use vector similarity search to find the most relevant documents
- Retrieve the top matching documents
- Return the most relevant documents to the user
Check out a demo for my Intlayer project here.
git clone https://github.com/aymericzip/smart_doc.git
cd smart_docnpm install -g pnpm
pnpm installYou can find two .env template files in the project:
website/.env.templatedocs/.env.template
Rename these files to .env and fill the variables with your own values.
pnpm run buildcd website
pnpm run start