This project implements an AI agent that utilizes Retrieval-Augmented Generation (RAG) to access the full documentation of Tailwind CSS version 3 and version 4. The agent can efficiently retrieve and provide information from the documentation based on user queries. It also uses web scraping to get the latest information from the documentation.
The AI agent is designed to read and process the Tailwind CSS documentation, allowing users to ask questions and receive accurate responses based on the official documentation. The project leverages embeddings to enhance the retrieval process, ensuring that the agent can quickly access relevant information.
The project is deployed on Vercel and can be accessed at https://tailwind-css-ai-agent.vercel.app/
urls_v3.md
and urls_v4.md
, which contains all URLs for the Tailwind CSS v3 and v4 documentation.http://localhost:3000/api/tailwind
.To run the application, you need to create a .env
file in the root directory of the project with the following environment variables:
DATABASE_URL=<your_postgresql_database_url>
OPENAI_API_KEY=<your_openai_api_key>
FIRECRAWL_API_KEY=<your_firecrawl_api_key>
DATABASE_URL
: The connection string for your PostgreSQL database.OPENAI_API_KEY
: Your API key for accessing OpenAI services for chat and embeddings.FIRECRAWL_API_KEY
: The API key for the Firecrawl service used for web scraping.Clone the repository:
git clone https://github.com/Saraceni/TailwindCSSAiAgent.git
cd your-repo-name
Install dependencies:
pnpm install
# or
yarn install
Set up your database and configure the connection settings in your environment variables.
Run the Application:
pnpm run dev
# or
yarn dev
Access the web scrapping API:
http://localhost:3000/api/tailwind
.urls_v3.md
or urls_v4.md
and creates embeddings for each page.version
with the value v3
or v4
. For example: http://localhost:3000/api/tailwind?version=v3
.urls_v3.md
or urls_v4.md
, which contains all URLs for the Tailwind CSS v3 or v4 documentation.Each resource in the database represents a URL from the Tailwind CSS documentation. The schema includes:
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
This is the starter project for the Vercel AI SDK Retrieval-Augmented Generation (RAG) guide.
In this project, you will build a chatbot that will only respond with information that it has within its knowledge base. The chatbot will be able to both store and retrieve information. This project has many interesting use cases from customer support through to building your own second brain!
This project will use the following stack: