llama-index managed postgresml integration
Project description
LlamaIndex Managed Integration: PostgresML
PostgresML provides an all in one platform for production ready RAG applications.
Setup
First, make sure you have the latest LlamaIndex version installed and a connection string to your PostgresML database.
If you don't already have a connection string, you can get one on postgresml.org.
pip install llama-index-indices-managed-postgresml
Usage
Getting started is easy!
import os
os.environ[
"PGML_DATABASE_URL"
] = "..." # Can provide in the environment or constructor later on
from llama_index.core import Document
from llama_index.indices.managed.postgresml import PostgresMLIndex
# Create an index
index = PostgresMLIndex.from_documents(
"llama-index-test-1", [Document.example()]
)
# Connect to an index
index = PostgresMLIndex("llama-index-test-1")
You can use the index as a retriever
# Create a retriever from an index
retriever = index.as_retriever()
results = retriever.retrieve("What managed index is the best?")
print(results)
You can also use the index as a query engine
# Create an engine from an index
query_engine = index.as_query_engine()
response = retriever.retrieve("What managed index is the best?")
print(response)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_indices_managed_postgresml-0.4.0.tar.gz
.
File metadata
- Download URL: llama_index_indices_managed_postgresml-0.4.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f9fead8fdc692bdab70a3f543be5ffa802a989fc4b1786e2448974be536a332 |
|
MD5 | c0a9fa510b4dfa9b29cb2a54f4c251f5 |
|
BLAKE2b-256 | d77f18a365fdc813e1e5bec0cf97b58eb090b993c1d2d4949793ce8c0d4565fa |
File details
Details for the file llama_index_indices_managed_postgresml-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_indices_managed_postgresml-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fded067388573cee082f2fcd0fb919850cbea37ff78857a9a2a7e2d2eb9f1466 |
|
MD5 | ec2931d8ce3a385a5ef7c6ba96167aa4 |
|
BLAKE2b-256 | 90e5604102d30313147d610a9fa67775d7a914a86a2225ff5cc1526f6cc99602 |