Fix ontology RAG pipeline + add query concurrency (#691)

- Fix ontology RAG pipeline: embeddings API, chunker provenance, and query concurrency

- Fix ontology embeddings to use correct response shape from embed()
  API (returns list of vectors, not list of list of vectors).
- Simplify chunker URI logic to append /c{index} to parent ID
  instead of parsing page/doc URI structure which was fragile.

- Add provenance tracking and librarian integration to token
  chunker, matching recursive chunker capabilities.

- Add configurable concurrency (default 10) to Cassandra, Qdrant,
  and embeddings query services.
This commit is contained in:
cybermaggedon 2026-03-12 11:34:42 +00:00 committed by GitHub
parent 312174eb88
commit 45e6ad4abc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 148 additions and 50 deletions

View file

@ -24,6 +24,7 @@ logger = logging.getLogger(__name__)
default_ident = "row-embeddings-query"
default_store_uri = 'http://localhost:6333'
default_concurrency = 10
class Processor(FlowProcessor):
@ -31,6 +32,7 @@ class Processor(FlowProcessor):
def __init__(self, **params):
id = params.get("id", default_ident)
concurrency = params.get("concurrency", default_concurrency)
store_uri = params.get("store_uri", default_store_uri)
api_key = params.get("api_key", None)
@ -47,7 +49,8 @@ class Processor(FlowProcessor):
ConsumerSpec(
name="request",
schema=RowEmbeddingsRequest,
handler=self.on_message
handler=self.on_message,
concurrency=concurrency,
)
)
@ -205,6 +208,13 @@ class Processor(FlowProcessor):
help='API key for Qdrant (default: None)'
)
parser.add_argument(
'-c', '--concurrency',
type=int,
default=default_concurrency,
help=f'Number of concurrent requests (default: {default_concurrency})'
)
def run():
"""Entry point for row-embeddings-query-qdrant command"""

View file

@ -30,6 +30,7 @@ from ... graphql import GraphQLSchemaBuilder, SortDirection
logger = logging.getLogger(__name__)
default_ident = "rows-query"
default_concurrency = 10
class Processor(FlowProcessor):
@ -37,6 +38,7 @@ class Processor(FlowProcessor):
def __init__(self, **params):
id = params.get("id", default_ident)
concurrency = params.get("concurrency", default_concurrency)
# Get Cassandra parameters
cassandra_host = params.get("cassandra_host")
@ -69,7 +71,8 @@ class Processor(FlowProcessor):
ConsumerSpec(
name="request",
schema=RowsQueryRequest,
handler=self.on_message
handler=self.on_message,
concurrency=concurrency,
)
)
@ -517,6 +520,13 @@ class Processor(FlowProcessor):
help='Configuration type prefix for schemas (default: schema)'
)
parser.add_argument(
'-c', '--concurrency',
type=int,
default=default_concurrency,
help=f'Number of concurrent requests (default: {default_concurrency})'
)
def run():
"""Entry point for rows-query-cassandra command"""