4d-vector-search
v1.0.1
Published
[](https://git.4d-ps.com/4d/internship/2025/4d-vectors/4d-vector-search) [](LICENSE) [
│ ├── 4D_Vector_search.ts # Vector search logic (FD_VectorSearch class)
│ ├── apicall.ts # Utility functions for vector search and 4D data management
│ ├── Client_4D.ts # 4D API client (session, API calls, vector search)
│ ├── config.ts # Loads environment variables and exports config
│ ├── agent.ts # AI agent logic (LangChain agent functions)
│ ├── entry.ts # Re-exports main backend modules for modular use
│ ├── example.ts # Example: how to use Client_4D and vector search
│ └── index.ts # Server entry point
├── frontend/vite-project/ # Frontend (Vite + React)
│ ├── src/
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── components/
│ │ └── Logs.jsx
├── .env.example # Example environment variables
├── package.json # Backend dependencies and scripts
└── README.md🗂️ Backend Modules
- 4D_Vector_search.ts: Implements the FD_VectorSearch class, extending VectorStore for custom vector search logic.
- apicall.ts: Provides utility functions for vector search (VectorSearchTool), data store checks (CheckDataStore), and data class attribute retrieval (CheckDataClass).
- Client_4D.ts: Handles 4D API communication, session management, and vector search calls.
- config.ts: Loads and exports configuration from environment variables.
- agent.ts: Contains agent logic for AI-driven workflows using LangChain.
- entry.ts: Re-exports main backend modules for modular/advanced usage.
- example.ts: Demonstrates how to use Client_4D and perform a vector similarity search.
- index.ts: Main server entry point.
⚡ Quickstart
Install via npm
To use 4D Vector Search as a dependency in your own project:
npm i 4d-vector-searchThen import and use the main modules:
import { FD_VectorSearch, Client_4D, VectorSearchTool,config } from "4d-vector-search";Prerequisites
- Node.js (v18+ recommended)
- npm
1. Clone the repository
git clone https://git.4d-ps.com/4d/internship/2025/4d-vectors/4d-vector-search.git
cd 4D_module2. Setup Environment Variables
Copy .env.example to .env and fill in your API keys and endpoints:
GROQ_API_KEY=your_groq_api_key
OPENAI_API_KEY=your_openai_api_key
REST_API_URL=http://localhost:7080/rest
BASE_URL=http://localhost:7080
ACCESS_KEY=1233. Install Dependencies
Backend
npm installFrontend
cd frontend/vite-project
npm install4. Build and Run
Backend
Transpile TypeScript and start the server:
npx tsc
npm startThe backend will run on http://localhost:3000 by default.
Frontend
In a new terminal:
cd frontend/vite-project
npm run devThe frontend will run on http://localhost:5173 by default.
📬 Contact
For questions or support, contact the maintainer:
[Your Name or Team] - [[email protected]]
