Skip to content

Conversation

@mlavaei3
Copy link

This pull request introduces PostgreSQL vector store integration for RAGLight.
It allows storing and retrieving embeddings directly from a PostgreSQL database using the pgvector extension.
"pip install langchain-postgres "

@Bessouat40
Copy link
Owner

Thank you for this PR and for your interest in RAGLight

You’re definitely on the right track to add PostgreSQL vector store support, but a few key pieces are still missing :

  • You only created the vector store class, it still needs to be connected to the builder,
  • Please update the README.md accordingly,
  • Update pyproject.toml with new packages,
  • Add an example script showing how to use PostgreSQL with RAGLight.

You can check how existing vector stores are registered and used throughout the repo to guide you.

)

CHROMA = "Chroma"
POSTGRE = "Postgre"
Copy link
Contributor

@duranbe duranbe Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue that PostgreSQL is more often referred as Postgres

@mlavaei3
Copy link
Author

I’ve updated the PR based on your feedback. Let me know if anything else needs adjustment.

@Bessouat40
Copy link
Owner

Bessouat40 commented Oct 23, 2025

Hello, sorry for the delay.
When I try your code with this example file :

from raglight.rag.simple_rag_api import RAGPipeline
from raglight.models.data_source_model import FolderSource, GitHubSource
from raglight.config.settings import Settings
from raglight.config.rag_config import RAGConfig
from raglight.config.vector_store_config import VectorStoreConfig

Settings.setup_logging()

knowledge_base=[
    FolderSource(path="<path to your folder with pdf>/knowledge_base"),
    GitHubSource(url="https://github.com/Bessouat40/RAGLight")
    ]

vector_store_config = VectorStoreConfig(
    embedding_model = Settings.DEFAULT_EMBEDDINGS_MODEL,
    provider=Settings.HUGGINGFACE,
    # api_base = ... # If you have a custom client URL
    database=Settings.POSTGRES,
    persist_directory = './defaultDb',
    password = "mysecretpassword"
)

config = RAGConfig(
        llm = Settings.DEFAULT_LLM,
        provider = Settings.OLLAMA,
        # api_base = ... # If you have a custom client URL
        # k = Settings.DEFAULT_K,
        # cross_encoder_model = Settings.DEFAULT_CROSS_ENCODER_MODEL,
        # system_prompt = Settings.DEFAULT_SYSTEM_PROMPT,
        # knowledge_base = knowledge_base
    )

pipeline = RAGPipeline(config, vector_store_config)

pipeline.build()

response = pipeline.generate("How can I create an easy RAGPipeline using raglight framework ? Give me python implementation")
print(response)

I've got this error :
vector_store_config = VectorStoreConfig( ^^^^^^^^^^^^^^^^^^ TypeError: VectorStoreConfig.__init__() got an unexpected keyword argument 'password'

I've you tried your code before creating this PR ?

I think it does'nt works.
Furthermore, the parameter database from your constructor is already used for the database type in VectorStoreConfig.

@Bessouat40
Copy link
Owner

And you need to implement similarity_search_class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants