commit 5186a992975a22c9328fe03ca805faead58af51f Author: BHAGTANIDEEPAK Date: Mon Apr 14 17:38:18 2025 +0530 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..81865bc --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# AI Internal Search Backend + +This is the backend for the AI Internal Search project. It provides an API to interact with Mistral AI for generating responses based on department-specific documents stored in a MongoDB database. + +## Features +- Fetches relevant documents from MongoDB based on the department. +- Uses Mistral AI to generate responses based on the provided context and user query. +- Provides a REST API for communication with the frontend. + +## Prerequisites +- Node.js (v16 or later) +- MongoDB database +- Mistral AI API Key + +## Installation + +1. Clone the repository: + ```bash + git clone + cd AI-Internal-Search + ``` + +2. Install dependencies: + ```bash + npm i + ``` +3. Create a .env file in the root directory and configure the following variables: + ```bash + PORT=3002 + MONGO_URI= + MISTRAL_API_KEY= + ``` +4. Start the server: + ``` bash + npm start + ``` + +### Endpoints +```bash +http://localhost:3002/api/chat +``` + +1. URL: /api/chat +2. Method: POST +3. Description: Sends a query to the AI assistant and retrieves a response based on department-specific documents. + +4. Request body: +```bash +{ + "department": "string", + "message": "string" +} +``` \ No newline at end of file