Semantic Search for private, local, and internal use. Privacy for many businesses is crucial and we have a customized Semantic Search product that will enable fast super accurate search of all of your Documents. Semantic is an adjective, relating to meaning in language or logic.
Coming Soon!
Semantic Search for private, local, and internal use. Privacy for many businesses is crucial and we have a customized Semantic Search product that will enable fast super accurate search of all of your Documents.
Soon we will be offering several different implementations of Semantic Search.
Small scale solutions already exist, but unless you're an expert, nothing is currently with in reach! Here is a code example:
using System;
using System.Collections.Generic;
using System.Linq;
public class Vector
{
public double X { get; set; }
public double Y { get; set; }
public double Z { get; set; }
public Vector(double x, double y, double z)
{
X = x;
Y = y;
Z = z;
}
public double Magnitude()
{
return Math.Sqrt(X * X + Y * Y + Z * Z);
}
public override string ToString()
{
return $"({X}, {Y}, {Z})";
}
}
public class VectorDatabase
{
private List<Vector> _vectors;
public VectorDatabase()
{
_vectors = new List<Vector>();
}
public void AddVector(Vector vector)
{
_vectors.Add(vector);
}
public void RemoveVector(Vector vector)
{
_vectors.Remove(vector);
}
public Vector GetVector(int index)
{
if (index >= 0 && index < _vectors.Count)
{
return _vectors[index];
}
throw new IndexOutOfRangeException("Invalid index");
}
public List<Vector> GetAllVectors()
{
return new List<Vector>(_vectors);
}
public void ClearDatabase()
{
_vectors.Clear();
}
public int Count()
{
return _vectors.Count;
}
// Search method to find vectors with a specific magnitude
public List<Vector> SearchVectorsByMagnitude(double targetMagnitude, double tolerance = 0.01)
{
return _vectors.Where(v => Math.Abs(v.Magnitude() - targetMagnitude) < tolerance).ToList();
}
}
class Program
{
static void Main(string[] args)
{
VectorDatabase vectorDB = new VectorDatabase();
vectorDB.AddVector(new Vector(1, 2, 3));
vectorDB.AddVector(new Vector(4, 5, 6));
vectorDB.AddVector(new Vector(3, 4, 5));
double targetMagnitude = 5.0;
List<Vector> searchResults = vectorDB.SearchVectorsByMagnitude(targetMagnitude);
Console.WriteLine($"Vectors with magnitude ~{targetMagnitude}:");
foreach (var vector in searchResults)
{
Console.WriteLine(vector);
}
Console.WriteLine($"Total Vectors: {vectorDB.Count()}");
}
}