Catalog npm
PACKAGE EXPLORERView in registry

4d-vector-search

npm

[![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

Versions collected2
Direct dependencies24From release 1.0.1
Last observed20 Oct, 20:07 UTC

README

Current package documentation

Build Status License: ISC Node.js

A 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.


🚀 Features

  • 4D & LangChain Integration: Connects 4D with LangChain for advanced AI and vector search.
  • AI Agent Backend: Streaming responses, REST API for message processing.
  • Modern Frontend: Vite + React 19 for a fast, user-friendly interface.
  • TypeScript Throughout: Strong typing in both backend and frontend.
  • Environment Variable Support: Securely manage API keys and endpoints.
  • Extensible: Easily add new vector search or AI features.

🛠️ Tech Stack

  • Backend: Node.js, Express, TypeScript, LangChain, dotenv
  • Frontend: React 19, Vite, Axios
  • Other: Groq API, OpenAI API

📁 Folder Structure

/
  ├── src/                   # Backend source (TypeScript)
  │   ├── 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-search

Then 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_module

2. 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=123

3. Install Dependencies

Backend

npm install

Frontend

cd frontend/vite-project
npm install

4. Build and Run

Backend

Transpile TypeScript and start the server:

npx tsc
npm start

The backend will run on http://localhost:3000 by default.

Frontend

In a new terminal:

cd frontend/vite-project
npm run dev

The frontend will run on http://localhost:5173 by default.

📬 Contact

For questions or support, contact the maintainer:
[Your Name or Team] - [your.email@example.com]


🔗 Resources

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 2

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.1Registry latest30 Aug 202524
1.0.030 Aug 202524

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:07 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:b279f6fe687a7055328276c11cc106cffd9e6a6bd1c4be261a2e36d71ca5f8ea