> For the complete documentation index, see [llms.txt](https://docs.flowiseai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowiseai.com/integrations/langchain/vector-stores/faiss.md).

# Faiss

Upsert embedded data and perform similarity search using the Faiss library from Meta.

Faiss is a library for efficient similarity search and clustering of dense vectors. Unlike cloud vector stores, Faiss runs locally on your machine and saves data to your file system.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-8f1b1956a66a6df49f9afdcb7ba5addda0dd6db5%2Fimage%20(158).png?alt=media" alt="" width="307"><figcaption><p>Faiss Node</p></figcaption></figure>

## Prerequisites

### Method 1: NPM/Source Installation

For local installations, ensure your machine can compile C++ modules.

* **Linux:** Install `build-essential`.
* **MacOS:** Run `xcode-select --install` to get Clang/C++ tools.
* **Windows:** Install Visual Studio Build Tools and Python.

### Method 2: Docker

If you are running Flowise using Docker, Faiss is ready to use.

## Setup

### Inputs

| Input          | Description                                         |
| -------------- | --------------------------------------------------- |
| **Document**   | Connect any node from the Document Loader category. |
| **Embeddings** | Connect any node from the Embeddings category.      |

### Parameters

* **Base Path:** The folder path where the index files (`faiss.index` and `docstore.json`) will be saved.
  * If left blank, data is stored in RAM and will be lost when Flowise restarts.
  * **Docker Path Example:** `/root/.flowise/faiss`
  * > **Note:** Ensure the path is mapped to a volume in your `docker-compose.yml` file to prevent data loss upon container restart.
  * **Local Path Example:** `C:\Users\YourName\flowise_data`

## Configuration and Ingestion

1. Add a new **Faiss** node on the canvas.
2. Enter a folder path in the **Faiss** node’s **Base Path** field.
3. Connect your Document Loader and Embeddings nodes to the **Faiss** node.
4. Click **Upsert Vector Database** to process your documents.

## Verify

To verify your data has been upserted, navigate to the folder you specified in the **Base Path** field. You should see files `faiss.index` and `docstore.json`.

## Resources

* [LangChain JS Faiss Documentation](https://docs.langchain.com/oss/javascript/integrations/vectorstores/faiss)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowiseai.com/integrations/langchain/vector-stores/faiss.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
