{"_id":"4d-vector-search","_rev":"2-33c6f0639dea9a1ec35789abf16a92f2","name":"4d-vector-search","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"4d-vector-search","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"4d-vector-search@1.0.0","maintainers":[{"name":"yassine_mbk","email":"mohammedyassine808@gmail.com"}],"dist":{"shasum":"272ea9ad7ec98ddeb7e151871b11d8530e8f8900","tarball":"https://registry.npmjs.org/4d-vector-search/-/4d-vector-search-1.0.0.tgz","fileCount":11,"integrity":"sha512-bspsytO/5a1ubrYQuMHhQseud4C6z99p9qU/uPVLJ0SpRRx20/guah3/7wE54nzoE7j3oRtIR7JF8qSKYCbilw==","signatures":[{"sig":"MEUCIQCe//pbclX+Syf+hlILHkvUNIpALBrOwJDi/BNYckTTUAIgCkcSD61XtnH94+wZV0S3VAqsVTCY8NDV9efuNP7MJVA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61143},"main":"dist/entry.js","type":"module","gitHead":"923c956381933ab4ce98411d446a5eade2ab63fc","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","start":"nodemon  dist/index.js"},"_npmUser":{"name":"yassine_mbk","email":"mohammedyassine808@gmail.com"},"_npmVersion":"11.5.2","description":"This project is an integration module between 4D and LangChain, enabling seamless communication and advanced vector search capabilities. It features a TypeScript/Express backend and a Vite/React frontend.","directories":{},"_nodeVersion":"24.4.1","dependencies":{"cors":"^2.8.5","axios":"^1.10.0","dotenv":"^17.2.0","express":"^5.1.0","groq-sdk":"^0.27.0","form-data":"^4.0.3","body-parser":"^2.2.0","tough-cookie":"^5.1.2","@langchain/core":"^0.3.62","@langchain/groq":"^0.2.3","@types/cookiejar":"^2.1.5","@langchain/openai":"^0.5.18","@langchain/langgraph":"^0.3.8","axios-cookiejar-support":"^6.0.4","@modelcontextprotocol/sdk":"^1.17.0"},"_hasShrinkwrap":false,"devDependencies":{"nodemon":"^3.1.10","ts-node":"^10.9.2","typescript":"^5.8.3","@types/cors":"^2.8.19","@types/node":"^24.0.13","@types/axios":"^0.14.4","@types/express":"^5.0.3","@types/form-data":"^2.2.1","@types/tough-cookie":"^4.0.5"},"_npmOperationalInternal":{"tmp":"tmp/4d-vector-search_1.0.0_1756559321958_0.663302437053326","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"4d-vector-search","version":"1.0.1","main":"dist/entry.js","type":"module","scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1","start":"nodemon  dist/index.js"},"keywords":[],"author":"","license":"ISC","description":"[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](https://git.4d-ps.com/4d/internship/2025/4d-vectors/4d-vector-search) [![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE) [![Node.js](https://img.shields.i","dependencies":{"@langchain/core":"^0.3.62","@langchain/groq":"^0.2.3","@langchain/langgraph":"^0.3.8","@langchain/openai":"^0.5.18","@modelcontextprotocol/sdk":"^1.17.0","@types/cookiejar":"^2.1.5","axios":"^1.10.0","axios-cookiejar-support":"^6.0.4","body-parser":"^2.2.0","cors":"^2.8.5","dotenv":"^17.2.0","express":"^5.1.0","form-data":"^4.0.3","groq-sdk":"^0.27.0","tough-cookie":"^5.1.2"},"devDependencies":{"@types/axios":"^0.14.4","@types/cors":"^2.8.19","@types/express":"^5.0.3","@types/form-data":"^2.2.1","@types/node":"^24.0.13","@types/tough-cookie":"^4.0.5","nodemon":"^3.1.10","ts-node":"^10.9.2","typescript":"^5.8.3"},"_id":"4d-vector-search@1.0.1","gitHead":"a1d74c068a5522734b2b0be691036635f46d2d0b","_nodeVersion":"24.4.1","_npmVersion":"11.5.2","dist":{"integrity":"sha512-xiX5DjksKoNxFmcF9SAVCOtzRGdqwwGAuQbm8M0wWqJMpI++x8sPYxqlgBWZBR3zr82t1mDtzbNtyLVgDs9ybA==","shasum":"9340ebaaac6c76b7129fb5d89dd357a7d2011817","tarball":"https://registry.npmjs.org/4d-vector-search/-/4d-vector-search-1.0.1.tgz","fileCount":3,"unpackedSize":44372,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDD4/OuOf6t01vynEGYNijpZarY2BbnBzxnfbhX7uhDCwIhAJOc5271f0E7qq3WUtDa7smdiTRMBjejpei846fjyouI"}]},"_npmUser":{"name":"yassine_mbk","email":"mohammedyassine808@gmail.com"},"directories":{},"maintainers":[{"name":"yassine_mbk","email":"mohammedyassine808@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/4d-vector-search_1.0.1_1756560448168_0.3141543116915815"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-30T13:08:41.957Z","modified":"2025-08-30T13:27:28.554Z","1.0.0":"2025-08-30T13:08:42.138Z","1.0.1":"2025-08-30T13:27:28.371Z"},"license":"ISC","keywords":[],"description":"[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](https://git.4d-ps.com/4d/internship/2025/4d-vectors/4d-vector-search) [![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE) [![Node.js](https://img.shields.i","maintainers":[{"name":"yassine_mbk","email":"mohammedyassine808@gmail.com"}],"readme":"# 4D Vector Search\n\n[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](https://git.4d-ps.com/4d/internship/2025/4d-vectors/4d-vector-search)\n[![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)\n[![Node.js](https://img.shields.io/badge/node-%3E=18.0.0-brightgreen)](https://nodejs.org/)\n\nA powerful integration module between 4D and LangChain, enabling seamless communication and advanced vector search capabilities. This project features a TypeScript/Express backend and a modern Vite/React frontend for AI-driven workflows.\n\n---\n\n## 🚀 Features\n\n- **4D & LangChain Integration:** Connects 4D with LangChain for advanced AI and vector search.\n- **AI Agent Backend:** Streaming responses, REST API for message processing.\n- **Modern Frontend:** Vite + React 19 for a fast, user-friendly interface.\n- **TypeScript Throughout:** Strong typing in both backend and frontend.\n- **Environment Variable Support:** Securely manage API keys and endpoints.\n- **Extensible:** Easily add new vector search or AI features.\n\n---\n\n## 🛠️ Tech Stack\n\n- **Backend:** Node.js, Express, TypeScript, LangChain, dotenv\n- **Frontend:** React 19, Vite, Axios\n- **Other:** Groq API, OpenAI API\n\n---\n\n## 📁 Folder Structure\n\n```\n/\n  ├── src/                   # Backend source (TypeScript)\n  │   ├── 4D_Vector_search.ts  # Vector search logic (FD_VectorSearch class)\n  │   ├── apicall.ts           # Utility functions for vector search and 4D data management\n  │   ├── Client_4D.ts         # 4D API client (session, API calls, vector search)\n  │   ├── config.ts            # Loads environment variables and exports config\n  │   ├── agent.ts             # AI agent logic (LangChain agent functions)\n  │   ├── entry.ts             # Re-exports main backend modules for modular use\n  │   ├── example.ts           # Example: how to use Client_4D and vector search\n  │   └── index.ts             # Server entry point\n  ├── frontend/vite-project/ # Frontend (Vite + React)\n  │   ├── src/\n  │   │   ├── App.jsx\n  │   │   ├── main.jsx\n  │   │   └── components/\n  │   │       └── Logs.jsx\n  ├── .env.example           # Example environment variables\n  ├── package.json           # Backend dependencies and scripts\n  └── README.md\n```\n\n---\n\n## 🗂️ Backend Modules\n\n- **4D_Vector_search.ts:** Implements the FD_VectorSearch class, extending VectorStore for custom vector search logic.\n- **apicall.ts:** Provides utility functions for vector search (VectorSearchTool), data store checks (CheckDataStore), and data class attribute retrieval (CheckDataClass).\n- **Client_4D.ts:** Handles 4D API communication, session management, and vector search calls.\n- **config.ts:** Loads and exports configuration from environment variables.\n- **agent.ts:** Contains agent logic for AI-driven workflows using LangChain.\n- **entry.ts:** Re-exports main backend modules for modular/advanced usage.\n- **example.ts:** Demonstrates how to use Client_4D and perform a vector similarity search.\n- **index.ts:** Main server entry point.\n\n---\n\n## ⚡ Quickstart\n\n### Install via npm\n\nTo use 4D Vector Search as a dependency in your own project:\n\n```bash\nnpm i 4d-vector-search\n```\n\nThen import and use the main modules:\n\n```js\nimport { FD_VectorSearch, Client_4D, VectorSearchTool,config } from \"4d-vector-search\";\n```\n\n---\n\n### Prerequisites\n\n- Node.js (v18+ recommended)\n- npm\n\n### 1. Clone the repository\n\n```bash\ngit clone https://git.4d-ps.com/4d/internship/2025/4d-vectors/4d-vector-search.git\ncd 4D_module\n```\n\n### 2. Setup Environment Variables\n\nCopy `.env.example` to `.env` and fill in your API keys and endpoints:\n\n```env\nGROQ_API_KEY=your_groq_api_key\nOPENAI_API_KEY=your_openai_api_key\nREST_API_URL=http://localhost:7080/rest\nBASE_URL=http://localhost:7080\nACCESS_KEY=123\n```\n\n### 3. Install Dependencies\n\n#### Backend\n\n```bash\nnpm install\n```\n\n#### Frontend\n\n```bash\ncd frontend/vite-project\nnpm install\n```\n\n### 4. Build and Run\n\n#### Backend\n\nTranspile TypeScript and start the server:\n\n```bash\nnpx tsc\nnpm start\n```\n\nThe backend will run on [http://localhost:3000](http://localhost:3000) by default.\n\n#### Frontend\n\nIn a new terminal:\n\n```bash\ncd frontend/vite-project\nnpm run dev\n```\n\nThe frontend will run on [http://localhost:5173](http://localhost:5173) by default.\n\n\n## 📬 Contact\n\nFor questions or support, contact the maintainer:  \n[Your Name or Team] - [your.email@example.com]\n\n---\n\n## 🔗 Resources\n\n- [LangChain Documentation](https://js.langchain.com/docs/)\n- [4D Documentation](https://developer.4d.com/)\n- [Vite Documentation](https://vitejs.dev/)\n- [React Documentation](https://react.dev/)\n\n","readmeFilename":"README.md"}