Skip to content

Peleke/langchain-qortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

langchain-qortex

LangChain VectorStore Backed by Graph-Enhanced Retrieval

PyPI Python License: MIT

LangChain integration for qortex graph-enhanced retrieval.

Install · Quick Start · VectorStore Guide · qortex

Install

pip install langchain-qortex

What is this?

This package provides QortexVectorStore, a LangChain VectorStore backed by qortex's knowledge graph. It works anywhere LangChain expects a VectorStore: chains, agents, as_retriever(), similarity_search(), add_documents(), etc.

qortex augments standard vector search with graph structure, rules, and a feedback-driven learning loop. This package gives LangChain users access to those capabilities through the API they already know.

Quick start

from langchain_qortex import QortexVectorStore

# Zero-config (like Chroma.from_texts)
vs = QortexVectorStore.from_texts(
    texts=["OAuth2 is an authorization framework", "JWT carries signed claims"],
    embedding=my_embedding,
    domain="security",
)

# Standard VectorStore API
docs = vs.similarity_search("authentication", k=5)
retriever = vs.as_retriever()

What qortex adds

Beyond standard vector search, QortexVectorStore exposes three capabilities that flat vector stores cannot provide:

# Explore: traverse typed edges from any search result
explore = vs.explore(docs[0].metadata["node_id"])
for edge in explore.edges:
    print(f"{edge.source_id} --{edge.relation_type}--> {edge.target_id}")

# Rules: get projected rules linked to retrieved concepts
rules = vs.rules(concept_ids=[d.metadata["node_id"] for d in docs])
for rule in rules.rules:
    print(f"[{rule.category}] {rule.text}")

# Feedback: close the learning loop
vs.feedback({docs[0].id: "accepted", docs[-1].id: "rejected"})
# Future queries adjust PPR teleportation weights based on this signal

Documentation

License

MIT

About

LangChain integration for qortex graph-enhanced retrieval

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors