Vane AI Answering Engine
repository·master·Indexed 10 days ago
https://github.com/itzcrazykns/vaneA privacy-focused AI answering engine designed for local hardware. Vane integrates web search via SearxNG with AI providers such as Ollama, OpenAI, and Claude to provide cited, accurate answers. Built with Next.js, it features a pipeline for query classification, parallel research, and widget execution. It includes a programmatic API for chat, search, image, and video queries, and supports deployment via Docker and Docker Compose.
What's inside Vane
- Vane is a Next.js-based application that integrates an AI chat experience with search capabilities. The system is designed to classify user queries, perform parallel research and widget execution, and generate final answers complete with citations. It utilizes Large Language Models (LLMs) for reasoning and writing, embedding models for semantic search over uploaded files, and a meta-search backend for web research.
How Vane processes questions
masterWhen a user sends a message via the UI, the application invokes the
POST /api/chatendpoint. The processing pipeline follows three main stages:- Classification: The system analyzes the question to determine if research is required, which widgets to display, and how to rewrite the question for better clarity.
- Parallel Execution: The system runs Research (web lookups or searching uploaded files) and Widgets (structured helpers like weather, stocks, or calculations) simultaneously.
- Answer Generation: Once context is gathered, a chat model generates the final response, incorporating citations from the gathered sources.
Understand Vane Widgets and Research
masterVane uses two distinct mechanisms to augment answers:
Widgets
Widgets are small, structured helpers (e.g., weather, stocks, calculations) that run in parallel with research. They are displayed in the UI immediately while the main answer is being generated. Note that widgets provide context but are not intended to be cited by the model.
Research
Research is the process of gathering background information. Depending on your configuration, this includes performing web lookups and searching through user-uploaded files.
Handle streaming search responses
masterWhen
stream: trueis passed in the request, the API returns atext/event-streamusing Server-Sent Events (SSE). Each line is a newline-delimited JSON object.Message Types:
init: Initial connection message (datacontains "Stream connected").sources: An array of all sources used in the response.response: Chunks of the generated answer text.done: Indicates the stream is complete.
{"type":"init","data":"Stream connected"} {"type":"sources","data":[...]} {"type":"response","data":"Vane is an "} {"type":"response","data":"innovative..."} {"type":"done"}Update Vane using pre-built Docker images
masterIf you are using pre-built Docker images, update Vane by pulling the latest image and recreating the container. Your settings are preserved automatically if you are using a named volume like
vane-data.For the standard image:
docker pull itzcrazykns1337/vane:latest docker stop vane docker rm vane docker run -d -p 3000:3000 -v vane-data:/home/vane/data --name vane itzcrazykns1337/vane:latestFor the slim version (requires
SEARXNG_API_URLenvironment variable):docker pull itzcrazykns1337/vane:slim-latest docker stop vane docker rm vane docker run -d -p 3000:3000 -e SEARXNG_API_URL=http://your-searxng-url:8080 -v vane-data:/home/vane/data --name vane itzcrazykns1337/vane:slim-latestAfter updating, verify the changes at
http://localhost:3000.Install Vane with an existing SearxNG instance
masterIf you already have a SearxNG instance running, use the
slimversion of the Vane Docker image. You must provide theSEARXNG_API_URLenvironment variable.Requirements for your SearxNG instance:
- JSON format must be enabled in SearxNG settings.
- Wolfram Alpha search engine must be enabled.
Run the following command:
docker run -d -p 3000:3000 -e SEARXNG_API_URL=http://your-searxng-url:8080 -v vane-data:/home/vane/data --name vane itzcrazykns1337/vane:slim-latestReplace
http://your-searxng-url:8080with your actual SearxNG URL.Configure Vane as a browser search engine
masterYou can add Vane as a shortcut in your browser's search bar to perform searches directly from the address bar.
- Open your browser's settings and navigate to Search Engines.
- Add a new site search with the following URL format:
http://localhost:3000/?q=%s
Note: If Vane is hosted on a different machine or domain, replace
localhostwith your server's IP address or domain name, and ensure the port (default3000) is correct.http://localhost:3000/?q=%sInstall Vane from source (Non-Docker)
masterTo install Vane without Docker, you must first install SearXNG manually and ensure
JSONformat and theWolfram Alphaengine are enabled in its settings.Follow these steps:
- Clone the repository:
git clone https://github.com/ItzCrazyKns/Vane.git cd Vane - Install dependencies:
npm i - Build the application:
npm run build - Start the application:
npm run start
Access the setup screen at
http://localhost:3000to configure your environment.git clone https://github.com/ItzCrazyKns/Vane.git cd Vane npm i npm run build npm run start- Clone the repository:
Update Vane by building Docker images from source
masterIf you manage Vane by building your own Docker images from the source code, follow these steps:
- Pull the latest changes from the repository:
cd Vane git pull origin master - Rebuild the local Docker image:
docker build -t vane . - Replace the existing container with the new build:
docker stop vane docker rm vane docker run -p 3000:3000 -p 8080:8080 --name vane vane
Verify the update at
http://localhost:3000once the process completes.cd Vane git pull origin master docker build -t vane . docker stop vane docker rm vane docker run -p 3000:3000 -p 8080:8080 --name vane vane- Pull the latest changes from the repository:
Install Vane using Docker (Recommended)
masterThe easiest way to run Vane is via Docker. The standard image includes both Vane and a bundled SearxNG search engine, so no additional setup is required for the search backend.
Run the following command to pull and start the container:
docker run -d -p 3000:3000 -v vane-data:/home/vane/data --name vane itzcrazykns1337/vane:latest-p 3000:3000: Maps the web interface to port 3000.-v vane-data:/home/vane/data: Creates a persistent volume for your data and uploaded files.
Once running, access the interface at
http://localhost:3000to configure API keys and models.Update Vane for non-Docker installations
masterTo update a non-Docker installation of Vane, pull the latest source code, update dependencies, rebuild, and restart the application:
- Pull the latest changes:
cd Vane git pull origin master - Install new dependencies:
npm i - Rebuild the application:
npm run build - Restart the application:
npm run start
Settings are preserved automatically. Verify the update at
http://localhost:3000.cd Vane git pull origin master npm i npm run build npm run start- Pull the latest changes:
Configure answer generation optimization mode
masterYou can control the tradeoff between response speed and the quality of the generated answer using the
optimizationModesetting.Available modes:
speed: Prioritizes fast response times.balanced: A middle ground between speed and quality.quality: Prioritizes the depth and accuracy of the generated response.