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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_indices_managed_postgresml-0.5.1.tar.gz.
File metadata
- Download URL: llama_index_indices_managed_postgresml-0.5.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4abcf9c2f0979b14c01eb48d10df6ade428f426ff9928ea0407743459dbc9fc4
|
|
| MD5 |
261edf215fcc5da504369fc4618a593a
|
|
| BLAKE2b-256 |
a1b2f0ebc35003f87326047860ed125ba750f08dcf23853d23cb76c4eff00407
|
File details
Details for the file llama_index_indices_managed_postgresml-0.5.1-py3-none-any.whl.
File metadata
- Download URL: llama_index_indices_managed_postgresml-0.5.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45b37347fb0aa6b1df26997a8f3b89e791cd77cdd45b909f39a6485c9605b9c9
|
|
| MD5 |
2f14de364c28b977d791634a84269798
|
|
| BLAKE2b-256 |
163cc7915ff12ccd73431f46fbf53c4411957c44f61c1f3a6d60cd3dc5efc279
|