lukawskikacper/qdrant-landing-page-2024-06-21 huggingface dataset:
qdrant-landing/content/documentation/frameworks/memgpt.md

---
title: MemGPT
weight: 3200
---

# MemGPT

[MemGPT](https://memgpt.ai/) is a system that enables LLMs to manage their own memory and overcome limited context windows to

- Create perpetual chatbots that learn about you and change their personalities over time.
- Create perpetual chatbots that can interface with large data stores.

Qdrant is available as a storage backend in MemGPT for storing and semantically retrieving data.

## Usage

#### Installation

To install the required dependencies, install `pymemgpt` with the `qdrant` extra.

```sh
pip install 'pymemgpt[qdrant]'
```

You can configure MemGPT to use either a Qdrant server or an in-memory instance with the `memgpt configure` command.

#### Configuring the Qdrant server

When you run `memgpt configure`, go through the prompts as described in the [MemGPT configuration documentation](https://memgpt.readme.io/docs/config).
After you address several `memgpt` questions, you come to the following `memgpt` prompts:

```console
? Select storage backend for archival data: qdrant
? Select Qdrant backend: server
? Enter the Qdrant instance URI (Default: localhost:6333): https://xyz-example.eu-central.aws.cloud.qdrant.io
```

You can set an API key for authentication using the `QDRANT_API_KEY` environment variable.

#### Configuring an in-memory instance

```console
? Select storage backend for archival data: qdrant
? Select Qdrant backend: local
```

The data is persisted at the default MemGPT storage directory.

## Further Reading

- [MemGPT Examples][https://github.com/cpacker/MemGPT/tree/main/examples]
- [MemGPT Documentation](https://memgpt.readme.io/docs/index).
qdrant-landing/content/documentation/frameworks/mindsdb.md

---
title: MindsDB
weight: 1100
aliases: [ ../integrations/mindsdb/ ]
---

# MindsDB

[MindsDB](https://mindsdb.com) is an AI automation platform for building AI/ML powered features and applications. It works by connecting any source of data with any AI/ML model or framework and automating how real-time data flows between them.

With the MindsDB-Qdrant integration, you can now select Qdrant as a database to load into and retrieve from with semantic search and filtering.

**MindsDB allows you to easily**:

- Connect to any store of data or end-user application.
- Pass data to an AI model from any store of data or end-user application.
- Plug the output of an AI model into any store of data or end-user application.
- Fully automate these workflows to build AI-powered features and applications

## Usage

To get started with Qdrant and MindsDB, the following syntax can be used.

```sql
CREATE DATABASE qdrant_test
WITH ENGINE = "qdrant",
PARAMETERS = {
    "location": ":memory:",
    "collection_config": {
        "size": 386,
        "distance": "Cosine"
    }
}
```

The available arguments for instantiating Qdrant can be found [here](https://github.com/mindsdb/mindsdb/blob/23a509cb26bacae9cc22475497b8644e3f3e23c3/mindsdb/integrations/handlers/qdrant_handler/qdrant_handler.py#L408-L468).

## Creating a new table

- Qdrant options for creating a collection can be specified as `collection_config` in the `CREATE DATABASE` parameters.
- By default, UUIDs are set as collection IDs. You can provide your own IDs under the `id` column.

```sql
CREATE TABLE qdrant_test.test_table (
   SELECT embeddings,'{"source": "bbc"}' as metadata FROM mysql_demo_db.test_embeddings
);
```

## Querying the database

#### Perform a full retrieval using the following syntax.

```sql
SELECT * FROM qdrant_test.test_table
```

By default, the `LIMIT` is set to 10 and the `OFFSET` is set to 0.

#### Perform a similarity search using your embeddings

<aside role="status">Qdrant supports <a href="/documentation/concepts/indexing/#payload-index">payload indexing</a> that vastly improves retrieval efficiency with filters and is highly recommended. Please note that this feature currently cannot be configured via MindsDB and must be set up separately if needed.</aside>

```sql
SELECT * FROM qdrant_test.test_table
WHERE search_vector = (select embeddings from mysql_demo_db.test_embeddings limit 1)
```

#### Perform a search using filters

```sql
SELECT * FROM qdrant_test.test_table
WHERE `metadata.source` = 'bbc';
```

#### Delete entries using IDs

```sql
DELETE FROM qtest.test_table_6
WHERE id = 2
```

#### Delete entries using filters

```sql
DELETE * FROM qdrant_test.test_table
WHERE `metadata.source` = 'bbc';
```

#### Drop a table

```sql
 DROP TABLE qdrant_test.test_table;
```

## Next steps

- You can find more information pertaining to MindsDB and its datasources [here](https://docs.mindsdb.com/).
- [Source Code](https://github.com/mindsdb/mindsdb/tree/main/mindsdb/integrations/handlers/qdrant_handler)
qdrant-landing/content/documentation/frameworks/n8n.md

---
title: N8N
weight: 2000
---

# N8N

[N8N](https://n8n.io/) is an automation platform that allows you to build flexible workflows focused on deep data integration.

Qdrant is available as a vectorstore node in N8N for building AI-powered functionality within your workflows.

## Prerequisites

1. A Qdrant instance to connect to. You can get a free cloud instance at [cloud.qdrant.io](https://cloud.qdrant.io/).
2. A running N8N instance. You can learn more about using the N8N cloud or self-hosting [here](https://docs.n8n.io/choose-n8n/).

## Setting up the vectorstore

Select the Qdrant vectorstore from the list of nodes in your workflow editor.

![Qdrant n8n node](/documentation/frameworks/n8n/node.png)

You can now configure the vectorstore node according to your workflow requirements. The configuration options reference can be found [here](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqdrant/#node-parameters).

![Qdrant Config](/documentation/frameworks/n8n/config.png)

Create a connection to Qdrant using your [instance credentials](/documentation/cloud/authentication/).

![Qdrant Credentials](/documentation/frameworks/n8n/credentials.png)

The vectorstore supports the following operations:

- Get Many - Get the top-ranked documents for a query.
- Insert documents - Add documents to the vectorstore.
- Retrieve documents - Retrieve documents for use with AI nodes.

## Further Reading

- N8N vectorstore [reference](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqdrant/).
- N8N AI-based workflows [reference](https://n8n.io/integrations/basic-llm-chain/).
- [Source Code](https://github.com/n8n-io/n8n/tree/master/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant)
qdrant-landing/content/documentation/frameworks/nifi.md

---
title: Apache NiFi
weight: 3500
---

# Apache NiFi

[NiFi](https://nifi.apache.org/) is a real-time data ingestion platform, which can transfer and manage data transfer between numerous sources and destination systems. It supports many protocols and offers a web-based user interface for developing and monitoring data flows.

NiFi supports ingesting and querying data in Qdrant via its processor modules.

## Configuration

![NiFi Qdrant configuration](/documentation/frameworks/nifi/nifi-conifg.png)

You can configure Qdrant NiFi processors with your Qdrant credentials, query/upload configurations. The processors offer 2 built-in embedding providers to encode data into vector embeddings - HuggingFace, OpenAI.

## Put Qdrant

![NiFI Put Qdrant](/documentation/frameworks/nifi/nifi-put-qdrant.png)

The `Put Qdrant` processor can ingest NiFi [FlowFile](https://nifi.apache.org/docs/nifi-docs/html/nifi-in-depth.html#intro) data into a Qdrant collection.

## Query Qdrant

![NiFI Query Qdrant](/documentation/frameworks/nifi/nifi-query-qdrant.png)

The `Query Qdrant` processor can perform a similarity search across a Qdrant collection and return a [FlowFile](https://nifi.apache.org/docs/nifi-docs/html/nifi-in-depth.html#intro) result.

## Further Reading

- [NiFi Documentation](https://nifi.apache.org/documentation/v2/).
- [Source Code](https://github.com/apache/nifi/tree/main/nifi-python-extensions/nifi-text-embeddings-module/src/main/python)
qdrant-landing/content/documentation/frameworks/openlit.md

---
title: OpenLIT
weight: 3100
---

# OpenLIT

[OpenLIT](https://github.com/openlit/openlit) is an OpenTelemetry-native LLM Application Observability tool and includes OpenTelemetry auto-instrumentation to monitor Qdrant and provide insights to improve database operations and application performance.


This page assumes you're using `qdrant-client` version 1.7.3 or above.

## Usage

### Step 1: Install OpenLIT

Open your command line or terminal and run:

```bash
pip install openlit
```

### Step 2: Initialize OpenLIT in your Application
Integrating OpenLIT into LLM applications is straightforward with just **two lines of code**: 

```python
import openlit

openlit.init()
```

OpenLIT directs the trace to your console by default. To forward telemetry data to an HTTP OTLP endpoint, configure the `otlp_endpoint` parameter or the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable.

For OpenTelemetry backends requiring authentication, use the `otlp_headers` parameter or the `OTEL_EXPORTER_OTLP_HEADERS` environment variable with the required values.

## Further Reading

With the LLM Observability data now being collected by OpenLIT, the next step is to visualize and analyze this data to get insights Qdrant's performance, behavior, and identify areas of improvement.

To begin exploring your LLM Application's performance data within the OpenLIT UI, please see the [Quickstart Guide](https://docs.openlit.io/latest/quickstart).

If you want to integrate and send the generated metrics and traces to your existing observability tools like Promethues+Jaeger, Grafana or more, refer to the [Official Documentation for OpenLIT Connections](https://docs.openlit.io/latest/connections/intro) for detailed instructions.
qdrant-landing/content/documentation/frameworks/openllmetry.md

---
title: OpenLLMetry
weight: 2300
---

# OpenLLMetry

OpenLLMetry from [Traceloop](https://www.traceloop.com/) is a set of extensions built on top of [OpenTelemetry](https://opentelemetry.io/) that gives you complete observability over your LLM application.

OpenLLMetry supports instrumenting the `qdrant_client` Python library and exporting the traces to various observability platforms, as described in their [Integrations catalog](https://www.traceloop.com/docs/openllmetry/integrations/introduction#the-integrations-catalog).

This page assumes you're using `qdrant-client` version 1.7.3 or above.
## Usage

To set up OpenLLMetry, follow these steps:

1. Install the SDK:

```console
pip install traceloop-sdk
```

1. Instantiate the SDK:

```python
from traceloop.sdk import Traceloop

Traceloop.init()
```

You're now tracing your `qdrant_client` usage with OpenLLMetry!

## Without the SDK

Since Traceloop provides standard OpenTelemetry instrumentations, you can use them as standalone packages. To do so, follow these steps: 

1. Install the package:

```console
pip install opentelemetry-instrumentation-qdrant
```

1. Instantiate the `QdrantInstrumentor`.

```python
from opentelemetry.instrumentation.qdrant import QdrantInstrumentor

QdrantInstrumentor().instrument()
```

## Further Reading

- 📚 OpenLLMetry [API reference](https://www.traceloop.com/docs/api-reference/introduction)
- 📄 [Source Code](https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-qdrant)
qdrant-landing/content/documentation/frameworks/pandas-ai.md

---
title: Pandas-AI
weight: 2900
---

# Pandas-AI

Pandas-AI is a Python library that uses a generative AI model to interpret natural language queries and translate them into Python code to interact with pandas data frames and return the final results to the user.

## Installation

```console
pip install pandasai[qdrant]
```

## Usage

You can begin a conversation by instantiating an `Agent` instance based on your Pandas data frame. The default Pandas-AI LLM requires an [API key](https://pandabi.ai).

You can find the list of all supported LLMs [here](https://docs.pandas-ai.com/en/latest/LLMs/llms/)

```python
import os
import pandas as pd
from pandasai import Agent

# Sample DataFrame
sales_by_country = pd.DataFrame(
    {
        "country": [
            "United States",
            "United Kingdom",
            "France",
            "Germany",
            "Italy",
            "Spain",
            "Canada",
            "Australia",
            "Japan",
            "China",
        ],
        "sales": [5000, 3200, 2900, 4100, 2300, 2100, 2500, 2600, 4500, 7000],
    }
)

os.environ["PANDASAI_API_KEY"] = "YOUR_API_KEY"

agent = Agent(sales_by_country)
agent.chat("Which are the top 5 countries by sales?")
# OUTPUT: China, United States, Japan, Germany, Australia
```

## Qdrant support

You can train Pandas-AI to understand your data better and improve the quality of the results.

Qdrant can be configured as a vector store to ingest training data and retrieve semantically relevant content.

```python
from pandasai.ee.vectorstores.qdrant import Qdrant

qdrant = Qdrant(
    collection_name="<SOME_COLLECTION>",
    embedding_model="sentence-transformers/all-MiniLM-L6-v2",
    url="http://localhost:6333",
    grpc_port=6334,
    prefer_grpc=True
)

agent = Agent(df, vector_store=qdrant)

# Train with custom information
agent.train(docs="The fiscal year starts in April")

# Train the q/a pairs of code snippets
query = "What are the total sales for the current fiscal year?"
response = """
import pandas as pd

df = dfs[0]

# Calculate the total sales for the current fiscal year
total_sales = df[df['date'] >= pd.to_datetime('today').replace(month=4, day=1)]['sales'].sum()
result = { "type": "number", "value": total_sales }
"""
agent.train(queries=[query], codes=[response])

# # The model will use the information provided in the training to generate a response

```

## Further reading

- [Getting Started with Pandas-AI](https://pandasai-docs.readthedocs.io/en/latest/getting-started/)
- [Pandas-AI Reference](https://pandasai-docs.readthedocs.io/en/latest/)
- [Source Code](https://github.com/Sinaptik-AI/pandas-ai/blob/main/pandasai/ee/vectorstores/qdrant.py)
qdrant-landing/content/documentation/frameworks/pipedream.md

---
title: Pipedream
weight: 3300
---

# Pipedream

[Pipedream](https://pipedream.com/) is a development platform that allows developers to connect many different applications, data sources, and APIs in order to build automated cross-platform workflows. It also offers code-level control with Node.js, Python, Go, or Bash if required.

You can use the [Qdrant app](https://pipedream.com/apps/qdrant) in Pipedream to add vector search capabilities to your workflows.

## Prerequisites

1. A Qdrant instance to connect to. You can get a free cloud instance at [cloud.qdrant.io](https://cloud.qdrant.io/).
2. A [Pipedream project](https://pipedream.com/) to develop your workflows.

## Setting Up

Search for the Qdrant app in your workflow apps.

![Qdrant Pipedream App](/documentation/frameworks/pipedream/qdrant-app.png)

The Qdrant app offers extensible API interface and pre-built actions.

![Qdrant App Features](/documentation/frameworks/pipedream/app-features.png)

Select any of the actions of the app to set up a connection.

![Qdrant Connect Account](/documentation/frameworks/pipedream/app-upsert-action.png)

Configure connection with the credentials of your Qdrant instance.

![Qdrant Connection Credentials](/documentation/frameworks/pipedream/app-connection.png)

You can verify your credentials using the "Test Connection" button.

Once a connection is set up, you can use the app to build workflows with the [2000+ apps supported by Pipedream](https://pipedream.com/apps/).

## Further Reading

- [Pipedream Documentation](https://pipedream.com/docs).
- [Qdrant Cloud Authentication](https://qdrant.tech/documentation/cloud/authentication/).
- [Source Code](https://github.com/PipedreamHQ/pipedream/tree/master/components/qdrant)
qdrant-landing/content/documentation/frameworks/privategpt.md

---
title: PrivateGPT
weight: 1600
aliases: [ ../integrations/privategpt/ ]
---

# PrivateGPT

[PrivateGPT](https://docs.privategpt.dev/) is a production-ready AI project that allows you to inquire about your documents using Large Language Models (LLMs) with offline support.

PrivateGPT uses Qdrant as the default vectorstore for ingesting and retrieving documents.

## Configuration

Qdrant settings can be configured by setting values to the qdrant property in the `settings.yaml` file. By default, Qdrant tries to connect to an instance at http://localhost:3000.

Example: 
```yaml
qdrant:
    url: "https://xyz-example.eu-central.aws.cloud.qdrant.io:6333"
    api_key: "<your-api-key>"
```

The available [configuration options](https://docs.privategpt.dev/manual/storage/vector-stores#qdrant-configuration) are:
| Field        | Description |
|--------------|-------------|
| location     | If `:memory:` - use in-memory Qdrant instance.<br>If `str` - use it as a `url` parameter.|
| url          | Either host or str of `Optional[scheme], host, Optional[port], Optional[prefix]`.<br> Eg. `http://localhost:6333` |
| port         | Port of the REST API interface. Default: `6333` |
| grpc_port    | Port of the gRPC interface. Default: `6334` |
| prefer_grpc  | If `true` - use gRPC interface whenever possible in custom methods. |
| https        | If `true` - use HTTPS(SSL) protocol.|
| api_key      | API key for authentication in Qdrant Cloud.|
| prefix       | If set, add `prefix` to the REST URL path.<br>Example: `service/v1` will result in `http://localhost:6333/service/v1/{qdrant-endpoint}` for REST API.|
| timeout      | Timeout for REST and gRPC API requests.<br>Default: 5.0 seconds for REST and unlimited for gRPC |
| host         | Host name of Qdrant service. If url and host are not set, defaults to 'localhost'.|
| path         | Persistence path for QdrantLocal. Eg. `local_data/private_gpt/qdrant`|
| force_disable_check_same_thread         | Force disable check_same_thread for QdrantLocal sqlite connection.|

## Next steps

Find the PrivateGPT docs [here](https://docs.privategpt.dev/).
qdrant-landing/content/documentation/frameworks/rivet.md

---
title: Ironclad Rivet
weight: 3100
---

# Ironclad Rivet

[Rivet](https://rivet.ironcladapp.com/) is an Integrated Development Environment (IDE) and library designed for creating AI agents using a visual, graph-based interface.

Qdrant is available as a [plugin](https://github.com/qdrant/rivet-plugin-qdrant) for building vector-search powered workflows in Rivet.

## Installation

- Open the plugins overlay at the top of the screen.
- Search for the official Qdrant plugin.
- Click the "Add" button to install it in your current project.

![Rivet plugin installation](/documentation/frameworks/rivet/installation.png)

## Setting up the connection

You can configure your Qdrant instance credentials in the Rivet settings after installing the plugin.

![Rivet plugin connection](/documentation/frameworks/rivet/connection.png)

Once you've configured your credentials, you can right-click on your workspace to add nodes from the plugin and get building!

![Rivet plugin nodes](/documentation/frameworks/rivet/node.png)

## Further Reading

- Rivet [Tutorial](https://rivet.ironcladapp.com/docs/tutorial).
- Rivet [Documentation](https://rivet.ironcladapp.com/docs).
- Plugin [Source Code](https://github.com/qdrant/rivet-plugin-qdrant)
qdrant-landing/content/documentation/frameworks/semantic-router.md

---
title: Semantic-Router
weight: 2700
---

# Semantic-Router

[Semantic-Router](https://www.aurelio.ai/semantic-router/) is a library to build decision-making layers for your LLMs and agents. It uses vector embeddings to make tool-use decisions rather than LLM generations, routing our requests using semantic meaning.

Qdrant is available as a supported index in Semantic-Router for you to ingest route data and perform retrievals.

## Installation

To use Semantic-Router with Qdrant, install the `qdrant` extra:

```console
pip install semantic-router[qdrant]
```

## Usage

Set up `QdrantIndex` with the appropriate configurations:

```python
from semantic_router.index import QdrantIndex

qdrant_index = QdrantIndex(
    url="https://xyz-example.eu-central.aws.cloud.qdrant.io", api_key="<your-api-key>"
)
```

Once the Qdrant index is set up with the appropriate configurations, we can pass it to the `RouteLayer`.

```python
from semantic_router.layer import RouteLayer

RouteLayer(encoder=some_encoder, routes=some_routes, index=qdrant_index)
```

## Complete Example

<details>

<summary><b>Click to expand</b></summary>

```python
import os

from semantic_router import Route
from semantic_router.encoders import OpenAIEncoder
from semantic_router.index import QdrantIndex
from semantic_router.layer import RouteLayer

# we could use this as a guide for our chatbot to avoid political conversations
politics = Route(
    name="politics value",
    utterances=[
        "isn't politics the best thing ever",
        "why don't you tell me about your political opinions",
        "don't you just love the president",
        "they're going to destroy this country!",
        "they will save the country!",
    ],
)

# this could be used as an indicator to our chatbot to switch to a more
# conversational prompt
chitchat = Route(
    name="chitchat",
    utterances=[
        "how's the weather today?",
        "how are things going?",
        "lovely weather today",
        "the weather is horrendous",
        "let's go to the chippy",
    ],
)

# we place both of our decisions together into single list
routes = [politics, chitchat]

os.environ["OPENAI_API_KEY"] = "<YOUR_API_KEY>"
encoder = OpenAIEncoder()

rl = RouteLayer(
    encoder=encoder,
    routes=routes,
    index=QdrantIndex(location=":memory:"),
)

print(rl("What have you been upto?").name)
```

This returns:

```console
[Out]: 'chitchat'
```

</details>

## 📚 Further Reading

- Semantic-Router [Documentation](https://github.com/aurelio-labs/semantic-router/tree/main/docs)
- Semantic-Router [Video Course](https://www.aurelio.ai/course/semantic-router)
- [Source Code](https://github.com/aurelio-labs/semantic-router/blob/main/semantic_router/index/qdrant.py)