A powerful documentation template combining Nextra's modern documentation framework with Lamatic's instant Chatbot for dynamic, interactive documentation with AI-powered chat features.
- 🤖 AI-Powered Chat: Embedded Lamatic chatbot that helps users find information and answers questions.
- 🔄 Auto-Indexing: Automatic documentation indexing through GitHub Actions.
- 📚 RAG Integration: Retrieval-Augmented Generation for accurate, context-aware responses.
- ⚡ Real-time Updates: Documentation and chatbot automatically stay in sync.
The starter kit includes two key flows:
- A documentation indexing pipeline that maintains an up-to-date vector store of your content (found in the
flows/index-github-actions.yaml
file). - A document-aware chatbot that leverages your documentation to provide intelligent responses (found in the
flows/document-chatbot.yaml
file).
-
Deploy this project on Vercel:
-
Set up a Lamatic.ai account and project. Signup if you don’t have one already.
-
Obtain API keys with any LLM providers (e.g., OpenAI, Anthropic).
-
Deploy the Indexing Flow to your Lamatic.ai project.
-
Obtain the webhook endpoint from the webhook trigger node.
-
Add this endpoint to your GitHub secrets as
WEBHOOK_URL
. -
Configure the GitHub action in
.github/workflows/index-to-lamatic.yaml
. -
Trigger a GitHub action by modifying a
.mdx
file and observe the GitHub Actions run. -
Fetch events in the webhook node. Optionally, save a sample payload for future testing.
-
Complete the required configurations in each node.
-
Test the flow to populate records in your vector store.
-
Add the Chatbot Flow to your Lamatic.ai project.
-
Add your Vercel deployment domain to the allowed domains in the Trigger Chat node.
-
Set up AI nodes for Database and Models.
-
Test the flow in the debugger by asking questions.
-
Retrieve the setup configuration and add them as environment variables on Vercel. Customize your chat widget using the following Env values.
Variable | Explanation | Example | Required |
---|---|---|---|
NEXT_PUBLIC_LAMATIC_BOT_NAME |
Display name for your chatbot | "My Chatbot" |
Yes |
NEXT_PUBLIC_LAMATIC_API_URL |
URL for accessing the Lamatic API | "https://api.lamatic.ai" |
Yes |
NEXT_PUBLIC_LAMATIC_FLOW_ID |
Unique flow ID of your Lamatic chatbot | "flow_12345" |
Yes |
NEXT_PUBLIC_LAMATIC_CHAT_HEADER_BG_COLOR |
Header background color of the chatbot (CSS color) | "black" or "#FFFFFF" |
No (default: black) |
NEXT_PUBLIC_LAMATIC_SUGGESTIONS |
Initial prompts for users (comma-separated) | "Help, Contact, FAQ" |
No |
NEXT_PUBLIC_LAMATIC_IMAGE_URL |
URL for chatbot’s image | "https://example.com/logo.png" |
No (default: Lamatic logo) |
NEXT_PUBLIC_LAMATIC_POSITION |
Position of the chatbot on the screen | "right" or "left" |
No (default: right) |
NEXT_PUBLIC_LAMATIC_FLOATING_BUTTON_ICON |
Icon for the floating button | "https://example.com/icon.png" |
No (default: help-circle.svg) |
NEXT_PUBLIC_LAMATIC_ERROR_MESSAGE |
Message displayed on error | "An error has occurred" |
No (default: "An error has occurred") |
- Activate both flows.
- Redeploy on Vercel.
- The chatbot should now be live.
With this setup, any updates to your documentation will automatically index to Lamatic.
Note: After the first run, change the
mode
in the GitHub action index toincremental
to only index new pages.
- Chatbot Errors: Verify environment variables on Vercel and allowed domains in the Lamatic Flow.
- Indexing Issues: Confirm GitHub Action secrets are set and GitHub Action is running.
- Webhook Data Issues: Check if GitHub Action is triggering and sending payloads. Modify a file to retrigger if needed.
This project is licensed under the MIT License.