Catalog npm
Back to packageRELEASE DETAILS

1.0.1

npm

4d-vector-search

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

Published30 Aug 2025
Direct dependencies24
Transitive dependenciesNot calculated

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.

Declared dependencies 24

Native requirements
24 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@langchain/core
Environment
{
  "local_name": "@langchain/core",
  "alias": false,
  "peer_metadata": null
}
^0.3.62runtime
@langchain/groq
Environment
{
  "local_name": "@langchain/groq",
  "alias": false,
  "peer_metadata": null
}
^0.2.3runtime
@langchain/langgraph
Environment
{
  "local_name": "@langchain/langgraph",
  "alias": false,
  "peer_metadata": null
}
^0.3.8runtime
@langchain/openai
Environment
{
  "local_name": "@langchain/openai",
  "alias": false,
  "peer_metadata": null
}
^0.5.18runtime
@modelcontextprotocol/sdk
Environment
{
  "local_name": "@modelcontextprotocol/sdk",
  "alias": false,
  "peer_metadata": null
}
^1.17.0runtime
@types/cookiejar
Environment
{
  "local_name": "@types/cookiejar",
  "alias": false,
  "peer_metadata": null
}
^2.1.5runtime
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.10.0runtime
axios-cookiejar-support
Environment
{
  "local_name": "axios-cookiejar-support",
  "alias": false,
  "peer_metadata": null
}
^6.0.4runtime
body-parser
Environment
{
  "local_name": "body-parser",
  "alias": false,
  "peer_metadata": null
}
^2.2.0runtime
cors
Environment
{
  "local_name": "cors",
  "alias": false,
  "peer_metadata": null
}
^2.8.5runtime
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^17.2.0runtime
express
Environment
{
  "local_name": "express",
  "alias": false,
  "peer_metadata": null
}
^5.1.0runtime
form-data
Environment
{
  "local_name": "form-data",
  "alias": false,
  "peer_metadata": null
}
^4.0.3runtime
groq-sdk
Environment
{
  "local_name": "groq-sdk",
  "alias": false,
  "peer_metadata": null
}
^0.27.0runtime
tough-cookie
Environment
{
  "local_name": "tough-cookie",
  "alias": false,
  "peer_metadata": null
}
^5.1.2runtime
@types/axios
Environment
{
  "local_name": "@types/axios",
  "alias": false,
  "peer_metadata": null
}
^0.14.4development
@types/cors
Environment
{
  "local_name": "@types/cors",
  "alias": false,
  "peer_metadata": null
}
^2.8.19development
@types/express
Environment
{
  "local_name": "@types/express",
  "alias": false,
  "peer_metadata": null
}
^5.0.3development
@types/form-data
Environment
{
  "local_name": "@types/form-data",
  "alias": false,
  "peer_metadata": null
}
^2.2.1development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^24.0.13development
@types/tough-cookie
Environment
{
  "local_name": "@types/tough-cookie",
  "alias": false,
  "peer_metadata": null
}
^4.0.5development
nodemon
Environment
{
  "local_name": "nodemon",
  "alias": false,
  "peer_metadata": null
}
^3.1.10development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.9.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.8.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "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"
    }
  ]
}

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_version:d41fd72b80b7b14e5d686ae6844455374f0159a7d51972bbca3d718f3c57f756

Other collected versions

1.0.030 AugView all collected versions →