npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

4d-vector-search

v1.0.1

Published

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

Downloads

17

Readme

4D Vector Search

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] - [[email protected]]


🔗 Resources