EmbedIt is a web application that allows users to upload documents, create AI assistants, and interact with the documents through chat. The application leverages OpenAI's API to create assistants and vector stores for document analysis.
- Upload documents (PDF, TXT, DOCX, JSON)
- Create AI assistants to analyze documents
- Chat with the AI assistant to get insights from the documents
- Manage recent files and topics
- Node.js (v14 or higher)
- npm or yarn
- OpenAI API Key
-
Clone the repository:
git clone https://github.com/your-username/EmbedIt.git cd EmbedIt -
Install dependencies for both backend and frontend:
cd backend npm install cd ../frontend npm install
-
Create a
.envfile in thebackenddirectory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
-
Start the backend server:
cd backend npm startThe backend server will run on
http://localhost:5009. -
Start the frontend development server:
cd frontend npm startThe frontend server will run on
http://localhost:3000.
-
POST /api/v1/embedit/createAssistantWithVectorStore- Create an AI assistant and a vector store for document analysis.
- Request body:
{ "topicName": "string" }
-
POST /api/v1/embedit/addDocuments- Upload documents and add them to the vector store.
- Request body: FormData with file and topicName
-
POST /api/v1/embedit/askQuestions- Ask questions to the AI assistant.
- Request body:
{ "question": "string" }
- Upload documents through the sidebar interface.
- Create AI assistants and manage recent files.
src/controllers/embedit.controller.ts: Contains the main logic for handling file uploads, creating assistants, and interacting with OpenAI API.src/uploads: Directory where uploaded files are stored temporarily.
src/components/Sidebar.tsx: Component for the sidebar interface where users can upload files and create assistants.src/components/ChatInterface.tsx: Component for the chat interface to interact with the AI assistant.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License.