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
-
Clone the repository:
git clone <repository-url> cd AI-Internal-Search
-
Install dependencies:
npm i
-
Create a .env file in the root directory and configure the following variables:
PORT=3002 MONGO_URI=<your-mongodb-connection-string> MISTRAL_API_KEY=<your-mistral-api-key>
-
Start the server:
npm start
Endpoints
http://localhost:3002/api/chat
-
URL: /api/chat
-
Method: POST
-
Description: Sends a query to the AI assistant and retrieves a response based on department-specific documents.
-
Request body:
{
"department": "string",
"message": "string"
}
Description
Languages
JavaScript
100%