Skip to main content

Knowledge graph ingestion engine for automated rule generation

Project description

qortex

Graph-enhanced retrieval engine. Transforms unstructured content into a knowledge graph with typed edges, then uses Personalized PageRank for structurally-aware search with feedback-driven learning.

Features

  • Graph-enhanced retrieval: Vector similarity + PPR over typed edges (REQUIRES, REFINES, USES...)
  • Explore and navigate: Traverse typed edges, discover neighbors and linked rules from any search result
  • Rules auto-surfaced: Query results include linked rules with relevance scores, zero consumer effort
  • Feedback-driven learning: Consumer outcomes adjust PPR teleportation factors; results improve over time
  • Framework adapters: Drop-in for LangChain, Mastra, and any MCP client
  • Flexible ingestion: PDF, Markdown, and text sources into a unified knowledge graph
  • Projection pipeline: Source, Enricher, Target architecture for rule generation
  • Multiple backends: InMemory (testing), Memgraph (production with MAGE algorithms)

Quick start

pip install qortex

# With optional dependencies
pip install qortex[vec]       # numpy + sentence-transformers
pip install qortex[mcp]       # MCP server
pip install qortex[memgraph]  # Memgraph backend
pip install qortex[all]       # Everything

Search, explore, learn

from qortex.client import LocalQortexClient

client = LocalQortexClient(vector_index, backend, embedding, mode="graph")

# Search: vec + graph combined scoring, rules auto-surfaced
result = client.query("OAuth2 authorization", domains=["security"], top_k=5)

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

# Feedback: close the learning loop
client.feedback(result.query_id, {result.items[0].id: "accepted"})

LangChain VectorStore

from langchain_qortex import QortexVectorStore

vs = QortexVectorStore.from_texts(texts, embedding, domain="security")
docs = vs.similarity_search("authentication", k=5)
retriever = vs.as_retriever()

See langchain-qortex for the standalone package.

Mastra MastraVector

import { QortexVector } from "@peleke/mastra-qortex";

const qortex = new QortexVector({ id: "qortex" });
await qortex.createIndex({ indexName: "docs", dimension: 384 });
await qortex.upsert({ indexName: "docs", vectors: embeddings, metadata });
const results = await qortex.query({ indexName: "docs", queryVector: q, topK: 10 });

See @peleke/mastra-qortex for the standalone package.

MCP server

qortex mcp-serve  # stdio transport, works with Claude Desktop / any MCP client

Tools: qortex_query, qortex_explore, qortex_rules, qortex_feedback, qortex_ingest, qortex_domains, qortex_status, plus 9 vector-level tools (qortex_vector_*).

Project rules

from qortex.projectors.projection import Projection
from qortex.projectors.sources.flat import FlatRuleSource
from qortex.projectors.targets.buildlog_seed import BuildlogSeedTarget

projection = Projection(
    source=FlatRuleSource(backend=backend),
    target=BuildlogSeedTarget(persona_name="my_rules"),
)
result = projection.project(domains=["my_domain"])

Framework adapters

Framework Package Language Interface
LangChain langchain-qortex Python VectorStore ABC
Mastra @peleke/mastra-qortex TypeScript MastraVector abstract class
Any MCP client Built-in MCP server Any MCP tools (JSON-RPC)

Architecture

Sources (PDF/MD/Text)
  -> Ingestion (LLM extraction -> concepts + typed edges + rules)
    -> Knowledge Graph (InMemoryBackend | Memgraph)
      -> VectorIndex (NumpyVectorIndex | SqliteVecIndex)
        -> Retrieval (PPR + cosine -> combined scoring)
          -> Consumers (LangChain, Mastra, MCP, buildlog, agents)

Documentation

License

MIT

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

qortex-0.2.0.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qortex-0.2.0-py3-none-any.whl (148.6 kB view details)

Uploaded Python 3

File details

Details for the file qortex-0.2.0.tar.gz.

File metadata

  • Download URL: qortex-0.2.0.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qortex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 accc093e2e4d0a21642383b1c4d06284a63e448f2ebf5784be65ed09be45d73a
MD5 80d3deae723318e979611a340452972d
BLAKE2b-256 0a3bc3181f26c48e8415784853bea33293f54074901f93de73327f3c15f0e4a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for qortex-0.2.0.tar.gz:

Publisher: publish.yml on Peleke/qortex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qortex-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: qortex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 148.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qortex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39dfc80845bca840137caf55aa6cd1e5ccb19fc729b9ef3bdacf3d0c8c3bf625
MD5 5645739b16100fd096a3e5597ec97d92
BLAKE2b-256 b4760dc08d02e73d3e4d320ea033cca5ab7a922802201992716df827612272a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for qortex-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Peleke/qortex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page