BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications.
Python ai-agentsai-memoryknowledge-graphknowledge-managementknowledge-representationreccomendation-system
feat(pipeline): - added lightweight pipeline - added custom agent architecture - added local ollama llms support
Christian0c229d06f158
diff --git a/.env.example b/.env.exampleindex 3ec65df..a658f46 100644--- a/.env.example+++ b/.env.example@@ -14,6 +14,12 @@ GCP_CREDENTIALS_PATH=".path-to-credentials-file.json"AZURE_EMBEDDING_FULL_ENDPOINT="https://yourproject.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15"AZURE_EMBEDDING_KEY="xyz"EMBEDDINGS_SMALL_MODEL="paraphrase-multilingual-MiniLM-L12-v2"+EMBEDDINGS_LOCAL_MODEL="intfloat/e5-small"+EMBEDDING_NODES_DIMENSION=3072+EMBEDDING_TRIPLETS_DIMENSION=3072+EMBEDDING_OBSERVATIONS_DIMENSION=3072+EMBEDDING_DATA_DIMENSION=3072+EMBEDDING_RELATIONSHIPS_DIMENSION=3072# Cache envs# The following are just examples of the adapter implementation, you can have completely different envs@@ -70,10 +76,6 @@ CELERY_WORKER_CONCURRENCY=4INPUT_TOKEN_PRICE=0.0000005OUTPUT_TOKEN_PRICE=0.000003-# Graph Consolidator-# Used to consolidate the graph after ingestion of new data with a high level overview of the graph-RUN_GRAPH_CONSOLIDATOR="true"-# DocParser# Used to parse the documents into markdown text# and by forwarding the webhook (our app host) and the task identifier,@@ -85,4 +87,29 @@ DOCPARSER_TOKEN="your-docparser-token"# Spacy# Used to keep the spacy models in memory or reinitialize them on each request-SPACY_KEEP_MODELS_IN_MEMORY="true"\ No newline at end of file+SPACY_KEEP_MODELS_IN_MEMORY="true"++# Pipeline+# Used to configure the pipeline+# PIPELINE_MODE => lightweight = faster but less accurate, accurate = slower but more accurate+# MODELS_MODE => local = uses local models for llm and embeddings, remote = uses remote models for llm and embeddings+# OCR_MODE => docling = uses local docling ocr engine, docparser = uses remote docparser ocr pipeline engine+# AGENTIC_ARCHITECTURE => custom = uses the custom agentic architecture (faster and token efficient), langchain = uses the langchain agentic architecture+# RUN_GRAPH_CONSOLIDATOR => true = consolidates the graph after ingestion of new data with a high level overview of the graph, false = does not consolidate the graph+PIPELINE_MODE="accurate"+MODELS_MODE="remote"+OCR_MODE="docparser"+AGENTIC_ARCHITECTURE="custom"+RUN_GRAPH_CONSOLIDATOR="true"++# Ollama+# Used to configure the ollama models+# Tests with models using OpenAI's function tool calling are not currently compatible with BrainAPI+OLLAMA_HOST="localhost"+OLLAMA_PORT=11434+# OLLAMA_LLM_SMALL_MODEL="hf.co/unsloth/gpt-oss-20b-GGUF:Q4_K_M"+# OLLAMA_LLM_LARGE_MODEL="hf.co/unsloth/gpt-oss-20b-GGUF:Q4_K_M"+# OLLAMA_LLM_LARGE_MODEL="hf.co/MaziyarPanahi/Qwen3-8B-GGUF:Q4_K_M"+# OLLAMA_LLM_SMALL_MODEL="hf.co/MaziyarPanahi/Qwen3-8B-GGUF:Q4_K_M"+OLLAMA_LLM_SMALL_MODEL="hf.co/unsloth/Qwen3-14B-GGUF:Q4_K_M"+OLLAMA_LLM_LARGE_MODEL="hf.co/unsloth/Qwen3-14B-GGUF:Q4_K_M"\ No newline at end of filediff --git a/.gitignore b/.gitignoreindex 469cb4c..1f86e66 100644--- a/.gitignore+++ b/.gitignore@@ -1,6 +1,6 @@.vscode.env-volumes+volume*__pycache__*.excalidrawdistdiff --git a/poetry.lock b/poetry.lockindex 12a8f89..8dcd5a1 100644--- a/poetry.lock+++ b/poetry.lock@@ -1,5 +1,38 @@# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand.+[[package]]+name = "accelerate"+version = "1.12.0"+description = "Accelerate"+optional = false+python-versions = ">=3.10.0"+groups = ["main"]+files = [+ {file = "accelerate-1.12.0-py3-none-any.whl", hash = "sha256:3e2091cd341423207e2f084a6654b1efcd250dc326f2a37d6dde446e07cabb11"},+ {file = "accelerate-1.12.0.tar.gz", hash = "sha256:70988c352feb481887077d2ab845125024b2a137a5090d6d7a32b57d03a45df6"},+]++[package.dependencies]+huggingface_hub = ">=0.21.0"+numpy = ">=1.17"+packaging = ">=20.0"+psutil = "*"+pyyaml = "*"+safetensors = ">=0.4.3"+torch = ">=2.0.0"++[package.extras]+deepspeed = ["deepspeed"]+dev = ["bitsandbytes", "datasets", "diffusers", "evaluate", "parameterized", "pytest (>=7.2.0)", "pytest-order", "pytest-subtests", "pytest-xdist", "rich", "ruff (==0.13.1)", "scikit-learn", "scipy", "timm", "torchdata (>=0.8.0)", "torchpippy (>=0.2.0)", "tqdm", "transformers"]+quality = ["ruff (==0.13.1)"]+rich = ["rich"]+sagemaker = ["sagemaker"]+test-dev = ["bitsandbytes", "datasets", "diffusers", "evaluate", "scikit-learn", "scipy", "timm", "torchdata (>=0.8.0)", "torchpippy (>=0.2.0)", "tqdm", "transformers"]+test-fp8 = ["torchao"]+test-prod = ["parameterized", "pytest (>=7.2.0)", "pytest-order", "pytest-subtests", "pytest-xdist"]+test-trackers = ["comet-ml", "dvclive", "matplotlib", "swanlab[dashboard]", "tensorboard", "trackio", "wandb"]+testing = ["bitsandbytes", "datasets", "diffusers", "evaluate", "parameterized", "pytest (>=7.2.0)", "pytest-order", "pytest-subtests", "pytest-xdist", "scikit-learn", "scipy", "timm", "torchdata (>=0.8.0)", "torchpippy (>=0.2.0)", "tqdm", "transformers"]+[[package]]name = "amqp"version = "5.3.1"@@ -27,6 +60,17 @@ files = [{file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},]+[[package]]+name = "antlr4-python3-runtime"+version = "4.9.3"+description = "ANTLR 4.9.3 runtime for Python 3.7"+optional = false+python-versions = "*"+groups = ["main"]+files = [+ {file = "antlr4-python3-runtime-4.9.3.tar.gz", hash = "sha256:f224469b4168294902bb1efa80a8bf7855f24c99aef99cbefc1bcd3cce77881b"},+]+[[package]]name = "anyio"version = "4.11.0"@@ -84,6 +128,29 @@ files = [{file = "attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11"},]+[[package]]+name = "beautifulsoup4"+version = "4.14.3"+description = "Screen-scraping library"+optional = false+python-versions = ">=3.7.0"+groups = ["main"]+files = [+ {file = "beautifulsoup4-4.14.3-py3-none-any.whl", hash = "sha256:0918bfe44902e6ad8d57732ba310582e98da931428d231a5ecb9e7c703a735bb"},+ {file = "beautifulsoup4-4.14.3.tar.gz", hash = "sha256:6292b1c5186d356bba669ef9f7f051757099565ad9ada5dd630bd9de5fa7fb86"},+]++[package.dependencies]+soupsieve = ">=1.6.1"+typing-extensions = ">=4.0.0"++[package.extras]+cchardet = ["cchardet"]+chardet = ["chardet"]+charset-normalizer = ["charset-normalizer"]+html5lib = ["html5lib"]+lxml = ["lxml"]+[[package]]name = "billiard"version = "4.2.2"@@ -672,6 +739,24 @@ files = [{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},]+[[package]]+name = "colorlog"+version = "6.10.1"+description = "Add colours to the output of Python's logging module."+optional = false+python-versions = ">=3.6"+groups = ["main"]+files = [+ {file = "colorlog-6.10.1-py3-none-any.whl", hash = "sha256:2d7e8348291948af66122cff006c9f8da6255d224e7cf8e37d8de2df3bad8c9c"},+ {file = "colorlog-6.10.1.tar.gz", hash = "sha256:eb4ae5cb65fe7fec7773c2306061a8e63e02efc2c72eba9d27b0fa23c94f1321"},+]++[package.dependencies]+colorama = {version = "*", markers = "sys_platform == \"win32\""}++[package.extras]+development = ["black", "flake8", "mypy", "pytest", "types-colorama"]+[[package]]name = "confection"version = "0.1.5"@@ -898,6 +983,18 @@ files = [{file = "cymem-2.0.13.tar.gz", hash = "sha256:1c91a92ae8c7104275ac26bd4d29b08ccd3e7faff5893d3858cb6fadf1bc1588"},]+[[package]]+name = "defusedxml"+version = "0.7.1"+description = "XML bomb protection for Python stdlib modules"+optional = false+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"+groups = ["main"]+files = [+ {file = "defusedxml-0.7.1-py2.py3-none-any.whl", hash = "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61"},+ {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"},+]+[[package]]name = "dill"version = "0.4.0"@@ -947,6 +1044,167 @@ idna = ["idna (>=3.10)"]trio = ["trio (>=0.30)"]wmi = ["wmi (>=1.5.1) ; platform_system == \"Windows\""]+[[package]]+name = "docling"+version = "2.74.0"+description = "SDK and CLI for parsing PDF, DOCX, HTML, and more, to a unified document representation for powering downstream workflows such as gen AI applications."+optional = false+python-versions = "<4.0,>=3.10"+groups = ["main"]+files = [+ {file = "docling-2.74.0-py3-none-any.whl", hash = "sha256:931e9a522cd295cf523eebc3b52e507c7cf8709e0e7e9a7a84192051f3d62848"},+ {file = "docling-2.74.0.tar.gz", hash = "sha256:107e7e0854c1ecb56c6381a07f87d587c3606386ca56f0d22917cb49e1349468"},+]++[package.dependencies]+accelerate = ">=1.0.0,<2"+beautifulsoup4 = ">=4.12.3,<5.0.0"+certifi = ">=2024.7.4"+defusedxml = ">=0.7.1,<0.8.0"+docling-core = {version = ">=2.62.0,<3.0.0", extras = ["chunking"]}+docling-ibm-models = ">=3.9.1,<4"+docling-parse = ">=5.3.2,<6.0.0"+filetype = ">=1.2.0,<2.0.0"+huggingface_hub = ">=0.23,<1"+lxml = ">=4.0.0,<7.0.0"+marko = ">=2.1.2,<3.0.0"+ocrmac = {version = ">=1.0.0,<2.0.0", markers = "sys_platform == \"darwin\""}+openpyxl = ">=3.1.5,<4.0.0"+pandas = ">=2.1.4,<3.0.0"+pillow = ">=10.0.0,<13.0.0"+pluggy = ">=1.0.0,<2.0.0"+polyfactory = ">=2.22.2"+pydantic = ">=2.0.0,<3.0.0"+pydantic-settings = ">=2.3.0,<3.0.0"+pylatexenc = ">=2.10,<3.0"+pypdfium2 = ">=4.30.0,<4.30.1 || >4.30.1,<6.0.0"+python-docx = ">=1.1.2,<2.0.0"+python-pptx = ">=1.0.2,<2.0.0"+rapidocr = ">=3.3,<4.0.0"+requests = ">=2.32.2,<3.0.0"+rtree = ">=1.3.0,<2.0.0"+scipy = ">=1.6.0,<2.0.0"+tqdm = ">=4.65.0,<5.0.0"+typer = ">=0.12.5,<0.22.0"++[package.extras]+asr = ["mlx-whisper (>=0.4.3) ; python_version >= \"3.10\" and sys_platform == \"darwin\" and platform_machine == \"arm64\"", "numba (>=0.63.0)", "openai-whisper (>=20250625)"]+easyocr = ["easyocr (>=1.7,<2.0)"]+ocrmac = ["ocrmac (>=1.0.0,<2.0.0) ; sys_platform == \"darwin\""]+onnxruntime = ["onnxruntime (<1.24) ; python_version < \"3.14\" and sys_platform == \"darwin\"", "onnxruntime-gpu (<1.24) ; python_version < \"3.14\" and (sys_platform == \"linux\" or sys_platform == \"win32\")"]+rapidocr = ["onnxruntime (>=1.7.0,<2.0.0) ; python_version < \"3.14\"", "rapidocr (>=3.3,<4.0.0)"]+tesserocr = ["tesserocr (>=2.7.1,<3.0.0)"]+vlm = ["accelerate (>=1.2.1,<2.0.0)", "mlx-vlm (>=0.3.0,<1.0.0) ; python_version >= \"3.10\" and sys_platform == \"darwin\" and platform_machine == \"arm64\"", "qwen-vl-utils (>=0.0.11)", "transformers (>=4.46.0,<5.0.0)"]++[[package]]+name = "docling-core"+version = "2.65.1"+description = "A python library to define and validate data types in Docling."+optional = false+python-versions = "<4.0,>=3.10"+groups = ["main"]+files = [+ {file = "docling_core-2.65.1-py3-none-any.whl", hash = "sha256:fcdb30254bc5046b52b8bec5919de3b6cdbeed915399cede5351ff328cdd020d"},+ {file = "docling_core-2.65.1.tar.gz", hash = "sha256:3a143adb9cc613c503380eff92f5895078fc5a00fc7264f327d0d85ff60176cd"},+]++[package.dependencies]+defusedxml = ">=0.7.1,<0.8.0"+jsonref = ">=1.1.0,<2.0.0"+jsonschema = ">=4.16.0,<5.0.0"+latex2mathml = ">=3.77.0,<4.0.0"+pandas = ">=2.1.4,<3.0.0"+pillow = ">=10.0.0,<13.0.0"+pydantic = ">=2.6.0,<2.10.0 || >2.10.0,<2.10.1 || >2.10.1,<2.10.2 || >2.10.2,<3.0.0"+pyyaml = ">=5.1,<7.0.0"+semchunk = {version = ">=2.2.0,<3.0.0", optional = true, markers = "extra == \"chunking\""}+tabulate = ">=0.9.0,<0.10.0"+transformers = {version = ">=4.34.0,<5.0.0", optional = true, markers = "extra == \"chunking\""}+tree-sitter = {version = ">=0.25.0,<0.27.0", optional = true, markers = "extra == \"chunking\""}+tree-sitter-c = {version = ">=0.23.4", optional = true, markers = "extra == \"chunking\""}+tree-sitter-javascript = {version = ">=0.23.1", optional = true, markers = "extra == \"chunking\""}+tree-sitter-python = {version = ">=0.23.6", optional = true, markers = "extra == \"chunking\""}+tree-sitter-typescript = {version = ">=0.23.2", optional = true, markers = "extra == \"chunking\""}+typer = ">=0.12.5,<0.22.0"+typing-extensions = ">=4.12.2,<5.0.0"++[package.extras]+chunking = ["semchunk (>=2.2.0,<3.0.0)", "transformers (>=4.34.0,<5.0.0)", "tree-sitter (>=0.25.0,<0.27.0)", "tree-sitter-c (>=0.23.4)", "tree-sitter-javascript (>=0.23.1)", "tree-sitter-python (>=0.23.6)", "tree-sitter-typescript (>=0.23.2)"]+chunking-openai = ["semchunk (>=2.2.0,<3.0.0)", "tiktoken (>=0.9.0,<0.13.0)", "tree-sitter (>=0.25.0,<0.27.0)", "tree-sitter-c (>=0.23.4)", "tree-sitter-javascript (>=0.23.1)", "tree-sitter-python (>=0.23.6)", "tree-sitter-typescript (>=0.23.2)"]+examples = ["datasets (>=4.0.0)", "matplotlib (>=3.7.0)", "openpyxl (>=3.1.5)", "pandas (>=2.3.3)"]++[[package]]+name = "docling-ibm-models"+version = "3.11.0"+description = "This package contains the AI models used by the Docling PDF conversion package"+optional = false+python-versions = "<4.0,>=3.10"+groups = ["main"]+files = [+ {file = "docling_ibm_models-3.11.0-py3-none-any.whl", hash = "sha256:68f7961069d643bfdab21b1c9ef24a979db293496f4c2283d95b1025a9ac5347"},+ {file = "docling_ibm_models-3.11.0.tar.gz", hash = "sha256:454401563a8e79cb33b718bc559d9bacca8a0183583e48f8e616c9184c1f5eb1"},+]++[package.dependencies]+accelerate = ">=1.2.1,<2.0.0"+docling-core = ">=2.19.0,<3.0.0"+huggingface_hub = ">=0.23,<2"+jsonlines = ">=3.1.0,<5.0.0"+numpy = ">=1.24.4,<3.0.0"+Pillow = ">=10.0.0,<13.0.0"+pydantic = ">=2.0.0,<3.0.0"+rtree = ">=1.0.0"+safetensors = {version = ">=0.4.3,<1", extras = ["torch"]}+torch = ">=2.2.2,<3.0.0"+torchvision = ">=0,<1"+tqdm = ">=4.64.0,<5.0.0"+transformers = ">=4.42.0,<5.0.0"++[package.extras]+opencv-python = ["opencv-python (>=4.6.0.66,<5.0.0.0)"]+opencv-python-headless = ["opencv-python-headless (>=4.6.0.66,<5.0.0.0)"]++[[package]]+name = "docling-parse"+version = "5.3.3"+description = "Simple package to extract text with coordinates from programmatic PDFs"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "docling_parse-5.3.3-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:aa880d0594fa5edf57522b7704950f9e2bc484de9a046d94839e9cc2cfa49941"},+ {file = "docling_parse-5.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c22ab0d86c042f8745be4bcb2edd2afd263ab978c73a553a754ae750d581f74"},+ {file = "docling_parse-5.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c19fdfb13b8015a8886694f5894874f579e134cc456ed49b86757c413a84aa78"},+ {file = "docling_parse-5.3.3-cp310-cp310-win_amd64.whl", hash = "sha256:97acbcd4bd2d89ef4c28209ac138833bd4df432de3a533dda1fdfdc04e8db50b"},+ {file = "docling_parse-5.3.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:cb700693be4b7b1172a7201eb60ed4f8b2e47feb5366e1c25111fa6e6fa04f01"},+ {file = "docling_parse-5.3.3-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e420970361103a0c09b8edb220e9d30652d7a2a1a3021d35d5211cbc639fd2ea"},+ {file = "docling_parse-5.3.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e98cd302f8dd31159f7063befc51460e8ef0ad3c2c57c2c1ea711f18000335e"},+ {file = "docling_parse-5.3.3-cp311-cp311-win_amd64.whl", hash = "sha256:ae22fb4857ce244948d1de67dc9c2863cfe251d153de70751d133ccadf0b7670"},+ {file = "docling_parse-5.3.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:087985ae6ae9cbe7690e60592b1e41a8a282ecb3509957833bd6931cd745fca5"},+ {file = "docling_parse-5.3.3-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4912ee081d20238e2de78bb0c76b23c6391f48f883ac70c9fcdd4ac629688434"},+ {file = "docling_parse-5.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:37df23ab92620891278d3ee4576431652bb4e980fbcca69bc6814d32182d0a62"},+ {file = "docling_parse-5.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:4d37095f4bf471e86422828ce1615099d02f9fb352e5e2dfc766bac9a8005427"},+ {file = "docling_parse-5.3.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:3deaa7070b259ad3fa24b6d03d5283d65744f9d8573cd44f9aacee91ed1cd5c1"},+ {file = "docling_parse-5.3.3-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:872d9fd051caed6e866b0f7200c0aea3fb436eab6403cbefc1057c9a55ca4649"},+ {file = "docling_parse-5.3.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c606cd8b6815accb7e3e0c27ae06eda55677bb582d5be7ae6f814aecedd28ab"},+ {file = "docling_parse-5.3.3-cp313-cp313-win_amd64.whl", hash = "sha256:54f7f04cf886cbce490723d2f05b936bf85a39fb7446f2de02bf03c1b2fb8ba8"},+ {file = "docling_parse-5.3.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:fa34828e47d94f304fb12c21e37ee1dd5f94b31d118adb8d0e69043c3353c5d0"},+ {file = "docling_parse-5.3.3-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bff9dd7eefe376f4558868a6393950196a3baa81c60ffc1eb87e1be8781aaf76"},+ {file = "docling_parse-5.3.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3f3a997a9441a60bf6f1d5526a96e426a8414acb219c26fff0bf2932e863f418"},+ {file = "docling_parse-5.3.3-cp314-cp314-win_amd64.whl", hash = "sha256:0d940a0048e0469ceba757966921806266a0ab5b54b422b62768430bfd25247b"},+ {file = "docling_parse-5.3.3.tar.gz", hash = "sha256:d3bc34bc236b205c466334870a4284c75ac5dc973294107f2523548fac2b3408"},+]++[package.dependencies]+docling-core = ">=2.65.1"+pillow = ">=10.0.0,<13.0.0"+pydantic = ">=2.0.0"+pywin32 = {version = ">=305", markers = "sys_platform == \"win32\""}+tabulate = ">=0.9.0,<1.0.0"++[package.extras]+perf-tools = ["pdfplumber (>=0.11.7)", "pymupdf (>=1.26.4)", "pypdfium2 (>=4.30.0)"]+[[package]]name = "docstring-parser"version = "0.17.0"@@ -964,6 +1222,36 @@ dev = ["pre-commit (>=2.16.0) ; python_version >= \"3.9\"", "pydoctor (>=25.4.0)docs = ["pydoctor (>=25.4.0)"]test = ["pytest"]+[[package]]+name = "et-xmlfile"+version = "2.0.0"+description = "An implementation of lxml.xmlfile for the standard library"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "et_xmlfile-2.0.0-py3-none-any.whl", hash = "sha256:7a91720bc756843502c3b7504c77b8fe44217c85c537d85037f0f536151b2caa"},+ {file = "et_xmlfile-2.0.0.tar.gz", hash = "sha256:dab3f4764309081ce75662649be815c4c9081e88f0837825f90fd28317d4da54"},+]++[[package]]+name = "faker"+version = "40.4.0"+description = "Faker is a Python package that generates fake data for you."+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "faker-40.4.0-py3-none-any.whl", hash = "sha256:486d43c67ebbb136bc932406418744f9a0bdf2c07f77703ea78b58b77e9aa443"},+ {file = "faker-40.4.0.tar.gz", hash = "sha256:76f8e74a3df28c3e2ec2caafa956e19e37a132fdc7ea067bc41783affcfee364"},+]++[package.dependencies]+tzdata = {version = "*", markers = "platform_system == \"Windows\""}++[package.extras]+tzdata = ["tzdata"]+[[package]]name = "fastapi"version = "0.119.0"@@ -998,6 +1286,18 @@ files = [{file = "filelock-3.20.1.tar.gz", hash = "sha256:b8360948b351b80f420878d8516519a2204b07aefcdcfd24912a5d33127f188c"},]+[[package]]+name = "filetype"+version = "1.2.0"+description = "Infer file type and MIME type of any file/buffer. No external dependencies."+optional = false+python-versions = "*"+groups = ["main"]+files = [+ {file = "filetype-1.2.0-py2.py3-none-any.whl", hash = "sha256:7ce71b6880181241cf7ac8697a2f1eb6a8bd9b429f7ad6d27b8db9ba5f1c2d25"},+ {file = "filetype-1.2.0.tar.gz", hash = "sha256:66b56cd6474bf41d8c54660347d37afcc3f7d1970648de365c102ef77548aadb"},+]+[[package]]name = "fsspec"version = "2025.12.0"@@ -1815,6 +2115,21 @@ files = [{file = "joblib-1.5.3.tar.gz", hash = "sha256:8561a3269e6801106863fd0d6d84bb737be9e7631e33aaed3fb9ce5953688da3"},]+[[package]]+name = "jsonlines"+version = "4.0.0"+description = "Library with helpers for the jsonlines file format"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "jsonlines-4.0.0-py3-none-any.whl", hash = "sha256:185b334ff2ca5a91362993f42e83588a360cf95ce4b71a73548502bda52a7c55"},+ {file = "jsonlines-4.0.0.tar.gz", hash = "sha256:0c6d2c09117550c089995247f605ae4cf77dd1533041d366351f6f298822ea74"},+]++[package.dependencies]+attrs = ">=19.2.0"+[[package]]name = "jsonpatch"version = "1.33"@@ -1842,6 +2157,18 @@ files = [{file = "jsonpointer-3.0.0.tar.gz", hash = "sha256:2b2d729f2091522d61c3b31f82e11870f60b68f43fbc705cb76bf4b832af59ef"},]+[[package]]+name = "jsonref"+version = "1.1.0"+description = "jsonref is a library for automatic dereferencing of JSON Reference objects for Python."+optional = false+python-versions = ">=3.7"+groups = ["main"]+files = [+ {file = "jsonref-1.1.0-py3-none-any.whl", hash = "sha256:590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9"},+ {file = "jsonref-1.1.0.tar.gz", hash = "sha256:32fe8e1d85af0fdefbebce950af85590b22b60f9e95443176adbde4e1ecea552"},+]+[[package]]name = "jsonschema"version = "4.26.0"@@ -2158,6 +2485,18 @@ otel = ["opentelemetry-api (>=1.30.0)", "opentelemetry-exporter-otlp-proto-httppytest = ["pytest (>=7.0.0)", "rich (>=13.9.4)", "vcrpy (>=7.0.0)"]vcr = ["vcrpy (>=7.0.0)"]+[[package]]+name = "latex2mathml"+version = "3.78.1"+description = "Pure Python library for LaTeX to MathML conversion"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "latex2mathml-3.78.1-py3-none-any.whl", hash = "sha256:f089b6d75e85b937f99693c93e8c16c0804008672c3dd2a3d25affd36f238100"},+ {file = "latex2mathml-3.78.1.tar.gz", hash = "sha256:f941db80bf41db33f31df87b304e8b588f8166b813b0257c11c98f7a9d0aac71"},+]+[[package]]name = "levenshtein"version = "0.27.1"@@ -2265,6 +2604,162 @@ files = [[package.dependencies]rapidfuzz = ">=3.9.0,<4.0.0"+[[package]]+name = "lxml"+version = "6.0.2"+description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "lxml-6.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e77dd455b9a16bbd2a5036a63ddbd479c19572af81b624e79ef422f929eef388"},+ {file = "lxml-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5d444858b9f07cefff6455b983aea9a67f7462ba1f6cbe4a21e8bf6791bf2153"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f952dacaa552f3bb8834908dddd500ba7d508e6ea6eb8c52eb2d28f48ca06a31"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:71695772df6acea9f3c0e59e44ba8ac50c4f125217e84aab21074a1a55e7e5c9"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:17f68764f35fd78d7c4cc4ef209a184c38b65440378013d24b8aecd327c3e0c8"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:058027e261afed589eddcfe530fcc6f3402d7fd7e89bfd0532df82ebc1563dba"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a8ffaeec5dfea5881d4c9d8913a32d10cfe3923495386106e4a24d45300ef79c"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux_2_31_armv7l.whl", hash = "sha256:f2e3b1a6bb38de0bc713edd4d612969dd250ca8b724be8d460001a387507021c"},+ {file = "lxml-6.0.2-cp310-cp310-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d6690ec5ec1cce0385cb20896b16be35247ac8c2046e493d03232f1c2414d321"},+ {file = "lxml-6.0.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f2a50c3c1d11cad0ebebbac357a97b26aa79d2bcaf46f256551152aa85d3a4d1"},+ {file = "lxml-6.0.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:3efe1b21c7801ffa29a1112fab3b0f643628c30472d507f39544fd48e9549e34"},+ {file = "lxml-6.0.2-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:59c45e125140b2c4b33920d21d83681940ca29f0b83f8629ea1a2196dc8cfe6a"},+ {file = "lxml-6.0.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:452b899faa64f1805943ec1c0c9ebeaece01a1af83e130b69cdefeda180bb42c"},+ {file = "lxml-6.0.2-cp310-cp310-win32.whl", hash = "sha256:1e786a464c191ca43b133906c6903a7e4d56bef376b75d97ccbb8ec5cf1f0a4b"},+ {file = "lxml-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:dacf3c64ef3f7440e3167aa4b49aa9e0fb99e0aa4f9ff03795640bf94531bcb0"},+ {file = "lxml-6.0.2-cp310-cp310-win_arm64.whl", hash = "sha256:45f93e6f75123f88d7f0cfd90f2d05f441b808562bf0bc01070a00f53f5028b5"},+ {file = "lxml-6.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:13e35cbc684aadf05d8711a5d1b5857c92e5e580efa9a0d2be197199c8def607"},+ {file = "lxml-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3b1675e096e17c6fe9c0e8c81434f5736c0739ff9ac6123c87c2d452f48fc938"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8ac6e5811ae2870953390452e3476694196f98d447573234592d30488147404d"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5aa0fc67ae19d7a64c3fe725dc9a1bb11f80e01f78289d05c6f62545affec438"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de496365750cc472b4e7902a485d3f152ecf57bd3ba03ddd5578ed8ceb4c5964"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:200069a593c5e40b8f6fc0d84d86d970ba43138c3e68619ffa234bc9bb806a4d"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d2de809c2ee3b888b59f995625385f74629707c9355e0ff856445cdcae682b7"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux_2_31_armv7l.whl", hash = "sha256:b2c3da8d93cf5db60e8858c17684c47d01fee6405e554fb55018dd85fc23b178"},+ {file = "lxml-6.0.2-cp311-cp311-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:442de7530296ef5e188373a1ea5789a46ce90c4847e597856570439621d9c553"},+ {file = "lxml-6.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2593c77efde7bfea7f6389f1ab249b15ed4aa5bc5cb5131faa3b843c429fbedb"},+ {file = "lxml-6.0.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:3e3cb08855967a20f553ff32d147e14329b3ae70ced6edc2f282b94afbc74b2a"},+ {file = "lxml-6.0.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:2ed6c667fcbb8c19c6791bbf40b7268ef8ddf5a96940ba9404b9f9a304832f6c"},+ {file = "lxml-6.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b8f18914faec94132e5b91e69d76a5c1d7b0c73e2489ea8929c4aaa10b76bbf7"},+ {file = "lxml-6.0.2-cp311-cp311-win32.whl", hash = "sha256:6605c604e6daa9e0d7f0a2137bdc47a2e93b59c60a65466353e37f8272f47c46"},+ {file = "lxml-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e5867f2651016a3afd8dd2c8238baa66f1e2802f44bc17e236f547ace6647078"},+ {file = "lxml-6.0.2-cp311-cp311-win_arm64.whl", hash = "sha256:4197fb2534ee05fd3e7afaab5d8bfd6c2e186f65ea7f9cd6a82809c887bd1285"},+ {file = "lxml-6.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a59f5448ba2ceccd06995c95ea59a7674a10de0810f2ce90c9006f3cbc044456"},+ {file = "lxml-6.0.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e8113639f3296706fbac34a30813929e29247718e88173ad849f57ca59754924"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a8bef9b9825fa8bc816a6e641bb67219489229ebc648be422af695f6e7a4fa7f"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:65ea18d710fd14e0186c2f973dc60bb52039a275f82d3c44a0e42b43440ea534"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c371aa98126a0d4c739ca93ceffa0fd7a5d732e3ac66a46e74339acd4d334564"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:700efd30c0fa1a3581d80a748157397559396090a51d306ea59a70020223d16f"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c33e66d44fe60e72397b487ee92e01da0d09ba2d66df8eae42d77b6d06e5eba0"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:90a345bbeaf9d0587a3aaffb7006aa39ccb6ff0e96a57286c0cb2fd1520ea192"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:064fdadaf7a21af3ed1dcaa106b854077fbeada827c18f72aec9346847cd65d0"},+ {file = "lxml-6.0.2-cp312-cp312-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fbc74f42c3525ac4ffa4b89cbdd00057b6196bcefe8bce794abd42d33a018092"},+ {file = "lxml-6.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6ddff43f702905a4e32bc24f3f2e2edfe0f8fde3277d481bffb709a4cced7a1f"},+ {file = "lxml-6.0.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:6da5185951d72e6f5352166e3da7b0dc27aa70bd1090b0eb3f7f7212b53f1bb8"},+ {file = "lxml-6.0.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:57a86e1ebb4020a38d295c04fc79603c7899e0df71588043eb218722dabc087f"},+ {file = "lxml-6.0.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:2047d8234fe735ab77802ce5f2297e410ff40f5238aec569ad7c8e163d7b19a6"},+ {file = "lxml-6.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6f91fd2b2ea15a6800c8e24418c0775a1694eefc011392da73bc6cef2623b322"},+ {file = "lxml-6.0.2-cp312-cp312-win32.whl", hash = "sha256:3ae2ce7d6fedfb3414a2b6c5e20b249c4c607f72cb8d2bb7cc9c6ec7c6f4e849"},+ {file = "lxml-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:72c87e5ee4e58a8354fb9c7c84cbf95a1c8236c127a5d1b7683f04bed8361e1f"},+ {file = "lxml-6.0.2-cp312-cp312-win_arm64.whl", hash = "sha256:61cb10eeb95570153e0c0e554f58df92ecf5109f75eacad4a95baa709e26c3d6"},+ {file = "lxml-6.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:9b33d21594afab46f37ae58dfadd06636f154923c4e8a4d754b0127554eb2e77"},+ {file = "lxml-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6c8963287d7a4c5c9a432ff487c52e9c5618667179c18a204bdedb27310f022f"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1941354d92699fb5ffe6ed7b32f9649e43c2feb4b97205f75866f7d21aa91452"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bb2f6ca0ae2d983ded09357b84af659c954722bbf04dea98030064996d156048"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb2a12d704f180a902d7fa778c6d71f36ceb7b0d317f34cdc76a5d05aa1dd1df"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:6ec0e3f745021bfed19c456647f0298d60a24c9ff86d9d051f52b509663feeb1"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:846ae9a12d54e368933b9759052d6206a9e8b250291109c48e350c1f1f49d916"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ef9266d2aa545d7374938fb5c484531ef5a2ec7f2d573e62f8ce722c735685fd"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:4077b7c79f31755df33b795dc12119cb557a0106bfdab0d2c2d97bd3cf3dffa6"},+ {file = "lxml-6.0.2-cp313-cp313-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a7c5d5e5f1081955358533be077166ee97ed2571d6a66bdba6ec2f609a715d1a"},+ {file = "lxml-6.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8f8d0cbd0674ee89863a523e6994ac25fd5be9c8486acfc3e5ccea679bad2679"},+ {file = "lxml-6.0.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:2cbcbf6d6e924c28f04a43f3b6f6e272312a090f269eff68a2982e13e5d57659"},+ {file = "lxml-6.0.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:dfb874cfa53340009af6bdd7e54ebc0d21012a60a4e65d927c2e477112e63484"},+ {file = "lxml-6.0.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:fb8dae0b6b8b7f9e96c26fdd8121522ce5de9bb5538010870bd538683d30e9a2"},+ {file = "lxml-6.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:358d9adae670b63e95bc59747c72f4dc97c9ec58881d4627fe0120da0f90d314"},+ {file = "lxml-6.0.2-cp313-cp313-win32.whl", hash = "sha256:e8cd2415f372e7e5a789d743d133ae474290a90b9023197fd78f32e2dc6873e2"},+ {file = "lxml-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:b30d46379644fbfc3ab81f8f82ae4de55179414651f110a1514f0b1f8f6cb2d7"},+ {file = "lxml-6.0.2-cp313-cp313-win_arm64.whl", hash = "sha256:13dcecc9946dca97b11b7c40d29fba63b55ab4170d3c0cf8c0c164343b9bfdcf"},+ {file = "lxml-6.0.2-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:b0c732aa23de8f8aec23f4b580d1e52905ef468afb4abeafd3fec77042abb6fe"},+ {file = "lxml-6.0.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4468e3b83e10e0317a89a33d28f7aeba1caa4d1a6fd457d115dd4ffe90c5931d"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:abd44571493973bad4598a3be7e1d807ed45aa2adaf7ab92ab7c62609569b17d"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:370cd78d5855cfbffd57c422851f7d3864e6ae72d0da615fca4dad8c45d375a5"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:901e3b4219fa04ef766885fb40fa516a71662a4c61b80c94d25336b4934b71c0"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:a4bf42d2e4cf52c28cc1812d62426b9503cdb0c87a6de81442626aa7d69707ba"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b2c7fdaa4d7c3d886a42534adec7cfac73860b89b4e5298752f60aa5984641a0"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:98a5e1660dc7de2200b00d53fa00bcd3c35a3608c305d45a7bbcaf29fa16e83d"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:dc051506c30b609238d79eda75ee9cab3e520570ec8219844a72a46020901e37"},+ {file = "lxml-6.0.2-cp314-cp314-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8799481bbdd212470d17513a54d568f44416db01250f49449647b5ab5b5dccb9"},+ {file = "lxml-6.0.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9261bb77c2dab42f3ecd9103951aeca2c40277701eb7e912c545c1b16e0e4917"},+ {file = "lxml-6.0.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:65ac4a01aba353cfa6d5725b95d7aed6356ddc0a3cd734de00124d285b04b64f"},+ {file = "lxml-6.0.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:b22a07cbb82fea98f8a2fd814f3d1811ff9ed76d0fc6abc84eb21527596e7cc8"},+ {file = "lxml-6.0.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:d759cdd7f3e055d6bc8d9bec3ad905227b2e4c785dc16c372eb5b5e83123f48a"},+ {file = "lxml-6.0.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:945da35a48d193d27c188037a05fec5492937f66fb1958c24fc761fb9d40d43c"},+ {file = "lxml-6.0.2-cp314-cp314-win32.whl", hash = "sha256:be3aaa60da67e6153eb15715cc2e19091af5dc75faef8b8a585aea372507384b"},+ {file = "lxml-6.0.2-cp314-cp314-win_amd64.whl", hash = "sha256:fa25afbadead523f7001caf0c2382afd272c315a033a7b06336da2637d92d6ed"},+ {file = "lxml-6.0.2-cp314-cp314-win_arm64.whl", hash = "sha256:063eccf89df5b24e361b123e257e437f9e9878f425ee9aae3144c77faf6da6d8"},+ {file = "lxml-6.0.2-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:6162a86d86893d63084faaf4ff937b3daea233e3682fb4474db07395794fa80d"},+ {file = "lxml-6.0.2-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:414aaa94e974e23a3e92e7ca5b97d10c0cf37b6481f50911032c69eeb3991bba"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:48461bd21625458dd01e14e2c38dd0aea69addc3c4f960c30d9f59d7f93be601"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:25fcc59afc57d527cfc78a58f40ab4c9b8fd096a9a3f964d2781ffb6eb33f4ed"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5179c60288204e6ddde3f774a93350177e08876eaf3ab78aa3a3649d43eb7d37"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:967aab75434de148ec80597b75062d8123cadf2943fb4281f385141e18b21338"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d100fcc8930d697c6561156c6810ab4a508fb264c8b6779e6e61e2ed5e7558f9"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ca59e7e13e5981175b8b3e4ab84d7da57993eeff53c07764dcebda0d0e64ecd"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:957448ac63a42e2e49531b9d6c0fa449a1970dbc32467aaad46f11545be9af1d"},+ {file = "lxml-6.0.2-cp314-cp314t-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b7fc49c37f1786284b12af63152fe1d0990722497e2d5817acfe7a877522f9a9"},+ {file = "lxml-6.0.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e19e0643cc936a22e837f79d01a550678da8377d7d801a14487c10c34ee49c7e"},+ {file = "lxml-6.0.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:1db01e5cf14345628e0cbe71067204db658e2fb8e51e7f33631f5f4735fefd8d"},+ {file = "lxml-6.0.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:875c6b5ab39ad5291588aed6925fac99d0097af0dd62f33c7b43736043d4a2ec"},+ {file = "lxml-6.0.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:cdcbed9ad19da81c480dfd6dd161886db6096083c9938ead313d94b30aadf272"},+ {file = "lxml-6.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:80dadc234ebc532e09be1975ff538d154a7fa61ea5031c03d25178855544728f"},+ {file = "lxml-6.0.2-cp314-cp314t-win32.whl", hash = "sha256:da08e7bb297b04e893d91087df19638dc7a6bb858a954b0cc2b9f5053c922312"},+ {file = "lxml-6.0.2-cp314-cp314t-win_amd64.whl", hash = "sha256:252a22982dca42f6155125ac76d3432e548a7625d56f5a273ee78a5057216eca"},+ {file = "lxml-6.0.2-cp314-cp314t-win_arm64.whl", hash = "sha256:bb4c1847b303835d89d785a18801a883436cdfd5dc3d62947f9c49e24f0f5a2c"},+ {file = "lxml-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a656ca105115f6b766bba324f23a67914d9c728dafec57638e2b92a9dcd76c62"},+ {file = "lxml-6.0.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c54d83a2188a10ebdba573f16bd97135d06c9ef60c3dc495315c7a28c80a263f"},+ {file = "lxml-6.0.2-cp38-cp38-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:1ea99340b3c729beea786f78c38f60f4795622f36e305d9c9be402201efdc3b7"},+ {file = "lxml-6.0.2-cp38-cp38-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:af85529ae8d2a453feee4c780d9406a5e3b17cee0dd75c18bd31adcd584debc3"},+ {file = "lxml-6.0.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:fe659f6b5d10fb5a17f00a50eb903eb277a71ee35df4615db573c069bcf967ac"},+ {file = "lxml-6.0.2-cp38-cp38-win32.whl", hash = "sha256:5921d924aa5468c939d95c9814fa9f9b5935a6ff4e679e26aaf2951f74043512"},+ {file = "lxml-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:0aa7070978f893954008ab73bb9e3c24a7c56c054e00566a21b553dc18105fca"},+ {file = "lxml-6.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2c8458c2cdd29589a8367c09c8f030f1d202be673f0ca224ec18590b3b9fb694"},+ {file = "lxml-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3fee0851639d06276e6b387f1c190eb9d7f06f7f53514e966b26bae46481ec90"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b2142a376b40b6736dfc214fd2902409e9e3857eff554fed2d3c60f097e62a62"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a6b5b39cc7e2998f968f05309e666103b53e2edd01df8dc51b90d734c0825444"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d4aec24d6b72ee457ec665344a29acb2d35937d5192faebe429ea02633151aad"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux_2_26_i686.manylinux_2_28_i686.whl", hash = "sha256:b42f4d86b451c2f9d06ffb4f8bbc776e04df3ba070b9fe2657804b1b40277c48"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cdaefac66e8b8f30e37a9b4768a391e1f8a16a7526d5bc77a7928408ef68e93"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux_2_31_armv7l.whl", hash = "sha256:b738f7e648735714bbb82bdfd030203360cfeab7f6e8a34772b3c8c8b820568c"},+ {file = "lxml-6.0.2-cp39-cp39-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:daf42de090d59db025af61ce6bdb2521f0f102ea0e6ea310f13c17610a97da4c"},+ {file = "lxml-6.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:66328dabea70b5ba7e53d94aa774b733cf66686535f3bc9250a7aab53a91caaf"},+ {file = "lxml-6.0.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:e237b807d68a61fc3b1e845407e27e5eb8ef69bc93fe8505337c1acb4ee300b6"},+ {file = "lxml-6.0.2-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:ac02dc29fd397608f8eb15ac1610ae2f2f0154b03f631e6d724d9e2ad4ee2c84"},+ {file = "lxml-6.0.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:817ef43a0c0b4a77bd166dc9a09a555394105ff3374777ad41f453526e37f9cb"},+ {file = "lxml-6.0.2-cp39-cp39-win32.whl", hash = "sha256:bc532422ff26b304cfb62b328826bd995c96154ffd2bac4544f37dbb95ecaa8f"},+ {file = "lxml-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:995e783eb0374c120f528f807443ad5a83a656a8624c467ea73781fc5f8a8304"},+ {file = "lxml-6.0.2-cp39-cp39-win_arm64.whl", hash = "sha256:08b9d5e803c2e4725ae9e8559ee880e5328ed61aa0935244e0515d7d9dbec0aa"},+ {file = "lxml-6.0.2-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:e748d4cf8fef2526bb2a589a417eba0c8674e29ffcb570ce2ceca44f1e567bf6"},+ {file = "lxml-6.0.2-pp310-pypy310_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4ddb1049fa0579d0cbd00503ad8c58b9ab34d1254c77bc6a5576d96ec7853dba"},+ {file = "lxml-6.0.2-pp310-pypy310_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cb233f9c95f83707dae461b12b720c1af9c28c2d19208e1be03387222151daf5"},+ {file = "lxml-6.0.2-pp310-pypy310_pp73-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bc456d04db0515ce3320d714a1eac7a97774ff0849e7718b492d957da4631dd4"},+ {file = "lxml-6.0.2-pp310-pypy310_pp73-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2613e67de13d619fd283d58bda40bff0ee07739f624ffee8b13b631abf33083d"},+ {file = "lxml-6.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:24a8e756c982c001ca8d59e87c80c4d9dcd4d9b44a4cbeb8d9be4482c514d41d"},+ {file = "lxml-6.0.2-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:1c06035eafa8404b5cf475bb37a9f6088b0aca288d4ccc9d69389750d5543700"},+ {file = "lxml-6.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c7d13103045de1bdd6fe5d61802565f1a3537d70cd3abf596aa0af62761921ee"},+ {file = "lxml-6.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0a3c150a95fbe5ac91de323aa756219ef9cf7fde5a3f00e2281e30f33fa5fa4f"},+ {file = "lxml-6.0.2-pp311-pypy311_pp73-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:60fa43be34f78bebb27812ed90f1925ec99560b0fa1decdb7d12b84d857d31e9"},+ {file = "lxml-6.0.2-pp311-pypy311_pp73-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:21c73b476d3cfe836be731225ec3421fa2f048d84f6df6a8e70433dff1376d5a"},+ {file = "lxml-6.0.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:27220da5be049e936c3aca06f174e8827ca6445a4353a1995584311487fc4e3e"},+ {file = "lxml-6.0.2.tar.gz", hash = "sha256:cd79f3367bd74b317dda655dc8fcfa304d9eb6e4fb06b7168c5cf27f96e0cd62"},+]++[package.extras]+cssselect = ["cssselect (>=0.7)"]+html-clean = ["lxml_html_clean"]+html5 = ["html5lib"]+htmlsoup = ["BeautifulSoup4"]+[[package]]name = "markdown-it-py"version = "4.0.0"@@ -2289,6 +2784,23 @@ profiling = ["gprof2dot"]rtd = ["ipykernel", "jupyter_sphinx", "mdit-py-plugins (>=0.5.0)", "myst-parser", "pyyaml", "sphinx", "sphinx-book-theme (>=1.0,<2.0)", "sphinx-copybutton", "sphinx-design"]testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions", "requests"]+[[package]]+name = "marko"+version = "2.2.2"+description = "A markdown parser with high extensibility."+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "marko-2.2.2-py3-none-any.whl", hash = "sha256:f064ae8c10416285ad1d96048dc11e98ef04e662d3342ae416f662b70aa7959e"},+ {file = "marko-2.2.2.tar.gz", hash = "sha256:6940308e655f63733ca518c47a68ec9510279dbb916c83616e4c4b5829f052e8"},+]++[package.extras]+codehilite = ["pygments"]+repr = ["objprint"]+toc = ["python-slugify"]+[[package]]name = "markupsafe"version = "3.0.3"@@ -2445,6 +2957,30 @@ files = [{file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"},]+[[package]]+name = "mpire"+version = "2.10.2"+description = "A Python package for easy multiprocessing, but faster than multiprocessing"+optional = false+python-versions = "*"+groups = ["main"]+files = [+ {file = "mpire-2.10.2-py3-none-any.whl", hash = "sha256:d627707f7a8d02aa4c7f7d59de399dec5290945ddf7fbd36cbb1d6ebb37a51fb"},+ {file = "mpire-2.10.2.tar.gz", hash = "sha256:f66a321e93fadff34585a4bfa05e95bd946cf714b442f51c529038eb45773d97"},+]++[package.dependencies]+multiprocess = {version = ">=0.70.15", optional = true, markers = "python_version >= \"3.11\" and extra == \"dill\""}+pygments = ">=2.0"+pywin32 = {version = ">=301", markers = "platform_system == \"Windows\""}+tqdm = ">=4.27"++[package.extras]+dashboard = ["flask"]+dill = ["multiprocess (>=0.70.15) ; python_version >= \"3.11\"", "multiprocess ; python_version < \"3.11\""]+docs = ["docutils (==0.17.1)", "sphinx (==3.2.1)", "sphinx-autodoc-typehints (==1.11.0)", "sphinx-rtd-theme (==0.5.0)", "sphinx-versions (==1.0.1)", "sphinxcontrib-images (==0.9.2)"]+testing = ["ipywidgets", "multiprocess (>=0.70.15) ; python_version >= \"3.11\"", "multiprocess ; python_version < \"3.11\"", "numpy", "pywin32 (>=301) ; platform_system == \"Windows\"", "rich"]+[[package]]name = "mpmath"version = "1.3.0"@@ -2463,6 +2999,38 @@ docs = ["sphinx"]gmpy = ["gmpy2 (>=2.1.0a4) ; platform_python_implementation != \"PyPy\""]tests = ["pytest (>=4.6)"]+[[package]]+name = "multiprocess"+version = "0.70.18"+description = "better multiprocessing and multithreading in Python"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "multiprocess-0.70.18-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25d4012dcaaf66b9e8e955f58482b42910c2ee526d532844d8bcf661bbc604df"},+ {file = "multiprocess-0.70.18-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:06b19433de0d02afe5869aec8931dd5c01d99074664f806c73896b0d9e527213"},+ {file = "multiprocess-0.70.18-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6fa1366f994373aaf2d4738b0f56e707caeaa05486e97a7f71ee0853823180c2"},+ {file = "multiprocess-0.70.18-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:8b8940ae30139e04b076da6c5b83e9398585ebdf0f2ad3250673fef5b2ff06d6"},+ {file = "multiprocess-0.70.18-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:0929ba95831adb938edbd5fb801ac45e705ecad9d100b3e653946b7716cb6bd3"},+ {file = "multiprocess-0.70.18-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4d77f8e4bfe6c6e2e661925bbf9aed4d5ade9a1c6502d5dfc10129b9d1141797"},+ {file = "multiprocess-0.70.18-pp38-pypy38_pp73-macosx_10_9_arm64.whl", hash = "sha256:2dbaae9bffa1fb2d58077c0044ffe87a8c8974e90fcf778cdf90e139c970d42a"},+ {file = "multiprocess-0.70.18-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:bcac5a4e81f1554d98d1bba963eeb1bd24966432f04fcbd29b6e1a16251ad712"},+ {file = "multiprocess-0.70.18-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c0c7cd75d0987ab6166d64e654787c781dbacbcbcaaede4c1ffe664720b3e14b"},+ {file = "multiprocess-0.70.18-pp39-pypy39_pp73-macosx_10_13_arm64.whl", hash = "sha256:9fd8d662f7524a95a1be7cbea271f0b33089fe792baabec17d93103d368907da"},+ {file = "multiprocess-0.70.18-pp39-pypy39_pp73-macosx_10_13_x86_64.whl", hash = "sha256:3fbba48bfcd932747c33f0b152b26207c4e0840c35cab359afaff7a8672b1031"},+ {file = "multiprocess-0.70.18-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:5f9be0342e597dde86152c10442c5fb6c07994b1c29de441b7a3a08b0e6be2a0"},+ {file = "multiprocess-0.70.18-py310-none-any.whl", hash = "sha256:60c194974c31784019c1f459d984e8f33ee48f10fcf42c309ba97b30d9bd53ea"},+ {file = "multiprocess-0.70.18-py311-none-any.whl", hash = "sha256:5aa6eef98e691281b3ad923be2832bf1c55dd2c859acd73e5ec53a66aae06a1d"},+ {file = "multiprocess-0.70.18-py312-none-any.whl", hash = "sha256:9b78f8e5024b573730bfb654783a13800c2c0f2dfc0c25e70b40d184d64adaa2"},+ {file = "multiprocess-0.70.18-py313-none-any.whl", hash = "sha256:871743755f43ef57d7910a38433cfe41319e72be1bbd90b79c7a5ac523eb9334"},+ {file = "multiprocess-0.70.18-py38-none-any.whl", hash = "sha256:dbf705e52a154fe5e90fb17b38f02556169557c2dd8bb084f2e06c2784d8279b"},+ {file = "multiprocess-0.70.18-py39-none-any.whl", hash = "sha256:e78ca805a72b1b810c690b6b4cc32579eba34f403094bbbae962b7b5bf9dfcb8"},+ {file = "multiprocess-0.70.18.tar.gz", hash = "sha256:f9597128e6b3e67b23956da07cf3d2e5cba79e2f4e0fba8d7903636663ec6d0d"},+]++[package.dependencies]+dill = ">=0.4.0"+[[package]]name = "murmurhash"version = "1.0.12"@@ -3213,6 +3781,40 @@ files = [{file = "nvidia_nvtx_cu12-12.8.90-py3-none-win_amd64.whl", hash = "sha256:619c8304aedc69f02ea82dd244541a83c3d9d40993381b3b590f1adaed3db41e"},]+[[package]]+name = "ocrmac"+version = "1.0.1"+description = "A python wrapper to extract text from images on a mac system. Uses the vision framework from Apple."+optional = false+python-versions = ">=3.9"+groups = ["main"]+markers = "sys_platform == \"darwin\""+files = [+ {file = "ocrmac-1.0.1-py3-none-any.whl", hash = "sha256:1cef25426f7ae6bbd57fe3dc5553b25461ae8ad0d2b428a9bbadbf5907349024"},+ {file = "ocrmac-1.0.1.tar.gz", hash = "sha256:507fe5e4cbd67b2d03f6729a52bbc11f9d0b58241134eb958a5daafd4b9d93d9"},+]++[package.dependencies]+Click = ">=7.0"+pillow = "*"+pyobjc-framework-Vision = "*"++[[package]]+name = "omegaconf"+version = "2.3.0"+description = "A flexible configuration library"+optional = false+python-versions = ">=3.6"+groups = ["main"]+files = [+ {file = "omegaconf-2.3.0-py3-none-any.whl", hash = "sha256:7b4df175cdb08ba400f45cae3bdcae7ba8365db4d165fc65fd04b050ab63b46b"},+ {file = "omegaconf-2.3.0.tar.gz", hash = "sha256:d5d4b6d29955cc50ad50c46dc269bcd92c6e00f5f90d23ab5fee7bfca4ba4cc7"},+]++[package.dependencies]+antlr4-python3-runtime = "==4.9.*"+PyYAML = ">=5.1.0"+[[package]]name = "openai"version = "2.5.0"@@ -3241,6 +3843,44 @@ datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"]realtime = ["websockets (>=13,<16)"]voice-helpers = ["numpy (>=2.0.2)", "sounddevice (>=0.5.1)"]+[[package]]+name = "opencv-python"+version = "4.11.0.86"+description = "Wrapper package for OpenCV python bindings."+optional = false+python-versions = ">=3.6"+groups = ["main"]+files = [+ {file = "opencv-python-4.11.0.86.tar.gz", hash = "sha256:03d60ccae62304860d232272e4a4fda93c39d595780cb40b161b310244b736a4"},+ {file = "opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:432f67c223f1dc2824f5e73cdfcd9db0efc8710647d4e813012195dc9122a52a"},+ {file = "opencv_python-4.11.0.86-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:9d05ef13d23fe97f575153558653e2d6e87103995d54e6a35db3f282fe1f9c66"},+ {file = "opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b92ae2c8852208817e6776ba1ea0d6b1e0a1b5431e971a2a0ddd2a8cc398202"},+ {file = "opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b02611523803495003bd87362db3e1d2a0454a6a63025dc6658a9830570aa0d"},+ {file = "opencv_python-4.11.0.86-cp37-abi3-win32.whl", hash = "sha256:810549cb2a4aedaa84ad9a1c92fbfdfc14090e2749cedf2c1589ad8359aa169b"},+ {file = "opencv_python-4.11.0.86-cp37-abi3-win_amd64.whl", hash = "sha256:085ad9b77c18853ea66283e98affefe2de8cc4c1f43eda4c100cf9b2721142ec"},+]++[package.dependencies]+numpy = [+ {version = ">=1.26.0", markers = "python_version >= \"3.12\""},+ {version = ">=1.23.5", markers = "python_version >= \"3.11\""},+]++[[package]]+name = "openpyxl"+version = "3.1.5"+description = "A Python library to read/write Excel 2010 xlsx/xlsm files"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "openpyxl-3.1.5-py2.py3-none-any.whl", hash = "sha256:5282c12b107bffeef825f4617dc029afaf41d0ea60823bbb665ef3079dc79de2"},+ {file = "openpyxl-3.1.5.tar.gz", hash = "sha256:cf0e3cf56142039133628b5acffe8ef0c12bc902d2aadd3e0fe5878dc08d1050"},+]++[package.dependencies]+et-xmlfile = "*"+[[package]]name = "orjson"version = "3.11.3"@@ -3653,6 +4293,31 @@ files = [dev = ["pre-commit", "tox"]testing = ["coverage", "pytest", "pytest-benchmark"]+[[package]]+name = "polyfactory"+version = "3.3.0"+description = "Mock data generation factories"+optional = false+python-versions = "<4.0,>=3.9"+groups = ["main"]+files = [+ {file = "polyfactory-3.3.0-py3-none-any.whl", hash = "sha256:686abcaa761930d3df87b91e95b26b8d8cb9fdbbbe0b03d5f918acff5c72606e"},+ {file = "polyfactory-3.3.0.tar.gz", hash = "sha256:237258b6ff43edf362ffd1f68086bb796466f786adfa002b0ac256dbf2246e9a"},+]++[package.dependencies]+faker = ">=5.0.0"+typing-extensions = ">=4.6.0"++[package.extras]+attrs = ["attrs (>=22.2.0)"]+beanie = ["beanie", "pydantic[email]", "pymongo (<4.9)"]+full = ["attrs", "beanie", "msgspec", "odmantic", "pydantic", "sqlalchemy"]+msgspec = ["msgspec (>=0.20.0)"]+odmantic = ["odmantic (<1.0.0)", "pydantic[email]"]+pydantic = ["eval-type-backport (>=0.2.2)", "pydantic[email] (>=1.10)"]+sqlalchemy = ["sqlalchemy (>=1.4.29)"]+[[package]]name = "preshed"version = "3.0.9"@@ -3826,6 +4491,41 @@ files = [{file = "protobuf-6.33.0.tar.gz", hash = "sha256:140303d5c8d2037730c548f8c7b93b20bb1dc301be280c378b82b8894589c954"},]+[[package]]+name = "psutil"+version = "7.2.2"+description = "Cross-platform lib for process and system monitoring."+optional = false+python-versions = ">=3.6"+groups = ["main"]+files = [+ {file = "psutil-7.2.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:2edccc433cbfa046b980b0df0171cd25bcaeb3a68fe9022db0979e7aa74a826b"},+ {file = "psutil-7.2.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e78c8603dcd9a04c7364f1a3e670cea95d51ee865e4efb3556a3a63adef958ea"},+ {file = "psutil-7.2.2-cp313-cp313t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a571f2330c966c62aeda00dd24620425d4b0cc86881c89861fbc04549e5dc63"},+ {file = "psutil-7.2.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:917e891983ca3c1887b4ef36447b1e0873e70c933afc831c6b6da078ba474312"},+ {file = "psutil-7.2.2-cp313-cp313t-win_amd64.whl", hash = "sha256:ab486563df44c17f5173621c7b198955bd6b613fb87c71c161f827d3fb149a9b"},+ {file = "psutil-7.2.2-cp313-cp313t-win_arm64.whl", hash = "sha256:ae0aefdd8796a7737eccea863f80f81e468a1e4cf14d926bd9b6f5f2d5f90ca9"},+ {file = "psutil-7.2.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00"},+ {file = "psutil-7.2.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7b6d09433a10592ce39b13d7be5a54fbac1d1228ed29abc880fb23df7cb694c9"},+ {file = "psutil-7.2.2-cp314-cp314t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fa4ecf83bcdf6e6c8f4449aff98eefb5d0604bf88cb883d7da3d8d2d909546a"},+ {file = "psutil-7.2.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e452c464a02e7dc7822a05d25db4cde564444a67e58539a00f929c51eddda0cf"},+ {file = "psutil-7.2.2-cp314-cp314t-win_amd64.whl", hash = "sha256:c7663d4e37f13e884d13994247449e9f8f574bc4655d509c3b95e9ec9e2b9dc1"},+ {file = "psutil-7.2.2-cp314-cp314t-win_arm64.whl", hash = "sha256:11fe5a4f613759764e79c65cf11ebdf26e33d6dd34336f8a337aa2996d71c841"},+ {file = "psutil-7.2.2-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486"},+ {file = "psutil-7.2.2-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979"},+ {file = "psutil-7.2.2-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9"},+ {file = "psutil-7.2.2-cp36-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e"},+ {file = "psutil-7.2.2-cp36-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8"},+ {file = "psutil-7.2.2-cp36-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc"},+ {file = "psutil-7.2.2-cp37-abi3-win_amd64.whl", hash = "sha256:eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988"},+ {file = "psutil-7.2.2-cp37-abi3-win_arm64.whl", hash = "sha256:8c233660f575a5a89e6d4cb65d9f938126312bca76d8fe087b947b3a1aaac9ee"},+ {file = "psutil-7.2.2.tar.gz", hash = "sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372"},+]++[package.extras]+dev = ["abi3audit", "black", "check-manifest", "colorama ; os_name == \"nt\"", "coverage", "packaging", "psleak", "pylint", "pyperf", "pypinfo", "pyreadline3 ; os_name == \"nt\"", "pytest", "pytest-cov", "pytest-instafail", "pytest-xdist", "pywin32 ; os_name == \"nt\" and implementation_name != \"pypy\"", "requests", "rstcheck", "ruff", "setuptools", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "validate-pyproject[all]", "virtualenv", "vulture", "wheel", "wheel ; os_name == \"nt\" and implementation_name != \"pypy\"", "wmi ; os_name == \"nt\" and implementation_name != \"pypy\""]+test = ["psleak", "pytest", "pytest-instafail", "pytest-xdist", "pywin32 ; os_name == \"nt\" and implementation_name != \"pypy\"", "setuptools", "wheel ; os_name == \"nt\" and implementation_name != \"pypy\"", "wmi ; os_name == \"nt\" and implementation_name != \"pypy\""]+[[package]]name = "pyarrow"version = "21.0.0"@@ -3924,6 +4624,52 @@ files = [[package.extras]global = ["pybind11-global (==3.0.1)"]+[[package]]+name = "pyclipper"+version = "1.4.0"+description = "Cython wrapper for the C++ translation of the Angus Johnson's Clipper library (ver. 6.4.2)"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "pyclipper-1.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:bafad70d2679c187120e8c44e1f9a8b06150bad8c0aecf612ad7dfbfa9510f73"},+ {file = "pyclipper-1.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0b74a9dd44b22a7fd35d65fb1ceeba57f3817f34a97a28c3255556362e491447"},+ {file = "pyclipper-1.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0a4d2736fb3c42e8eb1d38bf27a720d1015526c11e476bded55138a977c17d9d"},+ {file = "pyclipper-1.4.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b3b3630051b53ad2564cb079e088b112dd576e3d91038338ad1cc7915e0f14dc"},+ {file = "pyclipper-1.4.0-cp310-cp310-win32.whl", hash = "sha256:8d42b07a2f6cfe2d9b87daf345443583f00a14e856927782fde52f3a255e305a"},+ {file = "pyclipper-1.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:6a97b961f182b92d899ca88c1bb3632faea2e00ce18d07c5f789666ebb021ca4"},+ {file = "pyclipper-1.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:adcb7ca33c5bdc33cd775e8b3eadad54873c802a6d909067a57348bcb96e7a2d"},+ {file = "pyclipper-1.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fd24849d2b94ec749ceac7c34c9f01010d23b6e9d9216cf2238b8481160e703d"},+ {file = "pyclipper-1.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1b6c8d75ba20c6433c9ea8f1a0feb7e4d3ac06a09ad1fd6d571afc1ddf89b869"},+ {file = "pyclipper-1.4.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:58e29d7443d7cc0e83ee9daf43927730386629786d00c63b04fe3b53ac01462c"},+ {file = "pyclipper-1.4.0-cp311-cp311-win32.whl", hash = "sha256:a8d2b5fb75ebe57e21ce61e79a9131edec2622ff23cc665e4d1d1f201bc1a801"},+ {file = "pyclipper-1.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:e9b973467d9c5fa9bc30bb6ac95f9f4d7c3d9fc25f6cf2d1cc972088e5955c01"},+ {file = "pyclipper-1.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:222ac96c8b8281b53d695b9c4fedc674f56d6d4320ad23f1bdbd168f4e316140"},+ {file = "pyclipper-1.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f3672dbafbb458f1b96e1ee3e610d174acb5ace5bd2ed5d1252603bb797f2fc6"},+ {file = "pyclipper-1.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d1f807e2b4760a8e5c6d6b4e8c1d71ef52b7fe1946ff088f4fa41e16a881a5ca"},+ {file = "pyclipper-1.4.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce1f83c9a4e10ea3de1959f0ae79e9a5bd41346dff648fee6228ba9eaf8b3872"},+ {file = "pyclipper-1.4.0-cp312-cp312-win32.whl", hash = "sha256:3ef44b64666ebf1cb521a08a60c3e639d21b8c50bfbe846ba7c52a0415e936f4"},+ {file = "pyclipper-1.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:d1e5498d883b706a4ce636247f0d830c6eb34a25b843a1b78e2c969754ca9037"},+ {file = "pyclipper-1.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d49df13cbb2627ccb13a1046f3ea6ebf7177b5504ec61bdef87d6a704046fd6e"},+ {file = "pyclipper-1.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:37bfec361e174110cdddffd5ecd070a8064015c99383d95eb692c253951eee8a"},+ {file = "pyclipper-1.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:14c8bdb5a72004b721c4e6f448d2c2262d74a7f0c9e3076aeff41e564a92389f"},+ {file = "pyclipper-1.4.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f2a50c22c3a78cb4e48347ecf06930f61ce98cf9252f2e292aa025471e9d75b1"},+ {file = "pyclipper-1.4.0-cp313-cp313-win32.whl", hash = "sha256:c9a3faa416ff536cee93417a72bfb690d9dea136dc39a39dbbe1e5dadf108c9c"},+ {file = "pyclipper-1.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:d4b2d7c41086f1927d14947c563dfc7beed2f6c0d9af13c42fe3dcdc20d35832"},+ {file = "pyclipper-1.4.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:7c87480fc91a5af4c1ba310bdb7de2f089a3eeef5fe351a3cedc37da1fcced1c"},+ {file = "pyclipper-1.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:81d8bb2d1fb9d66dc7ea4373b176bb4b02443a7e328b3b603a73faec088b952e"},+ {file = "pyclipper-1.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:773c0e06b683214dcfc6711be230c83b03cddebe8a57eae053d4603dd63582f9"},+ {file = "pyclipper-1.4.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9bc45f2463d997848450dbed91c950ca37c6cf27f84a49a5cad4affc0b469e39"},+ {file = "pyclipper-1.4.0-cp314-cp314-win32.whl", hash = "sha256:0b8c2105b3b3c44dbe1a266f64309407fe30bf372cf39a94dc8aaa97df00da5b"},+ {file = "pyclipper-1.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:6c317e182590c88ec0194149995e3d71a979cfef3b246383f4e035f9d4a11826"},+ {file = "pyclipper-1.4.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:f160a2c6ba036f7eaf09f1f10f4fbfa734234af9112fb5187877efed78df9303"},+ {file = "pyclipper-1.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:a9f11ad133257c52c40d50de7a0ca3370a0cdd8e3d11eec0604ad3c34ba549e9"},+ {file = "pyclipper-1.4.0-cp314-cp314t-win32.whl", hash = "sha256:bbc827b77442c99deaeee26e0e7f172355ddb097a5e126aea206d447d3b26286"},+ {file = "pyclipper-1.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:29dae3e0296dff8502eeb7639fcfee794b0eec8590ba3563aee28db269da6b04"},+ {file = "pyclipper-1.4.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:98b2a40f98e1fc1b29e8a6094072e7e0c7dfe901e573bf6cfc6eb7ce84a7ae87"},+ {file = "pyclipper-1.4.0.tar.gz", hash = "sha256:9882bd889f27da78add4dd6f881d25697efc740bf840274e749988d25496c8e1"},+]+[[package]]name = "pycparser"version = "3.0"@@ -4149,6 +4895,17 @@ dev = ["coverage[toml] (==7.10.7)", "cryptography (>=3.4.0)", "pre-commit", "pytdocs = ["sphinx", "sphinx-rtd-theme", "zope.interface"]tests = ["coverage[toml] (==7.10.7)", "pytest (>=8.4.2,<9.0.0)"]+[[package]]+name = "pylatexenc"+version = "2.10"+description = "Simple LaTeX parser providing latex-to-unicode and unicode-to-latex conversion"+optional = false+python-versions = "*"+groups = ["main"]+files = [+ {file = "pylatexenc-2.10.tar.gz", hash = "sha256:3dd8fd84eb46dc30bee1e23eaab8d8fb5a7f507347b23e5f38ad9675c84f40d3"},+]+[[package]]name = "pylint"version = "4.0.1"@@ -4297,6 +5054,150 @@ snappy = ["python-snappy"]test = ["pytest (>=8.2)", "pytest-asyncio (>=0.24.0)"]zstd = ["zstandard"]+[[package]]+name = "pyobjc-core"+version = "12.1"+description = "Python<->ObjC Interoperability Module"+optional = false+python-versions = ">=3.10"+groups = ["main"]+markers = "sys_platform == \"darwin\""+files = [+ {file = "pyobjc_core-12.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:93418e79c1655f66b4352168f8c85c942707cb1d3ea13a1da3e6f6a143bacda7"},+ {file = "pyobjc_core-12.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c918ebca280925e7fcb14c5c43ce12dcb9574a33cccb889be7c8c17f3bcce8b6"},+ {file = "pyobjc_core-12.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:818bcc6723561f207e5b5453efe9703f34bc8781d11ce9b8be286bb415eb4962"},+ {file = "pyobjc_core-12.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:01c0cf500596f03e21c23aef9b5f326b9fb1f8f118cf0d8b66749b6cf4cbb37a"},+ {file = "pyobjc_core-12.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:177aaca84bb369a483e4961186704f64b2697708046745f8167e818d968c88fc"},+ {file = "pyobjc_core-12.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:844515f5d86395b979d02152576e7dee9cc679acc0b32dc626ef5bda315eaa43"},+ {file = "pyobjc_core-12.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:453b191df1a4b80e756445b935491b974714456ae2cbae816840bd96f86db882"},+ {file = "pyobjc_core-12.1.tar.gz", hash = "sha256:2bb3903f5387f72422145e1466b3ac3f7f0ef2e9960afa9bcd8961c5cbf8bd21"},+]++[[package]]+name = "pyobjc-framework-cocoa"+version = "12.1"+description = "Wrappers for the Cocoa frameworks on macOS"+optional = false+python-versions = ">=3.10"+groups = ["main"]+markers = "sys_platform == \"darwin\""+files = [+ {file = "pyobjc_framework_cocoa-12.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9b880d3bdcd102809d704b6d8e14e31611443aa892d9f60e8491e457182fdd48"},+ {file = "pyobjc_framework_cocoa-12.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f52228bcf38da64b77328787967d464e28b981492b33a7675585141e1b0a01e6"},+ {file = "pyobjc_framework_cocoa-12.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:547c182837214b7ec4796dac5aee3aa25abc665757b75d7f44f83c994bcb0858"},+ {file = "pyobjc_framework_cocoa-12.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:5a3dcd491cacc2f5a197142b3c556d8aafa3963011110102a093349017705118"},+ {file = "pyobjc_framework_cocoa-12.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:914b74328c22d8ca261d78c23ef2befc29776e0b85555973927b338c5734ca44"},+ {file = "pyobjc_framework_cocoa-12.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:03342a60fc0015bcdf9b93ac0b4f457d3938e9ef761b28df9564c91a14f0129a"},+ {file = "pyobjc_framework_cocoa-12.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:6ba1dc1bfa4da42d04e93d2363491275fb2e2be5c20790e561c8a9e09b8cf2cc"},+ {file = "pyobjc_framework_cocoa-12.1.tar.gz", hash = "sha256:5556c87db95711b985d5efdaaf01c917ddd41d148b1e52a0c66b1a2e2c5c1640"},+]++[package.dependencies]+pyobjc-core = ">=12.1"++[[package]]+name = "pyobjc-framework-coreml"+version = "12.1"+description = "Wrappers for the framework CoreML on macOS"+optional = false+python-versions = ">=3.10"+groups = ["main"]+markers = "sys_platform == \"darwin\""+files = [+ {file = "pyobjc_framework_coreml-12.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:df4e9b4f97063148cc481f72e2fbe3cc53b9464d722752aa658d7c0aec9f02fd"},+ {file = "pyobjc_framework_coreml-12.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:16dafcfb123f022e62f47a590a7eccf7d0cb5957a77fd5f062b5ee751cb5a423"},+ {file = "pyobjc_framework_coreml-12.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:10dc8e8db53d7631ebc712cad146e3a9a9a443f4e1a037e844149a24c3c42669"},+ {file = "pyobjc_framework_coreml-12.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:48fa3bb4a03fa23e0e36c93936dca2969598e4102f4b441e1663f535fc99cd31"},+ {file = "pyobjc_framework_coreml-12.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:71de5b37e6a017e3ed16645c5d6533138f24708da5b56c35c818ae49d0253ee1"},+ {file = "pyobjc_framework_coreml-12.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:a04a96e512ecf6999aa9e1f60ad5635cb9d1cd839be470341d8d1541797baef6"},+ {file = "pyobjc_framework_coreml-12.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:7762b3dd2de01565b7cf3049ce1e4c27341ba179d97016b0b7607448e1c39865"},+ {file = "pyobjc_framework_coreml-12.1.tar.gz", hash = "sha256:0d1a4216891a18775c9e0170d908714c18e4f53f9dc79fb0f5263b2aa81609ba"},+]++[package.dependencies]+pyobjc-core = ">=12.1"+pyobjc-framework-Cocoa = ">=12.1"++[[package]]+name = "pyobjc-framework-quartz"+version = "12.1"+description = "Wrappers for the Quartz frameworks on macOS"+optional = false+python-versions = ">=3.10"+groups = ["main"]+markers = "sys_platform == \"darwin\""+files = [+ {file = "pyobjc_framework_quartz-12.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c6f312ae79ef8b3019dcf4b3374c52035c7c7bc4a09a1748b61b041bb685a0ed"},+ {file = "pyobjc_framework_quartz-12.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:19f99ac49a0b15dd892e155644fe80242d741411a9ed9c119b18b7466048625a"},+ {file = "pyobjc_framework_quartz-12.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:7730cdce46c7e985535b5a42c31381af4aa6556e5642dc55b5e6597595e57a16"},+ {file = "pyobjc_framework_quartz-12.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:629b7971b1b43a11617f1460cd218bd308dfea247cd4ee3842eb40ca6f588860"},+ {file = "pyobjc_framework_quartz-12.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:53b84e880c358ba1ddcd7e8d5ea0407d760eca58b96f0d344829162cda5f37b3"},+ {file = "pyobjc_framework_quartz-12.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:42d306b07f05ae7d155984503e0fb1b701fecd31dcc5c79fe8ab9790ff7e0de0"},+ {file = "pyobjc_framework_quartz-12.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0cc08fddb339b2760df60dea1057453557588908e42bdc62184b6396ce2d6e9a"},+ {file = "pyobjc_framework_quartz-12.1.tar.gz", hash = "sha256:27f782f3513ac88ec9b6c82d9767eef95a5cf4175ce88a1e5a65875fee799608"},+]++[package.dependencies]+pyobjc-core = ">=12.1"+pyobjc-framework-Cocoa = ">=12.1"++[[package]]+name = "pyobjc-framework-vision"+version = "12.1"+description = "Wrappers for the framework Vision on macOS"+optional = false+python-versions = ">=3.10"+groups = ["main"]+markers = "sys_platform == \"darwin\""+files = [+ {file = "pyobjc_framework_vision-12.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a30c3fff926348baecc3ce1f6da8ed327d0cbd55ca1c376d018e31023b79c0ab"},+ {file = "pyobjc_framework_vision-12.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1edbf2fc18ce3b31108f845901a88f2236783ae6bf0bc68438d7ece572dc2a29"},+ {file = "pyobjc_framework_vision-12.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:6b3211d84f3a12aad0cde752cfd43a80d0218960ac9e6b46b141c730e7d655bd"},+ {file = "pyobjc_framework_vision-12.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7273e2508db4c2e88523b4b7ff38ac54808756e7ba01d78e6c08ea68f32577d2"},+ {file = "pyobjc_framework_vision-12.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:04296f0848cc8cdead66c76df6063720885cbdf24fdfd1900749a6e2297313db"},+ {file = "pyobjc_framework_vision-12.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:631add775ed1dafb221a6116137cdcd78432addc16200ca434571c2a039c0e03"},+ {file = "pyobjc_framework_vision-12.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:fe41a1a70cc91068aee7b5293fa09dc66d1c666a8da79fdf948900988b439df6"},+ {file = "pyobjc_framework_vision-12.1.tar.gz", hash = "sha256:a30959100e85dcede3a786c544e621ad6eb65ff6abf85721f805822b8c5fe9b0"},+]++[package.dependencies]+pyobjc-core = ">=12.1"+pyobjc-framework-Cocoa = ">=12.1"+pyobjc-framework-CoreML = ">=12.1"+pyobjc-framework-Quartz = ">=12.1"++[[package]]+name = "pypdfium2"+version = "5.5.0"+description = "Python bindings to PDFium"+optional = false+python-versions = ">=3.6"+groups = ["main"]+files = [+ {file = "pypdfium2-5.5.0-py3-none-android_23_arm64_v8a.whl", hash = "sha256:414f0b4aef7413e04df7355043fb752f2efb6f9777e04fd880d302612dacf89f"},+ {file = "pypdfium2-5.5.0-py3-none-android_23_armeabi_v7a.whl", hash = "sha256:126ff8b131d12f16ce96b3e85b7f413e5073212be06b571f157fe11ad221c274"},+ {file = "pypdfium2-5.5.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:0770bd3f0be5c68443fc4017e43b1b1fe8f36877481cab70fd29b68b2c362e1b"},+ {file = "pypdfium2-5.5.0-py3-none-macosx_11_0_x86_64.whl", hash = "sha256:5ab41a3b9953d9be44be35c36a2340f1d67c602db98a0d6f70006610871ae43a"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2492a22c3126a004cee2fa208ea4aa03ede2c7e205d05814934ab18f83d073e9"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:83ff93e08b1fadb00040564e2eccc99147fc1a632ba5daff745126b373d78446"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7e85de3332bedf8e5f157c248063b4eaf968660e1e490353b6e581d9f96a4c6"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e258365f34b6e334bb415e44dd9b1ee78a6e525bf854a1e74af67af7ede7555b"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bec21d833404ca771f02fa5cefb0b73e2148f05cbdb3b5b9989bdd51d9b5cbac"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_27_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1dd6ccbe1b5e2e778e8b021e47f9485b4fd42eaa6c9bdda2631641724e1fcc04"},+ {file = "pypdfium2-5.5.0-py3-none-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:da3eada345570cec5e34872d1472d4ac542f0e650ccdb6c2eac08ae1a5f07c82"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a087fb4088c7433fd3d78833dbe42cfb66df3d5ac98e3edf66110520fb33c0f0"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e6418cdc500ef85a90319f9bc7f1c54fc133460379f509429403225d8a4c157f"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:8f7b66eedfac26eb2df4b00936e081b0a1c76fb8ee1c12639d85c2e73b0769ef"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_ppc64le.whl", hash = "sha256:faea3246591ce2ea6218cd06679071275e3c65f11c3f5c9091eb7fb07610af6a"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_riscv64.whl", hash = "sha256:aba26d404b51a9de3d3e80c867a95c71abf1c79552001ae22707451e59186b3d"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_s390x.whl", hash = "sha256:e0fa8f81679e6e71f26806f4db853571ee6435dc3bde7a46acdd182ef886a5b9"},+ {file = "pypdfium2-5.5.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:ee22df3376d350eeb64d2002a1071e3a02c0d874c557a3cd8229a8fc572cdaac"},+ {file = "pypdfium2-5.5.0-py3-none-win32.whl", hash = "sha256:ec62a00223d1222d2f35c0866dd79cdc24da070738544cdf51b17d332d4a7389"},+ {file = "pypdfium2-5.5.0-py3-none-win_amd64.whl", hash = "sha256:15c32fbeebb5198afa785dd03e98906ebb4eded9ef8862e10f833c37b4a18786"},+ {file = "pypdfium2-5.5.0-py3-none-win_arm64.whl", hash = "sha256:f618af0884c16c768539c44933a255039131dbbf39d68eded020da4f14958d73"},+ {file = "pypdfium2-5.5.0.tar.gz", hash = "sha256:3283c61f54c3c546d140da201ef48a51c18b0ad54293091a010029ac13ece23a"},+]+[[package]]name = "pytest"version = "9.0.2"@@ -4334,6 +5235,22 @@ files = [[package.dependencies]six = ">=1.5"+[[package]]+name = "python-docx"+version = "1.2.0"+description = "Create, read, and update Microsoft Word .docx files."+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "python_docx-1.2.0-py3-none-any.whl", hash = "sha256:3fd478f3250fbbbfd3b94fe1e985955737c145627498896a8a6bf81f4baf66c7"},+ {file = "python_docx-1.2.0.tar.gz", hash = "sha256:7bc9d7b7d8a69c9c02ca09216118c86552704edc23bac179283f2e38f86220ce"},+]++[package.dependencies]+lxml = ">=3.1.0"+typing_extensions = ">=4.9.0"+[[package]]name = "python-dotenv"version = "1.1.1"@@ -4361,6 +5278,24 @@ files = [{file = "python_multipart-0.0.20.tar.gz", hash = "sha256:8dd0cab45b8e23064ae09147625994d090fa46f5b0d1e13af944c331a7fa9d13"},]+[[package]]+name = "python-pptx"+version = "1.0.2"+description = "Create, read, and update PowerPoint 2007+ (.pptx) files."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "python_pptx-1.0.2-py3-none-any.whl", hash = "sha256:160838e0b8565a8b1f67947675886e9fea18aa5e795db7ae531606d68e785cba"},+ {file = "python_pptx-1.0.2.tar.gz", hash = "sha256:479a8af0eaf0f0d76b6f00b0887732874ad2e3188230315290cd1f9dd9cc7095"},+]++[package.dependencies]+lxml = ">=3.1.0"+Pillow = ">=3.3.2"+typing-extensions = ">=4.9.0"+XlsxWriter = ">=0.5.7"+[[package]]name = "pytz"version = "2025.2"@@ -4380,7 +5315,7 @@ description = "Python for Window Extensions"optional = falsepython-versions = "*"groups = ["main"]-markers = "sys_platform == \"win32\""+markers = "sys_platform == \"win32\" or platform_system == \"Windows\""files = [{file = "pywin32-311-cp310-cp310-win32.whl", hash = "sha256:d03ff496d2a0cd4a5893504789d4a15399133fe82517455e78bad62efbb7f0a3"},{file = "pywin32-311-cp310-cp310-win_amd64.whl", hash = "sha256:797c2772017851984b97180b0bebe4b620bb86328e8a884bb626156295a63b3b"},@@ -4592,6 +5527,30 @@ files = [[package.extras]all = ["numpy"]+[[package]]+name = "rapidocr"+version = "3.6.0"+description = "Awesome OCR Library"+optional = false+python-versions = "<4,>=3.6"+groups = ["main"]+files = [+ {file = "rapidocr-3.6.0-py3-none-any.whl", hash = "sha256:d16b43872fc4dfa1e60996334dcd0dc3e3f1f64161e2332bc1873b9f65754e6b"},+]++[package.dependencies]+colorlog = "*"+numpy = ">=1.19.5,<3.0.0"+omegaconf = "*"+opencv_python = ">=4.5.1.48"+Pillow = "*"+pyclipper = ">=1.2.0"+PyYAML = "*"+requests = "*"+Shapely = ">=1.7.1,<2.0.4 || >2.0.4"+six = ">=1.15.0"+tqdm = "*"+[[package]]name = "redis"version = "6.4.0"@@ -4950,6 +5909,25 @@ files = [[package.dependencies]pyasn1 = ">=0.1.3"+[[package]]+name = "rtree"+version = "1.4.1"+description = "R-Tree spatial index for Python GIS"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "rtree-1.4.1-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:d672184298527522d4914d8ae53bf76982b86ca420b0acde9298a7a87d81d4a4"},+ {file = "rtree-1.4.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a7e48d805e12011c2cf739a29d6a60ae852fb1de9fc84220bbcef67e6e595d7d"},+ {file = "rtree-1.4.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:efa8c4496e31e9ad58ff6c7df89abceac7022d906cb64a3e18e4fceae6b77f65"},+ {file = "rtree-1.4.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:12de4578f1b3381a93a655846900be4e3d5f4cd5e306b8b00aa77c1121dc7e8c"},+ {file = "rtree-1.4.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b558edda52eca3e6d1ee629042192c65e6b7f2c150d6d6cd207ce82f85be3967"},+ {file = "rtree-1.4.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f155bc8d6bac9dcd383481dee8c130947a4866db1d16cb6dff442329a038a0dc"},+ {file = "rtree-1.4.1-py3-none-win_amd64.whl", hash = "sha256:efe125f416fd27150197ab8521158662943a40f87acab8028a1aac4ad667a489"},+ {file = "rtree-1.4.1-py3-none-win_arm64.whl", hash = "sha256:3d46f55729b28138e897ffef32f7ce93ac335cb67f9120125ad3742a220800f0"},+ {file = "rtree-1.4.1.tar.gz", hash = "sha256:c6b1b3550881e57ebe530cc6cffefc87cd9bf49c30b37b894065a9f810875e46"},+]+[[package]]name = "safetensors"version = "0.7.0"@@ -4983,6 +5961,11 @@ files = [{file = "safetensors-0.7.0.tar.gz", hash = "sha256:07663963b67e8bd9f0b8ad15bb9163606cd27cc5a1b96235a50d8369803b96b0"},]+[package.dependencies]+numpy = {version = ">=1.21.6", optional = true, markers = "extra == \"numpy\""}+packaging = {version = "*", optional = true, markers = "extra == \"torch\""}+torch = {version = ">=1.10", optional = true, markers = "extra == \"torch\""}+[package.extras]all = ["safetensors[jax]", "safetensors[numpy]", "safetensors[paddlepaddle]", "safetensors[pinned-tf]", "safetensors[quality]", "safetensors[testing]", "safetensors[torch]"]dev = ["safetensors[all]"]@@ -5138,6 +6121,22 @@ dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy (==1.10.0)", "pycodestdoc = ["intersphinx_registry", "jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.19.1)", "jupytext", "linkify-it-py", "matplotlib (>=3.5)", "myst-nb (>=1.2.0)", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0,<8.2.0)", "sphinx-copybutton", "sphinx-design (>=0.4.0)"]test = ["Cython", "array-api-strict (>=2.3.1)", "asv", "gmpy2", "hypothesis (>=6.30)", "meson", "mpmath", "ninja ; sys_platform != \"emscripten\"", "pooch", "pytest (>=8.0.0)", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"]+[[package]]+name = "semchunk"+version = "2.2.2"+description = "A fast and lightweight Python library for splitting text into semantically meaningful chunks."+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "semchunk-2.2.2-py3-none-any.whl", hash = "sha256:94ca19020c013c073abdfd06d79a7c13637b91738335f3b8cdb5655ee7cc94d2"},+ {file = "semchunk-2.2.2.tar.gz", hash = "sha256:940e89896e64eeb01de97ba60f51c8c7b96c6a3951dfcf574f25ce2146752f52"},+]++[package.dependencies]+mpire = {version = "*", extras = ["dill"]}+tqdm = "*"+[[package]]name = "sentence-transformers"version = "2.7.0"@@ -5320,6 +6319,18 @@ files = [{file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},]+[[package]]+name = "soupsieve"+version = "2.8.3"+description = "A modern CSS selector implementation for Beautiful Soup."+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "soupsieve-2.8.3-py3-none-any.whl", hash = "sha256:ed64f2ba4eebeab06cc4962affce381647455978ffc1e36bb79a545b91f45a95"},+ {file = "soupsieve-2.8.3.tar.gz", hash = "sha256:3267f1eeea4251fb42728b6dfb746edc9acaffc4a45b27e19450b676586e8349"},+]+[[package]]name = "spacy"version = "3.7.5"@@ -5716,6 +6727,21 @@ mpmath = ">=1.1.0,<1.4"[package.extras]dev = ["hypothesis (>=6.70.0)", "pytest (>=7.1.0)"]+[[package]]+name = "tabulate"+version = "0.9.0"+description = "Pretty-print tabular data"+optional = false+python-versions = ">=3.7"+groups = ["main"]+files = [+ {file = "tabulate-0.9.0-py3-none-any.whl", hash = "sha256:024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f"},+ {file = "tabulate-0.9.0.tar.gz", hash = "sha256:0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c"},+]++[package.extras]+widechars = ["wcwidth"]+[[package]]name = "tenacity"version = "9.1.2"@@ -6170,6 +7196,98 @@ opt-einsum = ["opt-einsum (>=3.3)"]optree = ["optree (>=0.13.0)"]pyyaml = ["pyyaml"]+[[package]]+name = "torchvision"+version = "0.22.1"+description = "image and video datasets and models for torch deep learning"+optional = false+python-versions = ">=3.9"+groups = ["main"]+markers = "python_version >= \"3.14\""+files = [+ {file = "torchvision-0.22.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3b47d8369ee568c067795c0da0b4078f39a9dfea6f3bc1f3ac87530dfda1dd56"},+ {file = "torchvision-0.22.1-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:990de4d657a41ed71680cd8be2e98ebcab55371f30993dc9bd2e676441f7180e"},+ {file = "torchvision-0.22.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:3347f690c2eed6d02aa0edfb9b01d321e7f7cf1051992d96d8d196c39b881d49"},+ {file = "torchvision-0.22.1-cp310-cp310-win_amd64.whl", hash = "sha256:86ad938f5a6ca645f0d5fb19484b1762492c2188c0ffb05c602e9e9945b7b371"},+ {file = "torchvision-0.22.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4addf626e2b57fc22fd6d329cf1346d474497672e6af8383b7b5b636fba94a53"},+ {file = "torchvision-0.22.1-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:8b4a53a6067d63adba0c52f2b8dd2290db649d642021674ee43c0c922f0c6a69"},+ {file = "torchvision-0.22.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:b7866a3b326413e67724ac46f1ee594996735e10521ba9e6cdbe0fa3cd98c2f2"},+ {file = "torchvision-0.22.1-cp311-cp311-win_amd64.whl", hash = "sha256:bb3f6df6f8fd415ce38ec4fd338376ad40c62e86052d7fc706a0dd51efac1718"},+ {file = "torchvision-0.22.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:153f1790e505bd6da123e21eee6e83e2e155df05c0fe7d56347303067d8543c5"},+ {file = "torchvision-0.22.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:964414eef19459d55a10e886e2fca50677550e243586d1678f65e3f6f6bac47a"},+ {file = "torchvision-0.22.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:699c2d70d33951187f6ed910ea05720b9b4aaac1dcc1135f53162ce7d42481d3"},+ {file = "torchvision-0.22.1-cp312-cp312-win_amd64.whl", hash = "sha256:75e0897da7a8e43d78632f66f2bdc4f6e26da8d3f021a7c0fa83746073c2597b"},+ {file = "torchvision-0.22.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9c3ae3319624c43cc8127020f46c14aa878406781f0899bb6283ae474afeafbf"},+ {file = "torchvision-0.22.1-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:4a614a6a408d2ed74208d0ea6c28a2fbb68290e9a7df206c5fef3f0b6865d307"},+ {file = "torchvision-0.22.1-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:7ee682be589bb1a002b7704f06b8ec0b89e4b9068f48e79307d2c6e937a9fdf4"},+ {file = "torchvision-0.22.1-cp313-cp313-win_amd64.whl", hash = "sha256:2566cafcfa47ecfdbeed04bab8cef1307c8d4ef75046f7624b9e55f384880dfe"},+ {file = "torchvision-0.22.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:043d9e35ed69c2e586aff6eb9e2887382e7863707115668ac9d140da58f42cba"},+ {file = "torchvision-0.22.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:27142bcc8a984227a6dcf560985e83f52b82a7d3f5fe9051af586a2ccc46ef26"},+ {file = "torchvision-0.22.1-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:ef46e065502f7300ad6abc98554131c35dc4c837b978d91306658f1a65c00baa"},+ {file = "torchvision-0.22.1-cp313-cp313t-win_amd64.whl", hash = "sha256:7414eeacfb941fa21acddcd725f1617da5630ec822e498660a4b864d7d998075"},+ {file = "torchvision-0.22.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8be941b4d35c0aba819be70fdbbbed8ceb60401ce6996b8cfaaba1300ce62263"},+ {file = "torchvision-0.22.1-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:154a2bdc37a16122c2024f2f77e65f5986020b40c013515c694b5d357fac99a1"},+ {file = "torchvision-0.22.1-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:ef7dee376f42900c0e7b0e34624f391d9ece70ab90ee74b42de0c1fffe371284"},+ {file = "torchvision-0.22.1-cp39-cp39-win_amd64.whl", hash = "sha256:e01631046fda25a1eca2f58d5fdc9a152b93740eb82435cdb27c5151b8d20c02"},+]++[package.dependencies]+numpy = "*"+pillow = ">=5.3.0,<8.3.dev0 || >=8.4.dev0"+torch = "2.7.1"++[package.extras]+gdown = ["gdown (>=4.7.3)"]+scipy = ["scipy"]++[[package]]+name = "torchvision"+version = "0.24.1"+description = "image and video datasets and models for torch deep learning"+optional = false+python-versions = ">=3.10"+groups = ["main"]+markers = "python_version <= \"3.13\""+files = [+ {file = "torchvision-0.24.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ded5e625788572e4e1c4d155d1bbc48805c113794100d70e19c76e39e4d53465"},+ {file = "torchvision-0.24.1-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:54ed17c3d30e718e08d8da3fd5b30ea44b0311317e55647cb97077a29ecbc25b"},+ {file = "torchvision-0.24.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:f476da4e085b7307aaab6f540219617d46d5926aeda24be33e1359771c83778f"},+ {file = "torchvision-0.24.1-cp310-cp310-win_amd64.whl", hash = "sha256:fbdbdae5e540b868a681240b7dbd6473986c862445ee8a138680a6a97d6c34ff"},+ {file = "torchvision-0.24.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:056c525dc875f18fe8e9c27079ada166a7b2755cea5a2199b0bc7f1f8364e600"},+ {file = "torchvision-0.24.1-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:1e39619de698e2821d71976c92c8a9e50cdfd1e993507dfb340f2688bfdd8283"},+ {file = "torchvision-0.24.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:a0f106663e60332aa4fcb1ca2159ef8c3f2ed266b0e6df88de261048a840e0df"},+ {file = "torchvision-0.24.1-cp311-cp311-win_amd64.whl", hash = "sha256:a9308cdd37d8a42e14a3e7fd9d271830c7fecb150dd929b642f3c1460514599a"},+ {file = "torchvision-0.24.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e48bf6a8ec95872eb45763f06499f87bd2fb246b9b96cb00aae260fda2f96193"},+ {file = "torchvision-0.24.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:7fb7590c737ebe3e1c077ad60c0e5e2e56bb26e7bccc3b9d04dbfc34fd09f050"},+ {file = "torchvision-0.24.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:66a98471fc18cad9064123106d810a75f57f0838eee20edc56233fd8484b0cc7"},+ {file = "torchvision-0.24.1-cp312-cp312-win_amd64.whl", hash = "sha256:4aa6cb806eb8541e92c9b313e96192c6b826e9eb0042720e2fa250d021079952"},+ {file = "torchvision-0.24.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:8a6696db7fb71eadb2c6a48602106e136c785642e598eb1533e0b27744f2cce6"},+ {file = "torchvision-0.24.1-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:db2125c46f9cb25dc740be831ce3ce99303cfe60439249a41b04fd9f373be671"},+ {file = "torchvision-0.24.1-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:f035f0cacd1f44a8ff6cb7ca3627d84c54d685055961d73a1a9fb9827a5414c8"},+ {file = "torchvision-0.24.1-cp313-cp313-win_amd64.whl", hash = "sha256:16274823b93048e0a29d83415166a2e9e0bf4e1b432668357b657612a4802864"},+ {file = "torchvision-0.24.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e3f96208b4bef54cd60e415545f5200346a65024e04f29a26cd0006dbf9e8e66"},+ {file = "torchvision-0.24.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:f231f6a4f2aa6522713326d0d2563538fa72d613741ae364f9913027fa52ea35"},+ {file = "torchvision-0.24.1-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:1540a9e7f8cf55fe17554482f5a125a7e426347b71de07327d5de6bfd8d17caa"},+ {file = "torchvision-0.24.1-cp313-cp313t-win_amd64.whl", hash = "sha256:d83e16d70ea85d2f196d678bfb702c36be7a655b003abed84e465988b6128938"},+ {file = "torchvision-0.24.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:cccf4b4fec7fdfcd3431b9ea75d1588c0a8596d0333245dafebee0462abe3388"},+ {file = "torchvision-0.24.1-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:1b495edd3a8f9911292424117544f0b4ab780452e998649425d1f4b2bed6695f"},+ {file = "torchvision-0.24.1-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:ab211e1807dc3e53acf8f6638df9a7444c80c0ad050466e8d652b3e83776987b"},+ {file = "torchvision-0.24.1-cp314-cp314-win_amd64.whl", hash = "sha256:18f9cb60e64b37b551cd605a3d62c15730c086362b40682d23e24b616a697d41"},+ {file = "torchvision-0.24.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ec9d7379c519428395e4ffda4dbb99ec56be64b0a75b95989e00f9ec7ae0b2d7"},+ {file = "torchvision-0.24.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:af9201184c2712d808bd4eb656899011afdfce1e83721c7cb08000034df353fe"},+ {file = "torchvision-0.24.1-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:9ef95d819fd6df81bc7cc97b8f21a15d2c0d3ac5dbfaab5cbc2d2ce57114b19e"},+ {file = "torchvision-0.24.1-cp314-cp314t-win_amd64.whl", hash = "sha256:480b271d6edff83ac2e8d69bbb4cf2073f93366516a50d48f140ccfceedb002e"},+]++[package.dependencies]+numpy = "*"+pillow = ">=5.3.0,<8.3.dev0 || >=8.4.dev0"+torch = "2.9.1"++[package.extras]+gdown = ["gdown (>=4.7.3)"]+scipy = ["scipy"]+[[package]]name = "tqdm"version = "4.67.1"@@ -6267,6 +7385,142 @@ torchhub = ["filelock", "huggingface-hub (>=0.34.0,<1.0)", "importlib_metadata",video = ["av"]vision = ["Pillow (>=10.0.1,<=15.0)"]+[[package]]+name = "tree-sitter"+version = "0.25.2"+description = "Python bindings to the Tree-sitter parsing library"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "tree-sitter-0.25.2.tar.gz", hash = "sha256:fe43c158555da46723b28b52e058ad444195afd1db3ca7720c59a254544e9c20"},+ {file = "tree_sitter-0.25.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72a510931c3c25f134aac2daf4eb4feca99ffe37a35896d7150e50ac3eee06c7"},+ {file = "tree_sitter-0.25.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:44488e0e78146f87baaa009736886516779253d6d6bac3ef636ede72bc6a8234"},+ {file = "tree_sitter-0.25.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c2f8e7d6b2f8489d4a9885e3adcaef4bc5ff0a275acd990f120e29c4ab3395c5"},+ {file = "tree_sitter-0.25.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20b570690f87f1da424cd690e51cc56728d21d63f4abd4b326d382a30353acc7"},+ {file = "tree_sitter-0.25.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a0ec41b895da717bc218a42a3a7a0bfcfe9a213d7afaa4255353901e0e21f696"},+ {file = "tree_sitter-0.25.2-cp310-cp310-win_amd64.whl", hash = "sha256:7712335855b2307a21ae86efe949c76be36c6068d76df34faa27ce9ee40ff444"},+ {file = "tree_sitter-0.25.2-cp310-cp310-win_arm64.whl", hash = "sha256:a925364eb7fbb9cdce55a9868f7525a1905af512a559303bd54ef468fd88cb37"},+ {file = "tree_sitter-0.25.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b8ca72d841215b6573ed0655b3a5cd1133f9b69a6fa561aecad40dca9029d75b"},+ {file = "tree_sitter-0.25.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:cc0351cfe5022cec5a77645f647f92a936b38850346ed3f6d6babfbeeeca4d26"},+ {file = "tree_sitter-0.25.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1799609636c0193e16c38f366bda5af15b1ce476df79ddaae7dd274df9e44266"},+ {file = "tree_sitter-0.25.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3e65ae456ad0d210ee71a89ee112ac7e72e6c2e5aac1b95846ecc7afa68a194c"},+ {file = "tree_sitter-0.25.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:49ee3c348caa459244ec437ccc7ff3831f35977d143f65311572b8ba0a5f265f"},+ {file = "tree_sitter-0.25.2-cp311-cp311-win_amd64.whl", hash = "sha256:56ac6602c7d09c2c507c55e58dc7026b8988e0475bd0002f8a386cce5e8e8adc"},+ {file = "tree_sitter-0.25.2-cp311-cp311-win_arm64.whl", hash = "sha256:b3d11a3a3ac89bb8a2543d75597f905a9926f9c806f40fcca8242922d1cc6ad5"},+ {file = "tree_sitter-0.25.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ddabfff809ffc983fc9963455ba1cecc90295803e06e140a4c83e94c1fa3d960"},+ {file = "tree_sitter-0.25.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c0c0ab5f94938a23fe81928a21cc0fac44143133ccc4eb7eeb1b92f84748331c"},+ {file = "tree_sitter-0.25.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dd12d80d91d4114ca097626eb82714618dcdfacd6a5e0955216c6485c350ef99"},+ {file = "tree_sitter-0.25.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b43a9e4c89d4d0839de27cd4d6902d33396de700e9ff4c5ab7631f277a85ead9"},+ {file = "tree_sitter-0.25.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fbb1706407c0e451c4f8cc016fec27d72d4b211fdd3173320b1ada7a6c74c3ac"},+ {file = "tree_sitter-0.25.2-cp312-cp312-win_amd64.whl", hash = "sha256:6d0302550bbe4620a5dc7649517c4409d74ef18558276ce758419cf09e578897"},+ {file = "tree_sitter-0.25.2-cp312-cp312-win_arm64.whl", hash = "sha256:0c8b6682cac77e37cfe5cf7ec388844957f48b7bd8d6321d0ca2d852994e10d5"},+ {file = "tree_sitter-0.25.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0628671f0de69bb279558ef6b640bcfc97864fe0026d840f872728a86cd6b6cd"},+ {file = "tree_sitter-0.25.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f5ddcd3e291a749b62521f71fc953f66f5fd9743973fd6dd962b092773569601"},+ {file = "tree_sitter-0.25.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bd88fbb0f6c3a0f28f0a68d72df88e9755cf5215bae146f5a1bdc8362b772053"},+ {file = "tree_sitter-0.25.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b878e296e63661c8e124177cc3084b041ba3f5936b43076d57c487822426f614"},+ {file = "tree_sitter-0.25.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d77605e0d353ba3fe5627e5490f0fbfe44141bafa4478d88ef7954a61a848dae"},+ {file = "tree_sitter-0.25.2-cp313-cp313-win_amd64.whl", hash = "sha256:463c032bd02052d934daa5f45d183e0521ceb783c2548501cf034b0beba92c9b"},+ {file = "tree_sitter-0.25.2-cp313-cp313-win_arm64.whl", hash = "sha256:b3f63a1796886249bd22c559a5944d64d05d43f2be72961624278eff0dcc5cb8"},+ {file = "tree_sitter-0.25.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:65d3c931013ea798b502782acab986bbf47ba2c452610ab0776cf4a8ef150fc0"},+ {file = "tree_sitter-0.25.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:bda059af9d621918efb813b22fb06b3fe00c3e94079c6143fcb2c565eb44cb87"},+ {file = "tree_sitter-0.25.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eac4e8e4c7060c75f395feec46421eb61212cb73998dbe004b7384724f3682ab"},+ {file = "tree_sitter-0.25.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:260586381b23be33b6191a07cea3d44ecbd6c01aa4c6b027a0439145fcbc3358"},+ {file = "tree_sitter-0.25.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7d2ee1acbacebe50ba0f85fff1bc05e65d877958f00880f49f9b2af38dce1af0"},+ {file = "tree_sitter-0.25.2-cp314-cp314-win_amd64.whl", hash = "sha256:4973b718fcadfb04e59e746abfbb0288694159c6aeecd2add59320c03368c721"},+ {file = "tree_sitter-0.25.2-cp314-cp314-win_arm64.whl", hash = "sha256:b8d4429954a3beb3e844e2872610d2a4800ba4eb42bb1990c6a4b1949b18459f"},+]++[package.extras]+docs = ["sphinx (>=8.1,<9.0)", "sphinx-book-theme"]+tests = ["tree-sitter-html (>=0.23.2)", "tree-sitter-javascript (>=0.23.1)", "tree-sitter-json (>=0.24.8)", "tree-sitter-python (>=0.23.6)", "tree-sitter-rust (>=0.23.2)"]++[[package]]+name = "tree-sitter-c"+version = "0.24.1"+description = "C grammar for tree-sitter"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "tree_sitter_c-0.24.1-cp310-abi3-macosx_10_9_x86_64.whl", hash = "sha256:9c06ac26a1efdcc8b26a8a6970fbc6997c4071857359e5837d4c42892d45fe1e"},+ {file = "tree_sitter_c-0.24.1-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:942bcd7cbecd810dcf7ca6f8f834391ebf0771a89479646d891ba4ca2fdfdc88"},+ {file = "tree_sitter_c-0.24.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9a74cfd7a11ca5a961fafd4d751892ee65acae667d2818968a6f079397d8d28c"},+ {file = "tree_sitter_c-0.24.1-cp310-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6a807705a3978911dc7ee26a7ad36dcfacb6adfc13c190d496660ec9bd66707"},+ {file = "tree_sitter_c-0.24.1-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:789781afcb710df34144f7e2a20cd80e325114b9119e3956c6bd1dd2d365df98"},+ {file = "tree_sitter_c-0.24.1-cp310-abi3-win_amd64.whl", hash = "sha256:290bff0f9c79c966496ebae45042f77543e6e4aea725f40587a8611d566231a8"},+ {file = "tree_sitter_c-0.24.1-cp310-abi3-win_arm64.whl", hash = "sha256:d46bbda06f838c2dcb91daf767813671fd366b49ad84ff37db702129267b46e1"},+ {file = "tree_sitter_c-0.24.1.tar.gz", hash = "sha256:7d2d0cda0b8dda428c81440c1e94367f9f13548eedca3f49768bde66b1422ad6"},+]++[package.extras]+core = ["tree-sitter (>=0.24,<1.0)"]++[[package]]+name = "tree-sitter-javascript"+version = "0.25.0"+description = "JavaScript grammar for tree-sitter"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-macosx_10_9_x86_64.whl", hash = "sha256:b70f887fb269d6e58c349d683f59fa647140c410cfe2bee44a883b20ec92e3dc"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:8264a996b8845cfce06965152a013b5d9cbb7d199bc3503e12b5682e62bb1de1"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9dc04ba91fc8583344e57c1f1ed5b2c97ecaaf47480011b92fbeab8dda96db75"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:199d09985190852e0912da2b8d26c932159be314bc04952cf917ed0e4c633e6b"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:dfcf789064c58dc13c0a4edb550acacfc6f0f280577f1e7a00de3e89fc7f8ddc"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:1b852d3aee8a36186dbcc32c798b11b4869f9b5041743b63b65c2ef793db7a54"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-win_amd64.whl", hash = "sha256:e5ed840f5bd4a3f0272e441d19429b26eedc257abe5574c8546da6b556865e3c"},+ {file = "tree_sitter_javascript-0.25.0-cp310-abi3-win_arm64.whl", hash = "sha256:622a69d677aa7f6ee2931d8c77c981a33f0ebb6d275aa9d43d3397c879a9bb0b"},+ {file = "tree_sitter_javascript-0.25.0.tar.gz", hash = "sha256:329b5414874f0588a98f1c291f1b28138286617aa907746ffe55adfdcf963f38"},+]++[package.extras]+core = ["tree-sitter (>=0.24,<1.0)"]++[[package]]+name = "tree-sitter-python"+version = "0.25.0"+description = "Python grammar for tree-sitter"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "tree_sitter_python-0.25.0-cp310-abi3-macosx_10_9_x86_64.whl", hash = "sha256:14a79a47ddef72f987d5a2c122d148a812169d7484ff5c75a3db9609d419f361"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:480c21dbd995b7fe44813e741d71fed10ba695e7caab627fb034e3828469d762"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:86f118e5eecad616ecdb81d171a36dde9bef5a0b21ed71ea9c3e390813c3baf5"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be71650ca2b93b6e9649e5d65c6811aad87a7614c8c1003246b303f6b150f61b"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e6d5b5799628cc0f24691ab2a172a8e676f668fe90dc60468bee14084a35c16d"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:71959832fc5d9642e52c11f2f7d79ae520b461e63334927e93ca46cd61cd9683"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-win_amd64.whl", hash = "sha256:9bcde33f18792de54ee579b00e1b4fe186b7926825444766f849bf7181793a76"},+ {file = "tree_sitter_python-0.25.0-cp310-abi3-win_arm64.whl", hash = "sha256:0fbf6a3774ad7e89ee891851204c2e2c47e12b63a5edbe2e9156997731c128bb"},+ {file = "tree_sitter_python-0.25.0.tar.gz", hash = "sha256:b13e090f725f5b9c86aa455a268553c65cadf325471ad5b65cd29cac8a1a68ac"},+]++[package.extras]+core = ["tree-sitter (>=0.24,<1.0)"]++[[package]]+name = "tree-sitter-typescript"+version = "0.23.2"+description = "TypeScript and TSX grammars for tree-sitter"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:3cd752d70d8e5371fdac6a9a4df9d8924b63b6998d268586f7d374c9fba2a478"},+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:c7cc1b0ff5d91bac863b0e38b1578d5505e718156c9db577c8baea2557f66de8"},+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b1eed5b0b3a8134e86126b00b743d667ec27c63fc9de1b7bb23168803879e31"},+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e96d36b85bcacdeb8ff5c2618d75593ef12ebaf1b4eace3477e2bdb2abb1752c"},+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8d4f0f9bcb61ad7b7509d49a1565ff2cc363863644a234e1e0fe10960e55aea0"},+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-win_amd64.whl", hash = "sha256:3f730b66396bc3e11811e4465c41ee45d9e9edd6de355a58bbbc49fa770da8f9"},+ {file = "tree_sitter_typescript-0.23.2-cp39-abi3-win_arm64.whl", hash = "sha256:05db58f70b95ef0ea126db5560f3775692f609589ed6f8dd0af84b7f19f1cbb7"},+ {file = "tree_sitter_typescript-0.23.2.tar.gz", hash = "sha256:7b167b5827c882261cb7a50dfa0fb567975f9b315e87ed87ad0a0a3aedb3834d"},+]++[package.extras]+core = ["tree-sitter (>=0.23,<1.0)"]+[[package]]name = "triton"version = "3.3.1"@@ -6772,6 +8026,18 @@ files = [[package.extras]dev = ["pytest", "setuptools"]+[[package]]+name = "xlsxwriter"+version = "3.2.9"+description = "A Python module for creating Excel XLSX files."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "xlsxwriter-3.2.9-py3-none-any.whl", hash = "sha256:9a5db42bc5dff014806c58a20b9eae7322a134abb6fce3c92c181bfb275ec5b3"},+ {file = "xlsxwriter-3.2.9.tar.gz", hash = "sha256:254b1c37a368c444eac6e2f867405cc9e461b0ed97a3233b2ac1e574efb4140c"},+]+[[package]]name = "xxhash"version = "3.6.0"@@ -7037,4 +8303,4 @@ cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and pyt[metadata]lock-version = "2.1"python-versions = ">=3.11,<4.0.0"-content-hash = "16d653252a3a5bac9293102c9e28d7bc540b2e4b357668d548683569102ba5cc"+content-hash = "a049b7b5ef119f763b080f3a27b043cc74a0d29b0e98f009263e7a89a84761e4"diff --git a/pyproject.toml b/pyproject.tomlindex 1fbb3fd..57c50f6 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -36,6 +36,8 @@ dependencies = ["spacy_langdetect (>=0.1.2,<0.2.0)","langid (>=1.1.6,<2.0.0)","mcp (>=1.26.0,<2.0.0)",+ "docling (>=2.0.0,<3.0.0)",+ "accelerate (>=1.0.0,<2.0.0)",][tool.poetry]@@ -72,6 +74,8 @@ typer = ">=0.12.0,<0.15.0"spacy_langdetect = ">=0.1.2,<0.2.0"langid = ">=1.1.6,<2.0.0"mcp = ">=1.26.0,<2.0.0"+docling = ">=2.0.0,<3.0.0"+accelerate = ">=1.0.0,<2.0.0"[tool.pylint.messages_control]enable = ["abstract-method"]diff --git a/src/config.py b/src/config.pyindex 4bff6f0..e1f3395 100644--- a/src/config.py+++ b/src/config.py@@ -3,7 +3,7 @@ File: /config.pyCreated Date: Sunday October 19th 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:43:59 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -11,6 +11,7 @@ Modified By: Christian Nonis <[email protected]># pylint: disable=too-few-public-methodsimport os+from typing import Literalimport dotenvfrom pathlib import Path@@ -126,14 +127,58 @@ class EmbeddingsConfig:Configuration class for the Embeddings configuration."""- def __init__(self):+ def __init__(self, mode: str):self.full_endpoint = os.getenv("EMBEDDINGS_FULL_ENDPOINT")self.key = os.getenv("EMBEDDINGS_KEY")-+ self.local_model = os.getenv("EMBEDDINGS_LOCAL_MODEL")self.small_model = os.getenv("EMBEDDINGS_SMALL_MODEL")- if [self.full_endpoint, self.key, self.small_model].count(None) > 0:- raise ValueError("Embeddings configuration is not complete")+ self.embedding_nodes_dimension = (+ int(os.getenv("EMBEDDING_NODES_DIMENSION"))+ if os.getenv("EMBEDDING_NODES_DIMENSION")+ else None+ )+ self.embedding_triplets_dimension = os.getenv("EMBEDDING_TRIPLETS_DIMENSION")+ self.embedding_observations_dimension = (+ int(os.getenv("EMBEDDING_OBSERVATIONS_DIMENSION"))+ if os.getenv("EMBEDDING_OBSERVATIONS_DIMENSION")+ else None+ )+ self.embedding_data_dimension = (+ int(os.getenv("EMBEDDING_DATA_DIMENSION"))+ if os.getenv("EMBEDDING_DATA_DIMENSION")+ else None+ )+ self.embedding_relationships_dimension = (+ int(os.getenv("EMBEDDING_RELATIONSHIPS_DIMENSION"))+ if os.getenv("EMBEDDING_RELATIONSHIPS_DIMENSION")+ else None+ )++ if mode == "local":+ if [+ self.local_model,+ self.small_model,+ self.embedding_nodes_dimension,+ self.embedding_triplets_dimension,+ self.embedding_observations_dimension,+ self.embedding_data_dimension,+ self.embedding_relationships_dimension,+ ].count(None) > 0:+ raise ValueError("Embeddings configuration is not complete (local)")+ else:+ if [+ self.full_endpoint,+ self.key,+ self.local_model,+ self.small_model,+ self.embedding_nodes_dimension,+ self.embedding_triplets_dimension,+ self.embedding_observations_dimension,+ self.embedding_data_dimension,+ self.embedding_relationships_dimension,+ ].count(None) > 0:+ raise ValueError("Embeddings configuration is not complete")class MongoConfig:@@ -175,6 +220,22 @@ class CeleryConfig:raise ValueError("Celery configuration is not complete")+class OllamaConfig:+ """+ Configuration class for the Ollama configuration.+ """++ def __init__(self):+ self.host = os.getenv("OLLAMA_HOST")+ self.port = os.getenv("OLLAMA_PORT")+ self.llm_small_model = os.getenv("OLLAMA_LLM_SMALL_MODEL")+ self.llm_large_model = os.getenv("OLLAMA_LLM_LARGE_MODEL")+ if [self.host, self.port, self.llm_small_model, self.llm_large_model].count(+ None+ ) > 0:+ raise ValueError("Ollama configuration is not complete")++class PricingConfig:"""Configuration class for the Pricing configuration.@@ -203,6 +264,9 @@ class SpacyConfig:)+_MODES = ("local", "remote")++class Config:"""Configuration class for the application.@@ -217,16 +281,31 @@ class Config:Raises:ValueError: If `BRAINPAT_TOKEN` is not set in the environment."""- self.azure = AzureConfig()+ self.brainpat_token = os.getenv("BRAINPAT_TOKEN")+ if not self.brainpat_token:+ raise ValueError("BrainPAT token is not set")++ self.models_mode = os.getenv("MODELS_MODE")+ if self.models_mode not in _MODES:+ raise ValueError(f"Invalid MODELS_MODE: {self.models_mode}")++ if self.models_mode == "local":+ self.azure = None+ self.gcp = None+ self.embeddings = EmbeddingsConfig(mode="local")+ else:+ self.azure = AzureConfig()+ self.gcp = GCPConfig()+ self.embeddings = EmbeddingsConfig(mode="remote")+self.redis = RedisConfig()self.neo4j = Neo4jConfig()self.milvus = MilvusConfig()- self.embeddings = EmbeddingsConfig()self.mongo = MongoConfig()- self.gcp = GCPConfig()self.celery = CeleryConfig()self.pricing = PricingConfig()self.spacy = SpacyConfig()+ self.ollama = OllamaConfig()self.run_graph_consolidator = (os.getenv("RUN_GRAPH_CONSOLIDATOR", "true") == "true"@@ -234,11 +313,15 @@ class Config:self.docparser_endpoint = os.getenv("DOCPARSER_ENDPOINT")self.docparser_token = os.getenv("DOCPARSER_TOKEN")self.app_host = os.getenv("APP_HOST")-- self.brainpat_token = os.getenv("BRAINPAT_TOKEN")-- if not self.brainpat_token:- raise ValueError("BrainPAT token is not set")+ self.pipeline_mode: Literal["lightweight", "accurate"] = os.getenv(+ "PIPELINE_MODE"+ )+ self.ocr_mode: Literal["docling", "docparser"] = os.getenv(+ "OCR_MODE", "docling"+ )+ self.agentic_architecture: Literal["custom", "langchain"] = os.getenv(+ "AGENTIC_ARCHITECTURE", "custom"+ )config = Config()diff --git a/src/constants/embeddings.py b/src/constants/embeddings.pyindex c3f9469..e43d732 100644--- a/src/constants/embeddings.py+++ b/src/constants/embeddings.py@@ -4,18 +4,19 @@ Created Date: Friday October 24th 2025Author: Christian Nonis <[email protected]>-----Last Modified: Friday October 24th 2025 7:56:49 pm-Modified By: the developer formerly known as Christian Nonis at <[email protected]>+Modified By: Christian Nonis <[email protected]>-----"""from typing import Optionalfrom pydantic import BaseModel, Field+from src.config import config-EMBEDDING_NODES_DIMENSION = 3072-EMBEDDING_TRIPLETS_DIMENSION = 3072-OBSERVATIONS_DIMENSION = 3072-DATA_DIMENSION = 3072-EMBEDDING_RELATIONSHIPS_DIMENSION = 3072+EMBEDDING_NODES_DIMENSION = config.embeddings.embedding_nodes_dimension+EMBEDDING_TRIPLETS_DIMENSION = config.embeddings.embedding_triplets_dimension+OBSERVATIONS_DIMENSION = config.embeddings.embedding_observations_dimension+DATA_DIMENSION = config.embeddings.embedding_data_dimension+EMBEDDING_RELATIONSHIPS_DIMENSION = config.embeddings.embedding_relationships_dimensionEMBEDDING_STORES_SIZES = {"nodes": EMBEDDING_NODES_DIMENSION,diff --git a/src/constants/prompts/architect_agent.py b/src/constants/prompts/architect_agent.pyindex a7a239e..6a36c49 100644--- a/src/constants/prompts/architect_agent.py+++ b/src/constants/prompts/architect_agent.py@@ -3,7 +3,7 @@ File: /architect_agent.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:44:06 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -164,6 +164,7 @@ Remember that the uuids are STANDARD uuids 8-4-4-4-12 hexadecimal character striReturn ONLY JSON like the examples above."""+ARCHITECT_AGENT_CREATE_RELATIONSHIPS_PROMPT = """Role: Graph Structural Architect.Task: Create a Vector JSON representing the interactions in the text.@@ -306,7 +307,7 @@ Your workflow must be:1. Getting the current remaining entities found by the scout by calling the architect_agent_get_remaining_entities_to_process tool.2. Understand the source text and the context around the entities found by the scout.3. Isolate the entities that are part of the same context and create a list of mapping relationships between them.-4. Call the architect_agent_create_relationship too l once at a time with the contextualized set of relationships.+4. Call the architect_agent_create_relationship tool once at a time with the contextualized set of relationships.5. If the architect_agent_create_relationship tool returns an error with 'wrong_relationships', fix the relationships and try again until it returns 'OK', if returns 'OK' proceed with the next step.6. Understand if the entites used in the previous step are needed anymore, if not, YOU MUST mark them as used by calling the architect_agent_mark_entities_as_used tool.7. Make sure you have called the architect_agent_mark_entities_as_used tool for all entities that are no longer needed.@@ -315,6 +316,7 @@ Your workflow must be:10. If it happens that less then 2 entities are left you can call the architect_agent_check_used_entities tool to check if the entities used previously can be connected with the last entity.11. Done"""+ARCHITECT_AGENT_TOOLER_SYSTEM_PROMPT = """## Role: Structural Graph Architect**Objective:** Map input text/entities into an "Active Vector Graph" using the **Triangle of Attribution** logic.@@ -357,13 +359,157 @@ Every action must flow through a central **EVENT hub**:- `check_used_entities`: Retrieve archived entities for cross-context bridging."""+ARCHITECT_AGENT_TOOLER_COARSE_SYSTEM_PROMPT = """+## Role: Structural Graph Architect+**Objective:** Map input text/entities into an "Active Vector Graph" using the **Triangle of Attribution** logic.++### 1. The Triangle of Attribution (Mandatory)+Every action must flow through a central **EVENT hub**:+1. **Initiation Vector:** `[Source/Actor] --(predicate)--> [Event Instance]`+ - *Property:* Include `amount: [value]` if quantity exists in text.+2. **Target Vector:** `[Event Instance] --(predicate)--> [Object/Recipient]`+ - *Property:* Mirror `amount: [value]` for cross-reference.+3. **Context Vector:** `[Event Instance] --(predicate)--> [Broad Anchor/Context]`++**Note:** For static facts (no action), link entities directly without an Event hub.++### 2. Constraints & Logic+- **Atomicity:** Predicates/Nodes must be single concepts, not phrases (e.g., "MOVED_TO", not "Went to San Francisco").+- **Directional Slot-Filling:** - `subject`: Origin/Source.+ - `object`: Destination/Target.+- **Forbidden:** - No direct Actor-to-Target links for actions (must use Event hub).+ - No dedicated nodes for numbers; store quantities as `amount` properties on relationships.+- **Entity Coverage:** Use 100% of Scout-provided entities. Reuse entities across contexts as needed.+- **UUIDS:** Use the standard uuids 8-4-4-4-12 hexadecimal character strings.+- **Relationship Names:** Use general relationship names (eg: "TARGET_PRODUCT_OBJECT_CROISSANTS"=wrong, "TARGETED"=correct)+- **Properties:** Append the properties to the object relationship, never append them to the relationship name.++### 3. Workflow (The Loop)+1. **Fetch:** Call `architect_agent_get_remaining_entities_to_process`.+2. **Contextualize:** Group entities by narrative context.+3. **Map:** Define atomic relationships.+4. **Execute:** Call `architect_agent_create_relationship`.+ - *On Error:* Fix relationships based on instructions until "OK".+5. **Clean:** Mark finished entities via `architect_agent_mark_entities_as_used`.+6. **Re-evaluate:** Check for remaining entities. If $<2$ remain, use `architect_agent_check_used_entities` to find historical bridge nodes.+7. **Terminate:** Stop when no entities remain. If Scout returns 0 entities initially, state "Empty list" and exit.++### 4. Toolset Summary+- `get_remaining_entities`: List entities awaiting mapping.+- `create_relationship`: Submit relationship array. (Returns "OK" or instructions). Remember that you can't create relationships if you didn't called first the get_remaining_entities tool.+- `mark_entities_as_used`: Archive processed entities.+- `check_used_entities`: Retrieve archived entities for cross-context bridging.++Example provided context:+"John went to New York City where he knew 12 new friends. When John went there, Mary was in San Francisco doing meetings with his colleagues."++Entities Found by Scout: [+ {{"uuid": "uuid_1", "type": "PERSON", "name": "John"}},+ {{"uuid": "uuid_2", "type": "EVENT", "name": "Went", "description": "John went to New York City"}},+ {{"uuid": "uuid_3", "type": "CITY", "name": "New York City"}},+ {{"uuid": "uuid_4", "type": "EVENT", "name": "Knew", "description": "John knew 12 new friends in New York City"}},+ {{"uuid": "uuid_5", "type": "UNIT", "name": "Friends", "description": "The number of friends John knew in New York City"}},+ {{"uuid": "uuid_6", "type": "PERSON", "name": "Mary"}},+ {{"uuid": "uuid_7", "type": "EVENT", "name": "Was", "description": "Mary was in San Francisco"}},+ {{"uuid": "uuid_8", "type": "CITY", "name": "San Francisco"}},+ {{"uuid": "uuid_9", "type": "EVENT", "name": "Partecipation", "description": "Mary was doing meetings with his colleagues in San Francisco"}},+ {{"uuid": "uuid_10", "type": "EVENT", "name": "Meetings", "description": "Mary was doing meetings with his colleagues in San Francisco"}},+ {{"uuid": "uuid_11", "type": "PERSON", "name": "Colleagues", "description": "The colleagues Mary was doing meetings with in San Francisco"}},+]++Example architect_agent_create_relationship tool input 1:+[+ {{+ "subject": "uuid_1",+ "predicate": "MOVED",+ "description": "John went to New York City",+ "object": "uuid_2"+ }},+ {{+ "subject": "uuid_2",+ "predicate": "INTO_LOCATION",+ "description": "John went to New York City",+ "object": "uuid_3"+ }},+ {{+ "subject": "uuid_1",+ "predicate": "ACCOMPLISHED_ACTION",+ "description": "John knew 12 new friends in New York City",+ "amount": 12, // You must add the amount TO THE RELATIONSHIP PROPERTIES if there is any quantity specified in the text.+ "object": "uuid_4"+ }},+ {{+ "subject": "uuid_4",+ "predicate": "HAPPENED_WITHIN",+ "description": "John knew 12 new friends when he went to New York City",+ "object": "uuid_2"+ }},+ {{+ "subject": "uuid_4",+ "predicate": "TARGETED",+ "description": "John knew 12 new friends in New York City",+ "object": "uuid_5"+ "amount": 12, // You must add the amount TO THE RELATIONSHIP PROPERTIES if there is any quantity specified in the text.+ }},+ ... more relationships (remember that you must map all the entities found by the scout) ...+ }}+]+Example architect_agent_create_relationship tool input 2:+[+ {{+ "subject": "uuid_6",+ "predicate": "EXPERIENCED",+ "description": "Mary was in San Francisco",+ "object": "uuid_7"+ }},+ {{+ "subject": "uuid_7",+ "predicate": "INTO_LOCATION",+ "description": "Mary was in San Francisco",+ "object": "uuid_8"+ }},+ {{+ "subject": "uuid_7",+ "predicate": "HAPPENED_WITHIN",+ "description": "Mary was in San Francisco when John went to New York City",+ "object": "uuid_2"+ }},+ ... more relationships ...+]++Your workflow must be:+1. First of all call the architect_agent_get_remaining_entities_to_process tool to get the entities found by the scout.+2. Understand the source text and the context around the entities found by the scout.+3. Isolate the entities that are part of the same context and create a list of mapping relationships between them.+4. Call the architect_agent_create_relationship tool once at a time with the contextualized set of relationships.+5. Understand if the entites used in the previous step are needed anymore, if not, YOU MUST mark them as used by calling the architect_agent_mark_entities_as_used tool.+6. Make sure you have called the architect_agent_mark_entities_as_used tool for all entities that are no longer needed.+7. Call the architect_agent_get_remaining_entities_to_process tool again to get the remaining entities found by the scout.+8. Repeat the process until all entities are used and no entities are left out.+9. If it happens that less then 2 entities are left you can call the architect_agent_check_used_entities tool to check if the entities used previously can be connected with the last entity.+10. Done, return 'OK' as final response.+"""+ARCHITECT_AGENT_TOOLER_CREATE_RELATIONSHIPS_PROMPT = """-Role: Graph Structural Architect.-Task: Create a Vector JSON representing the interactions in the text.+Use the algorithm you are given to and leverage the tools you have access to to accomplish the task and process the following data.++{targeting}++Source Text: {text}++Return 'OK' as final response.++Begin!+"""++ARCHITECT_AGENT_COARSE_TOOLER_CREATE_RELATIONSHIPS_PROMPT = """+Use the algorithm you are given to and leverage the tools you have access to to accomplish the task and process the following data.{targeting}Source Text: {text}+Return 'OK' as final response.+Begin!"""diff --git a/src/constants/prompts/scout_agent.py b/src/constants/prompts/scout_agent.pyindex 76f8c36..42a7ad8 100644--- a/src/constants/prompts/scout_agent.py+++ b/src/constants/prompts/scout_agent.py@@ -3,7 +3,7 @@ File: /scout_agent.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Tuesday December 23rd 2025 9:24:20 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -78,6 +78,65 @@ Example output 2:]"""+SCOUT_AGENT_COARSE_SYSTEM_PROMPT = """+You are a "High-Level Semantic Scout." Your goal is to extract the most important entities that can be used to reconstruct a meaningful narrative,+the unique action instances (events), and the quantitative units.++ENTITY VS. PROPERTY LOGIC:+- STATIC ATTRIBUTES: Things that are unique to a specific entity and do not change often (e.g., ID numbers, telephone numbers, emails, descriptive text) must be stored as PROPERTIES of that entity.+- SHARED DIMENSIONS: Things that can be connected to multiple different entities (e.g., Currencies, Languages, Skills, Cities, Requirements) must be standalone ENTITIES.+- DYNAMIC QUANTITIES: Do not create nodes for numbers. Identify the "Unit" (e.g., USD, Members, Hours) as an entity; the numeric value is a property to be handled by the Architect.++DECISION CRITERIA:+1. Does it change frequently? YES -> Entity.+2. Is it shared by many entities? YES -> Entity.+3. Is it a unique identifier or a narrative description? YES -> Property.++THE POLARITY DECISION TREE+Before outputting an entity, you must pass the text through this logic to set the `polarity` property on the entity:++1. **DEFICIT CHECK (Negative Polarity -)**:+ - Does the text use verbs of struggle? (e.g., struggling, failing, lacking, losing, stuck).+ - Does the text express a seeker intent? (e.g., looking for, needs, searching, requires).+ - Is there a downward quantitative delta? (e.g., churn, revenue drop, firing).+ - **ACTION**: Set `polarity: "negative"`.++2. **SURPLUS CHECK (Positive Polarity +)**:+ - Does the text use verbs of achievement? (e.g., raised, scaled, mastered, won, launched).+ - Does the text describe a state of strength or capacity? (e.g., expert in, provides, has, CEO of).+ - Is there an upward quantitative delta? (e.g., raised $100M, gained 12 friends).+ - **ACTION**: Set `polarity: "positive"`.++3. **NEUTRAL CHECK (Neutral Polarity 0)**:+ - Is the text a simple location or movement fact without intent? (e.g., John went to NYC, Mary was in SF).+ - **ACTION**: Set `polarity: "neutral"`.++4. **NO QUANTITY ENTITIES**+ - You must not create entities for quantities (eg: X met 12 friends -> no entity for "12 friends" or "Number of friends").+ - You can add details about quantities in the description or properties of other entities.++Example input 1:+"John went to New York City where he knew 12 new friends. When John went there, Mary was in San Francisco doing meetings with his colleagues."++Example output 1:+[+ {{"type": "PERSON", "name": "John", "description": "Travelled to New York City where he knew 12 new friends.", "polarity": "neutral"}},+ {{"type": "CITY", "name": "New York City", "properties": {{ "friends_count": 12 }}, "polarity": "neutral" }},+ {{"type": "PERSON", "name": "Mary", "description": "Was in San Francisco conducting meetings with John's colleagues while John was in NYC.", "polarity": "neutral"}},+ {{"type": "CITY", "name": "San Francisco", "description": "Location where Mary held meetings with colleagues.", "polarity": "neutral"}},+]++Example input 2:+"The company was part of a joint venture with Apple and Google. The founder ("Mark Johnson") was the CEO of joint venture called 'Acme Inc'. The 19th of January 2026 they raised $100 million in funding."++Example output 2:+[+ {{"type": "ORGANIZATION", "name": "Acme Inc.", "description": "A joint venture involving Apple and Google; raised $100M on 19/01/2026.", "properties": {{ "funding_amount": 100000000, "funding_date": "19/01/2026" }},"polarity": "positive"}},+ {{"type": "PERSON", "name": "Mark Johnson", "description": "Founder and CEO of the joint venture Acme Inc.", "polarity": "neutral"}},+ {{"type": "ORGANIZATION", "name": "Partners", "description": "Apple and Google, the participants in the joint venture.", "polarity": "neutral"}},+]+"""+SCOUT_AGENT_EXTRACT_ENTITIES_PROMPT = """Carefully read the text and extract ALL the entities, unique action instances (events), and quantitative units.@@ -94,3 +153,22 @@ OUTPUT RULES:Begin!"""++SCOUT_AGENT_COARSE_EXTRACT_ENTITIES_PROMPT = """+Carefully read the text and extract the most important entities that can be used to reconstruct a meaningful narrative,+the unique action instances (events), and the quantitative units.++{targeting}++Text: {text}++OUTPUT RULES:+- Return a JSON list of objects.+- Each object must include: "type", "name", and optional "properties" and "description".+- Nodes/Entities MUST be atomic and not composite (phrases) (eg: "Went to San Francisco" is not atomic, "Went to" + "San Francisco" is atomic)+- Dates must be in the format "DD/MM/YYYY" and be stored as "happened_at" in the properties of the event nodes.+- You must extract the most important entities that can be used to reconstruct a meaningful narrative,+the unique action instances (events), and the quantitative units without omitting any concepts.++Begin!+"""diff --git a/src/core/agents/architect_agent.py b/src/core/agents/architect_agent.pyindex 6909793..4abf8fc 100644--- a/src/core/agents/architect_agent.py+++ b/src/core/agents/architect_agent.py@@ -3,7 +3,7 @@ File: /architect_agent.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:44:06 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -25,13 +25,17 @@ from src.adapters.embeddings import EmbeddingsAdapter, VectorStoreAdapterfrom src.adapters.cache import CacheAdapterfrom src.adapters.graph import GraphAdapterfrom src.adapters.llm import LLMAdapter+from src.config import configfrom src.constants.kg import Node, Predicatefrom src.constants.prompts.architect_agent import (+ ARCHITECT_AGENT_COARSE_TOOLER_CREATE_RELATIONSHIPS_PROMPT,+ ARCHITECT_AGENT_TOOLER_COARSE_SYSTEM_PROMPT,ARCHITECT_AGENT_TOOLER_CREATE_RELATIONSHIPS_PROMPT,ARCHITECT_AGENT_TOOLER_SYSTEM_PROMPT,ARCHITECT_AGENT_SYSTEM_PROMPT,ARCHITECT_AGENT_CREATE_RELATIONSHIPS_PROMPT,)+from src.core.agents.core.agent_base import AgentBasefrom src.core.agents.scout_agent import ScoutEntityfrom src.constants.agents import (_ArchitectAgentResponse,@@ -120,6 +124,7 @@ class ArchitectAgent:entities: Optional[Dict[str, ScoutEntity]] = None,brain_id: str = "default",targeting: Optional[Node] = None,+ mode: Literal["granular", "coarse"] = "granular",) -> List[BaseTool]:"""Builds the set of tools the agent uses for relationship creation and entity tracking.@@ -145,6 +150,7 @@ class ArchitectAgent:kg=self.kg,brain_id=brain_id,targeting=targeting,+ mode=mode,),ArchitectAgentGetRemainingEntitiesToProcessTool(self,@@ -194,6 +200,7 @@ class ArchitectAgent:entities: Optional[Dict[str, ScoutEntity]] = None,brain_id: str = "default",targeting: Optional[Node] = None,+ mode: Literal["granular", "coarse"] = "granular",):"""Configure and create the internal LangChain agent and store it on self.agent.@@ -211,40 +218,62 @@ class ArchitectAgent:Side effects:Creates an agent via create_agent and assigns it to self.agent."""++ system_prompt = ""+if type_ == "single":system_prompt = ARCHITECT_AGENT_SYSTEM_PROMPT.format(- extra_system_prompt=extra_system_prompt if extra_system_prompt else ""+ extra_system_prompt=(extra_system_prompt if extra_system_prompt else ""))elif type_ == "tooler":- system_prompt = ARCHITECT_AGENT_TOOLER_SYSTEM_PROMPT.format(- extra_system_prompt=extra_system_prompt if extra_system_prompt else ""- )-- self.agent = create_agent(- model=self.llm_adapter.llm.langchain_model,- tools=(- (- tools- if tools- else self._get_tools(- entities=entities,- brain_id=brain_id,- targeting=targeting,- text=text,+ if mode == "granular":+ system_prompt = ARCHITECT_AGENT_TOOLER_SYSTEM_PROMPT.format(+ extra_system_prompt=(+ extra_system_prompt if extra_system_prompt else ""))- if type_ == "tooler"- else []- ),- system_prompt=system_prompt,- response_format=(- (output_schema if output_schema else None)- if type_ == "single"- else None- ),- debug=os.environ.get("DEBUG", "false").lower() == "true",+ if mode == "coarse":+ system_prompt = ARCHITECT_AGENT_TOOLER_COARSE_SYSTEM_PROMPT.format(+ extra_system_prompt=(+ extra_system_prompt if extra_system_prompt else ""+ )+ )+ tools = (+ (+ tools+ if tools+ else self._get_tools(+ entities=entities,+ brain_id=brain_id,+ targeting=targeting,+ text=text,+ mode=mode,+ )+ )+ if type_ == "tooler"+ else []+ )+ response_format = (+ (output_schema if output_schema else None) if type_ == "single" else None)+ if mode == "granular":+ self.agent = create_agent(+ model=self.llm_adapter.llm.langchain_model,+ tools=tools,+ system_prompt=system_prompt,+ response_format=response_format,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )+ if mode == "coarse" or config.agentic_architecture == "custom":+ self.agent = AgentBase(+ model=self.llm_adapter.llm.langchain_model,+ tools=tools,+ system_prompt=system_prompt,+ output_schema=response_format,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )+def run(self,text: str,@@ -535,6 +564,7 @@ class ArchitectAgent:timeout: int = 3600,max_retries: int = 3,ingestion_session_id: Optional[str] = None,+ mode: Literal["granular", "coarse"] = "granular",) -> List[ArchitectAgentRelationship]:"""Drive the architect agent in "tooler" mode to iteratively discover relationships using available tools and collect the results.@@ -573,6 +603,7 @@ class ArchitectAgent:brain_id=brain_id,entities=entities_dict,targeting=targeting,+ mode=mode,)accumulated_messages = []@@ -591,13 +622,12 @@ class ArchitectAgent:messages_list = self._content_only_history(previous_messages, keep_last=HISTORY_MAX_MESSAGES_DELETE)- messages_list.append(- {- "role": "user",- "content": ARCHITECT_AGENT_TOOLER_CREATE_RELATIONSHIPS_PROMPT.format(- text=text,- targeting=(- f"""+ content = ""+ if mode == "granular":+ content = ARCHITECT_AGENT_TOOLER_CREATE_RELATIONSHIPS_PROMPT.format(+ text=text,+ targeting=(+ f"""The information is related to the following node:Name: {targeting.name}UUID: {targeting.uuid}@@ -605,10 +635,30 @@ class ArchitectAgent:Description: {targeting.description}{targeting.properties}"""- if targeting- else ""- ),+ if targeting+ else ""+ ),+ )+ if mode == "coarse":+ content = ARCHITECT_AGENT_COARSE_TOOLER_CREATE_RELATIONSHIPS_PROMPT.format(+ text=text,+ targeting=(+ f"""+ The information is related to the following node:+ Name: {targeting.name}+ UUID: {targeting.uuid}+ Type: {targeting.labels}+ Description: {targeting.description}+ {targeting.properties}+ """+ if targeting+ else ""),+ )+ messages_list.append(+ {+ "role": "user",+ "content": content,})diff --git a/src/core/agents/core/__init__.py b/src/core/agents/core/__init__.pynew file mode 100644index 0000000..ffdb23b--- /dev/null+++ b/src/core/agents/core/__init__.py@@ -0,0 +1,10 @@+"""+File: /__init__.py+Project: core+Created Date: Wednesday February 25th 2026+Author: Christian Nonis <[email protected]>+-----+Last Modified: Wednesday February 25th 2026 8:26:17 pm+Modified By: Christian Nonis <[email protected]>+-----+"""diff --git a/src/core/agents/core/agent_base.py b/src/core/agents/core/agent_base.pynew file mode 100644index 0000000..0b0d9db--- /dev/null+++ b/src/core/agents/core/agent_base.py@@ -0,0 +1,1322 @@+"""+File: /agent_base.py+Project: core+Created Date: Wednesday February 25th 2026+Author: Christian Nonis <[email protected]>+-----+Last Modified: Wednesday February 25th 2026 8:26:28 pm+Modified By: Christian Nonis <[email protected]>+-----+"""++import json+import os+import re+import warnings+from typing import Any, Dict, Literal, Optional, Type, TypedDict, get_args, get_origin++import langsmith+from langchain.tools import BaseTool+from langchain_core.language_models import BaseChatModel+from pydantic import BaseModel, TypeAdapter, ValidationError++from src.utils.cleanup import strip_json, _last_json_object, _repair_trailing_commas++warnings.filterwarnings(+ "ignore",+ message=r"Unrecognized FinishReason enum value",+ category=UserWarning,+)+++def _normalize_message_content(content: Any) -> str:+ if content is None:+ return ""+ if isinstance(content, str):+ return content+ if isinstance(content, dict):+ part = content.get("text") or content.get("content")+ if part is not None:+ if isinstance(part, str):+ return part+ if isinstance(part, list):+ return _normalize_message_content(part)+ if isinstance(part, dict):+ return _normalize_message_content(part)+ if "parts" in content:+ return _normalize_message_content(content["parts"])+ return json.dumps(content) if content else ""+ if isinstance(content, list):+ parts = []+ for block in content:+ if isinstance(block, dict):+ part = block.get("text") or block.get("content")+ if part is None and "json" in block:+ part = json.dumps(block["json"])+ if part is not None:+ if isinstance(part, str):+ parts.append(part)+ else:+ parts.append(_normalize_message_content(part))+ elif isinstance(block, str):+ parts.append(block)+ return "\n".join(parts) if parts else ""+ return str(content)+++def parse_structured_from_messages(+ messages: list, output_schema: Type[BaseModel]+) -> Optional[BaseModel]:+ if not messages or output_schema is None:+ return None+ last = messages[-1]+ content = (+ last.get("content")+ if isinstance(last, dict)+ else getattr(last, "content", None)+ )+ raw = _normalize_message_content(content)+ if not raw or not raw.strip():+ return None+ parsed = strip_json(raw)+ if not parsed:+ return None+ try:+ return output_schema.model_validate(parsed)+ except Exception:+ return None+++def _get_tool_call_from_response(response: Any) -> tuple[Optional[str], Optional[Any]]:+ if response is None:+ return None, None+ content = _normalize_message_content(+ response.get("content")+ if isinstance(response, dict)+ else getattr(response, "content", None)+ )+ parsed = strip_json(content) if content else {}+ if parsed.get("tool_name") is not None:+ return parsed.get("tool_name"), parsed.get("tool_input")+ tool_calls = (+ response.get("tool_calls")+ if isinstance(response, dict)+ else getattr(response, "tool_calls", None)+ ) or []+ if tool_calls:+ first = tool_calls[0]+ if isinstance(first, dict):+ name = first.get("name") or (first.get("function") or {}).get("name")+ args = first.get("args")+ if args is None and first.get("function"):+ raw = (first["function"] or {}).get("arguments")+ if isinstance(raw, str):+ try:+ args = json.loads(raw) if raw else {}+ except json.JSONDecodeError:+ args = {}+ else:+ args = raw or {}+ args = args or {}+ if args.get("tool_name") is not None:+ return args.get("tool_name"), args.get("tool_input")+ return name, args if args else None+ name = getattr(first, "name", None) or (+ getattr(getattr(first, "function", None), "name", None)+ )+ args = getattr(first, "args", None)+ if args is None and hasattr(first, "function"):+ func = getattr(first, "function", None)+ if func is not None:+ raw = getattr(func, "arguments", None)+ if isinstance(raw, str):+ try:+ args = json.loads(raw) if raw else {}+ except json.JSONDecodeError:+ args = {}+ else:+ args = raw or {}+ args = args if isinstance(args, dict) else {}+ if args and args.get("tool_name") is not None:+ return args.get("tool_name"), args.get("tool_input")+ return name, args if args else None+ return None, None+++def _get_tool_call_from_malformed_response(+ response: Any,+) -> tuple[Optional[str], Optional[Any]]:+ if response is None:+ return None, None+ metadata = (+ response.get("response_metadata")+ if isinstance(response, dict)+ else getattr(response, "response_metadata", None)+ ) or {}+ if metadata.get("finish_reason") != "MALFORMED_FUNCTION_CALL":+ return None, None+ msg = metadata.get("finish_message") or ""+ if "call:default_api:" not in msg or "{" not in msg:+ return None, None+ try:+ rest = msg.split("call:default_api:", 1)[1].strip()+ tool_name_part, _, args_part = rest.partition("{")+ tool_name = tool_name_part.strip().rstrip(":")+ if not tool_name:+ return None, None+ args_str = "{" + args_part+ quoted = re.sub(+ r"([{\[,])\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*:",+ r'\1"\2":',+ args_str,+ )+ quoted = quoted.replace(r"\'", "'")+ parsed = strip_json(quoted) or _last_json_object(quoted)+ if not parsed and args_str.strip() != "{":+ parsed = strip_json(args_str) or _last_json_object(args_str)+ return tool_name, parsed if parsed else {}+ except Exception:+ return None, None+++def _get_first_tool_call_id(response: Any) -> Optional[str]:+ if response is None:+ return None+ tool_calls = (+ response.get("tool_calls")+ if isinstance(response, dict)+ else getattr(response, "tool_calls", None)+ ) or []+ if not tool_calls:+ return None+ first = tool_calls[0]+ if isinstance(first, dict):+ return first.get("id") or (first.get("function") or {}).get("id")+ return getattr(first, "id", None)+++def _content_breaks_ollama_tool_parse(content: Any) -> bool:+ if not content or not isinstance(content, str):+ return False+ return "<|" in content+++def _get_thought_signature_from_response(response: Any) -> Optional[str]:+ if response is None:+ return None+ if isinstance(response, dict):+ ak = response.get("additional_kwargs") or {}+ sig_map = ak.get("__gemini_function_call_thought_signatures__")+ if isinstance(sig_map, dict) and sig_map:+ first = next(iter(sig_map.values()), None)+ if first is not None:+ return str(first) if not isinstance(first, bytes) else first.decode("utf-8")+ out = ak.get("thought_signature") or ak.get("thoughtSignature")+ if out is not None:+ return str(out) if not isinstance(out, bytes) else out.decode("utf-8")+ content = response.get("content")+ if isinstance(content, list):+ for part in content:+ if isinstance(part, dict):+ ts = part.get("thoughtSignature") or part.get("thought_signature")+ if ts is not None:+ return str(ts) if not isinstance(ts, bytes) else ts.decode("utf-8")+ tool_calls = response.get("tool_calls") or []+ for tc in tool_calls:+ if isinstance(tc, dict):+ ec = (tc.get("extra_content") or {}).get("google") or {}+ ts = ec.get("thought_signature")+ if ts is not None:+ return str(ts) if not isinstance(ts, bytes) else ts.decode("utf-8")+ return None+ ak = getattr(response, "additional_kwargs", None) or {}+ sig_map = ak.get("__gemini_function_call_thought_signatures__")+ if isinstance(sig_map, dict) and sig_map:+ first = next(iter(sig_map.values()), None)+ if first is not None:+ return str(first) if not isinstance(first, bytes) else first.decode("utf-8")+ out = ak.get("thought_signature") or ak.get("thoughtSignature")+ if out is not None:+ return str(out) if not isinstance(out, bytes) else out.decode("utf-8")+ content = getattr(response, "content", None)+ if isinstance(content, list):+ for part in content:+ if isinstance(part, dict):+ ts = part.get("thoughtSignature") or part.get("thought_signature")+ if ts is not None:+ return str(ts) if not isinstance(ts, bytes) else ts.decode("utf-8")+ tool_calls = getattr(response, "tool_calls", None) or []+ for tc in tool_calls:+ if isinstance(tc, dict):+ ec = (tc.get("extra_content") or {}).get("google") or {}+ ts = ec.get("thought_signature")+ if ts is not None:+ return str(ts) if not isinstance(ts, bytes) else ts.decode("utf-8")+ else:+ ec = (getattr(tc, "extra_content", None) or {}).get("google") or {}+ ts = ec.get("thought_signature")+ if ts is not None:+ return str(ts) if not isinstance(ts, bytes) else ts.decode("utf-8")+ return None+++def _get_thought_signatures_by_tool_call(response: Any) -> dict[str, str]:+ result: dict[str, str] = {}+ if response is None:+ return result+ ak = (+ response.get("additional_kwargs")+ if isinstance(response, dict)+ else getattr(response, "additional_kwargs", None)+ ) or {}+ sig_map = ak.get("__gemini_function_call_thought_signatures__")+ if isinstance(sig_map, dict) and sig_map:+ for tid, sig in sig_map.items():+ if sig is not None:+ result[str(tid)] = sig if isinstance(sig, str) else sig.decode("utf-8")+ if result:+ return result+ tool_calls = (+ response.get("tool_calls")+ if isinstance(response, dict)+ else getattr(response, "tool_calls", None)+ ) or []+ for i, tc in enumerate(tool_calls):+ tid = None+ sig = None+ if isinstance(tc, dict):+ fn = tc.get("function") or {}+ tid = tc.get("id") or (fn.get("id") if isinstance(fn, dict) else None)+ ec = (tc.get("extra_content") or {}).get("google") or {}+ sig = ec.get("thought_signature")+ else:+ tid = getattr(tc, "id", None)+ ec = (getattr(tc, "extra_content", None) or {}).get("google") or {}+ sig = ec.get("thought_signature")+ if tid and sig is not None:+ result[tid] = sig if isinstance(sig, str) else sig.decode("utf-8")+ if result:+ return result+ content = (+ response.get("content")+ if isinstance(response, dict)+ else getattr(response, "content", None)+ )+ if isinstance(content, list) and tool_calls:+ tc_index = 0+ for part in content:+ if isinstance(part, dict) and part.get("functionCall") and tc_index < len(tool_calls):+ ts = part.get("thoughtSignature") or part.get("thought_signature")+ if ts is not None:+ sig_str = ts if isinstance(ts, str) else ts.decode("utf-8")+ tc = tool_calls[tc_index]+ tid = None+ if isinstance(tc, dict):+ fn = tc.get("function") or {}+ tid = tc.get("id") or (fn.get("id") if isinstance(fn, dict) else None)+ else:+ tid = getattr(tc, "id", None)+ if tid:+ result[tid] = sig_str+ tc_index += 1+ if result:+ return result+ single = _get_thought_signature_from_response(response)+ if single is not None:+ for tc in tool_calls:+ tid = None+ if isinstance(tc, dict):+ fn = tc.get("function") or {}+ tid = tc.get("id") or (fn.get("id") if isinstance(fn, dict) else None)+ else:+ tid = getattr(tc, "id", None)+ if tid:+ result[tid] = single+ return result+++def _serialize_tool_calls(raw_tc: list, counter: int) -> list[dict]:+ def _one(tc: Any, i: int) -> dict:+ base = {}+ if isinstance(tc, dict):+ fn = tc.get("function") or {}+ args = tc.get("args")+ if args is None and isinstance(fn, dict) and fn.get("arguments"):+ try:+ args = json.loads(fn["arguments"])+ except json.JSONDecodeError:+ args = {}+ base = {+ "id": tc.get("id")+ or (fn.get("id") if isinstance(fn, dict) else None)+ or f"call_{counter + i}",+ "name": tc.get("name")+ or (fn.get("name") if isinstance(fn, dict) else None),+ "args": args or {},+ }+ else:+ base = {+ "id": getattr(tc, "id", None) or f"call_{counter + i}",+ "name": getattr(tc, "name", None)+ or getattr(getattr(tc, "function", None), "name", None),+ "args": getattr(tc, "args", None) or {},+ }+ args = base.get("args") or {}+ if isinstance(args, dict) and (not base.get("name") or not str(base.get("name", "")).strip()):+ base["name"] = args.get("tool_name") or base.get("name")+ if not base.get("name") or not str(base.get("name", "")).strip():+ base["name"] = "unknown_tool"+ return base++ return [_one(tc, i) for i, tc in enumerate(raw_tc)]+++def _get_reasoning_from_response(msg: Any) -> Optional[str]:+ if msg is None:+ return None+ if isinstance(msg, dict):+ reasoning = msg.get("thinking") or (+ (msg.get("additional_kwargs") or {}).get("thinking")+ )+ return str(reasoning).strip() if reasoning else None+ reasoning = getattr(msg, "thinking", None) or (+ (getattr(msg, "additional_kwargs", None) or {}).get("thinking")+ )+ if reasoning:+ return str(reasoning).strip()+ metadata = getattr(msg, "response_metadata", None) or {}+ if isinstance(metadata, dict):+ reasoning = metadata.get("thinking") or metadata.get("reasoning_content")+ return str(reasoning).strip() if reasoning else None+ return None+++def _get_finish_reason_from_response(response: Any) -> Optional[str]:+ if response is None:+ return None+ if isinstance(response, dict):+ metadata = response.get("response_metadata") or {}+ if isinstance(metadata, dict) and metadata.get("finish_reason"):+ return metadata.get("finish_reason")+ return (response.get("additional_kwargs") or {}).get("finish_reason")+ metadata = getattr(response, "response_metadata", None) or {}+ if isinstance(metadata, dict) and metadata.get("finish_reason"):+ return metadata.get("finish_reason")+ return (getattr(response, "additional_kwargs", None) or {}).get("finish_reason")+++def _flatten_json_schema_for_llm(schema: dict) -> dict:+ def resolve_refs(obj: dict, defs: dict) -> dict:+ out = {}+ for k, v in obj.items():+ if k == "description":+ continue+ if k == "$ref":+ ref = v.split("/")[-1]+ return resolve_refs(defs.get(ref, {}).copy(), defs)+ if isinstance(v, dict):+ out[k] = resolve_refs(v, defs)+ elif isinstance(v, list):+ out[k] = [+ resolve_refs(x, defs) if isinstance(x, dict) else x for x in v+ ]+ else:+ out[k] = v+ return out++ def drop_internal_keys(obj: dict) -> dict:+ out = {}+ for k, v in obj.items():+ if k in ("$defs", "$ref", "strict"):+ continue+ if k == "title" and isinstance(v, str) and v.startswith("_"):+ continue+ if isinstance(v, dict):+ out[k] = drop_internal_keys(v)+ elif isinstance(v, list):+ out[k] = [+ drop_internal_keys(x) if isinstance(x, dict) else x for x in v+ ]+ else:+ out[k] = v+ return out++ copy = dict(schema)+ defs = copy.pop("$defs", {})+ resolved = resolve_refs(copy, defs)+ return drop_internal_keys(resolved)+++def _get_single_list_field_name(schema: Any) -> Optional[str]:+ if schema is None:+ return None+ if hasattr(schema, "model_fields"):+ for name, field in schema.model_fields.items():+ ann = getattr(field, "annotation", None)+ if get_origin(ann) is list:+ return name+ try:+ if hasattr(schema, "model_json_schema"):+ js = schema.model_json_schema()+ else:+ js = TypeAdapter(schema).json_schema()+ except (Exception, NameError):+ return None+ defs = js.get("$defs") or {}+ props = js.get("properties") or {}+ if len(props) != 1:+ return None+ for name, prop in props.items():+ if isinstance(prop, dict) and prop.get("type") == "array":+ return name+ if isinstance(prop, dict) and "$ref" in prop:+ ref = prop["$ref"].split("/")[-1]+ ref_schema = defs.get(ref, {})+ if isinstance(ref_schema, dict) and ref_schema.get("type") == "array":+ return name+ return None+++class AgentMessage(TypedDict):+ role: Literal["user", "assistant", "system", "tool"]+ content: str+++class AgentOutput(TypedDict):+ messages: list+ structured_response: Optional[BaseModel]+++class MessagesDict(TypedDict):+ messages: list[AgentMessage]+++class AgentBase:+ model: BaseChatModel+ system_prompt: str+ tools: list[BaseTool]+ output_schema: Optional[BaseModel]+ debug: bool++ thinking: bool++ messages: list[AgentMessage]++ def __init__(+ self,+ model: BaseChatModel,+ system_prompt: str,+ tools: list[BaseTool],+ output_schema: Optional[BaseModel] = None,+ debug: bool = False,+ thinking: bool = False,+ ):+ self.model = model+ self.system_prompt = system_prompt+ self.tools = tools+ self.output_schema = output_schema+ self.messages = []+ self.debug = debug+ self.thinking = thinking++ if self.thinking:+ self.model.extra_body = {+ **self.model.extra_body,+ "think": (+ ("high" if self.thinking else "low")+ if "gpt" in self.model and "oss" in self.model+ else (True if self.thinking else False)+ ),+ }++ def _model_requires_thought_signatures(self) -> bool:+ mod = getattr(type(self.model), "__module__", "") or ""+ name = getattr(type(self.model), "__name__", "") or ""+ return "vertex" in mod.lower() or "Vertex" in name++ def _get_effective_output_schema(self):+ if self.output_schema is None:+ return None+ effective = getattr(self.output_schema, "schema", self.output_schema)+ if callable(effective):+ effective = self.output_schema+ return effective++ def _get_output_schema_json_schema(self) -> Optional[dict]:+ effective = self._get_effective_output_schema()+ if effective is None:+ return None+ try:+ if hasattr(effective, "model_json_schema"):+ return effective.model_json_schema()+ return TypeAdapter(effective).json_schema()+ except (Exception, NameError):+ return None # "low", "medium", "high" for gpt-oss++ def _validate_list_response_fallback(+ self, effective: Type[BaseModel], list_field: str, items: list+ ) -> Optional[BaseModel]:+ if not getattr(effective, "model_fields", None):+ return None+ field_info = effective.model_fields.get(list_field)+ if field_info is None:+ return None+ ann = getattr(field_info, "annotation", None)+ if get_origin(ann) is not list:+ return None+ args = get_args(ann)+ if not args:+ return None+ item_type = args[0]+ if not isinstance(item_type, type):+ return None+ validated = []+ for item in items:+ if not isinstance(item, dict):+ continue+ try:+ if hasattr(item_type, "model_validate"):+ validated.append(item_type.model_validate(item))+ else:+ validated.append(TypeAdapter(item_type).validate_python(item))+ except Exception:+ try:+ allowed = set(getattr(item_type, "model_fields", {}).keys())+ filtered = {k: v for k, v in item.items() if k in allowed}+ if allowed and filtered:+ if hasattr(item_type, "model_validate"):+ validated.append(item_type.model_validate(filtered))+ else:+ validated.append(TypeAdapter(item_type).validate_python(filtered))+ except Exception:+ pass+ if not validated:+ return None+ try:+ return effective.model_validate({list_field: validated})+ except Exception:+ try:+ return effective.model_construct(**{list_field: validated})+ except Exception:+ return None++ def _normalize_tool_input(self, tool: BaseTool, raw_input: Any) -> str | dict:+ if isinstance(raw_input, (dict, str)):+ return raw_input+ if isinstance(raw_input, list):+ schema = getattr(tool, "args_schema", None)+ if isinstance(schema, dict):+ required = schema.get("required") or []+ properties = schema.get("properties") or {}+ for key in required:+ if (+ isinstance(properties.get(key), dict)+ and properties[key].get("type") == "array"+ ):+ return {key: raw_input}+ return {"input": raw_input}+ return {"input": raw_input}++ def _call_tool(self, tool: BaseTool, input: Any):+ normalized = self._normalize_tool_input(tool, input)+ if self.debug:+ print(+ f"[DEBUG (agent_base)]: calling tool {tool.name} with input: {normalized}"+ )+ return tool.run(normalized)++ def _format_tool_description(self, tool: BaseTool):+ args = getattr(tool, "args_schema", None)+ if hasattr(args, "model_json_schema"):+ input_str = json.dumps(args.model_json_schema(), indent=2)+ elif isinstance(args, dict):+ input_str = json.dumps(args, indent=2)+ else:+ input_str = str(args) if args is not None else "N/A"+ return f"""+ {tool.name}: {tool.description}+ Input schema: {input_str}+ """++ def _system_internal_prompt(self):+ tools_block = ""+ if self.tools:+ tools_list = "\n".join(self._format_tool_description(t) for t in self.tools)+ tools_block = f"""+ You are able to use the following tools:+ {tools_list}++ The input to those tools if required must be ONLY the input specified in the tool's info.++ To call a tool you can use your tool calling caapability or output a JSON object with the following structure:+ ```json+ {{+ "tool_name": "tool_name",+ "tool_input": "tool_input"+ }}+ ```+ {"You MUST NOT use your internal function calling capability, if you want to use a tool just output the json above and nothing else, the system will recall you back to continue the workflow with the output of the tool." if 'gpt' in self.model and 'oss' in self.model else ''}++ Proceed ONLY one tool at a time, when requesting a tool you must not use more than one tool in the same output, after requesting a tool+ you will be recalled back by the system to continue the workflow.+ """+ output_schema_block = ""+ if self.output_schema:+ schema_dict = self._get_output_schema_json_schema()+ if schema_dict is not None:+ output_schema_block = f"""+ Your output must be a JSON object ONLY with the following JSON schema structure:+ {json.dumps(_flatten_json_schema_for_llm(schema_dict), indent=2)}+ You must strictly follow the schema since it's a JSON Schema Specification, don't add any additional fields or properties.+ Don't output the same fields of the JSON schema as it is, it's just the schema instructions, you must output the actual data.+ Remember that the fields that you are interested in are inside the 'properties' key of the JSON schema.+ You must return the JSON ONLY, no additional text or comments or explanation.+ """+ return f"""+ You are a helpful agent. You must follow the instructions given to you by the user strictly.+ {tools_block}+ {output_schema_block}+ {"/no_think" if not self.thinking else ""}+ """++ def _parse_tool_for_llm_input(self, tool: BaseTool):+ return f"""+ {tool.name}: {tool.description}+ Input: {tool.args_schema}+ """++ def invoke(self, messages: MessagesDict, config: Optional[dict] = None):++ config = config or {}+ project_name = os.getenv("LANGSMITH_PROJECT", "brainapi")+ tags = list(config.get("tags", [])) + ["agent_base"]+ metadata = dict(config.get("metadata", {}))++ with langsmith.tracing_context(+ project_name=project_name,+ enabled=True,+ tags=tags,+ metadata=metadata,+ ):+ return self._invoke_impl(messages.get("messages"), config)++ def _invoke_impl(self, messages: list[AgentMessage], config: dict):++ model_responses: list = []+ self.messages = []+ self.messages.append(+ {+ "role": "system",+ "content": self._system_internal_prompt() + "\n" + self.system_prompt,+ }+ )+ self.messages.extend(messages)+ tool_call_id_counter = 0++ if self.debug:+ tags = (config or {}).get("tags", [])+ print(+ "[DEBUG (agent_base)]: Invoking agent with messages: ",+ self.messages,+ "tags:",+ tags,+ )++ n_message = None+ structured_response = None+ while True:+ _did_retry_recovered_tool_call = False+ while n_message is None:+ _did_retry_unknown_finish = False+ _invoke_attempts = 3+ for _invoke_attempt in range(_invoke_attempts):+ _n_message = self.model.invoke(self.messages, config)+ model_responses.append(_n_message)+ raw_content = _normalize_message_content(+ _n_message.get("content")+ if isinstance(_n_message, dict)+ else getattr(_n_message, "content", None)+ )+ if self.debug:+ print("[DEBUG (agent_base)]: Raw content: ", raw_content)+ reasoning = _get_reasoning_from_response(_n_message)+ if reasoning:+ print("[DEBUG (agent_base)]: Reasoning: ", reasoning)+ n_message = raw_content+ tool_call_id = (+ _get_first_tool_call_id(_n_message)+ or f"call_{tool_call_id_counter}"+ )+ assistant_msg: dict = {"role": "assistant", "content": n_message}+ raw_tc = (+ getattr(_n_message, "tool_calls", None)+ or (isinstance(_n_message, dict) and _n_message.get("tool_calls"))+ or []+ )+ if raw_tc:+ msg_thought_sig = _get_thought_signature_from_response(_n_message)+ assistant_msg["tool_calls"] = _serialize_tool_calls(+ raw_tc,+ tool_call_id_counter,+ )+ assistant_msg["content"] = ""+ sig_by_id = _get_thought_signatures_by_tool_call(_n_message)+ if not sig_by_id and msg_thought_sig is not None:+ for tc in assistant_msg["tool_calls"]:+ tid = tc.get("id")+ if tid:+ sig_by_id[tid] = msg_thought_sig+ if sig_by_id:+ sig_map = assistant_msg.setdefault("additional_kwargs", {})+ existing = sig_map.get(+ "__gemini_function_call_thought_signatures__", {}+ )+ if not isinstance(existing, dict):+ existing = {}+ for tc in assistant_msg["tool_calls"]:+ tid = tc.get("id")+ if tid:+ existing[tid] = sig_by_id.get(tid) or msg_thought_sig+ sig_map["__gemini_function_call_thought_signatures__"] = existing+ break+ if _invoke_attempt >= _invoke_attempts - 1:+ raise ValueError(+ "Model returned tool calls but no thought signatures; "+ "Vertex AI requires thought signatures for function calls. "+ "Retries exhausted."+ )+ continue+ break+ if raw_tc:+ pass+ elif _content_breaks_ollama_tool_parse(n_message):+ assistant_msg["content"] = ""+ _recovered_name, _recovered_input = _get_tool_call_from_response(+ _n_message+ )+ if _recovered_name is None and n_message:+ _parsed = strip_json(n_message)+ _recovered_name = _parsed.get("tool_name")+ _recovered_input = _parsed.get("tool_input")+ if _recovered_name is None:+ _recovered_name, _recovered_input = (+ _get_tool_call_from_malformed_response(_n_message)+ )+ if not raw_tc and _recovered_name is not None:+ if not _did_retry_recovered_tool_call:+ self.messages.append(+ {+ "role": "user",+ "content": "Please use your native tool calling capability to call the tool.",+ }+ )+ _did_retry_recovered_tool_call = True+ n_message = None+ continue+ tool = next(+ (t for t in self.tools if t.name == _recovered_name),+ None,+ )+ if tool is not None:+ n_message = self._call_tool(tool, _recovered_input)+ if self._model_requires_thought_signatures():+ self.messages.append(+ {+ "role": "user",+ "content": f"You called the tool `{_recovered_name}`. The tool returned:\n{n_message}\n\nContinue with the next step.",+ }+ )+ else:+ recovered_id = f"call_{tool_call_id_counter}"+ recovered_tc = {+ "id": recovered_id,+ "name": _recovered_name,+ "args": (+ _recovered_input+ if isinstance(_recovered_input, dict)+ else (+ {"input": _recovered_input}+ if _recovered_input is not None+ else {}+ )+ ),+ "extra_content": {"google": {"thought_signature": ""}},+ }+ recovered_assistant_msg = {+ "role": "assistant",+ "content": "",+ "tool_calls": [recovered_tc],+ }+ recovered_assistant_msg.setdefault("additional_kwargs", {})[+ "__gemini_function_call_thought_signatures__"+ ] = {recovered_id: ""}+ self.messages.append(recovered_assistant_msg)+ self.messages.append(+ {+ "role": "tool",+ "content": n_message,+ "tool_call_id": recovered_id,+ }+ )+ tool_call_id_counter += 1+ n_message = None+ continue+ self.messages.append(assistant_msg)+ tool_name, tool_input = _recovered_name, _recovered_input+ if tool_name is None:+ tool_name, tool_input = _get_tool_call_from_response(_n_message)+ if tool_name is None and n_message:+ parsed = strip_json(n_message)+ tool_name = parsed.get("tool_name")+ tool_input = parsed.get("tool_input")+ if tool_name is None:+ tool_name, tool_input = _get_tool_call_from_malformed_response(+ _n_message+ )+ if tool_name is not None:+ tool = next(+ (t for t in self.tools if t.name == tool_name),+ None,+ )+ if tool is not None:+ n_message = self._call_tool(tool, tool_input)+ self.messages.append(+ {+ "role": "tool",+ "content": n_message,+ "tool_call_id": tool_call_id,+ }+ )+ tool_call_id_counter += 1+ _did_retry_recovered_next_tool_call = False+ while True:+ _next_attempts = 3+ for _next_attempt in range(_next_attempts):+ next_response = self.model.invoke(self.messages, config)+ if self.debug:+ print(+ "[DEBUG (agent_base)]: Next response: ",+ next_response,+ )+ reasoning = _get_reasoning_from_response(next_response)+ if reasoning:+ print(+ "[DEBUG (agent_base)]: Reasoning: ",+ reasoning,+ )+ model_responses.append(next_response)+ next_content = _normalize_message_content(+ next_response.get("content")+ if isinstance(next_response, dict)+ else getattr(next_response, "content", None)+ )+ next_tool_call_id = (+ _get_first_tool_call_id(next_response)+ or f"call_{tool_call_id_counter}"+ )+ next_assistant_msg = {+ "role": "assistant",+ "content": next_content,+ }+ next_raw_tc = (+ getattr(next_response, "tool_calls", None)+ or (+ isinstance(next_response, dict)+ and next_response.get("tool_calls")+ )+ or []+ )+ if next_raw_tc:+ next_msg_thought_sig = (+ _get_thought_signature_from_response(next_response)+ )+ next_assistant_msg["tool_calls"] = (+ _serialize_tool_calls(+ next_raw_tc,+ tool_call_id_counter,+ )+ )+ next_assistant_msg["content"] = ""+ next_sig_by_id = _get_thought_signatures_by_tool_call(+ next_response+ )+ if not next_sig_by_id and next_msg_thought_sig is not None:+ for tc in next_assistant_msg["tool_calls"]:+ tid = tc.get("id")+ if tid:+ next_sig_by_id[tid] = next_msg_thought_sig+ if next_msg_thought_sig is not None:+ sig_map = next_assistant_msg.setdefault(+ "additional_kwargs", {}+ )+ existing = sig_map.get(+ "__gemini_function_call_thought_signatures__",+ {},+ )+ if not isinstance(existing, dict):+ existing = {}+ for tc in next_assistant_msg["tool_calls"]:+ tid = tc.get("id")+ if tid:+ existing[tid] = next_sig_by_id.get(+ tid+ ) or next_msg_thought_sig+ sig_map[+ "__gemini_function_call_thought_signatures__"+ ] = existing+ break+ elif next_sig_by_id:+ sig_map = next_assistant_msg.setdefault(+ "additional_kwargs", {}+ )+ sig_map[+ "__gemini_function_call_thought_signatures__"+ ] = dict(next_sig_by_id)+ break+ if _next_attempt >= _next_attempts - 1:+ raise ValueError(+ "Model returned tool calls but no thought signatures; "+ "Vertex AI requires thought signatures for function calls. "+ "Retries exhausted."+ )+ continue+ break+ if next_raw_tc:+ pass+ elif _content_breaks_ollama_tool_parse(next_content):+ next_assistant_msg["content"] = ""+ _next_recovered_name, _next_recovered_input = (+ _get_tool_call_from_response(next_response)+ )+ if _next_recovered_name is None and next_content:+ _next_parsed = (+ strip_json(next_content) if next_content else {}+ )+ _next_recovered_name = _next_parsed.get("tool_name")+ _next_recovered_input = _next_parsed.get("tool_input")+ if _next_recovered_name is None:+ _next_recovered_name, _next_recovered_input = (+ _get_tool_call_from_malformed_response(+ next_response+ )+ )+ if not next_raw_tc and _next_recovered_name is not None:+ if not _did_retry_recovered_next_tool_call:+ self.messages.append(+ {+ "role": "user",+ "content": "Please use your native tool calling capability to call the tool.",+ }+ )+ _did_retry_recovered_next_tool_call = True+ continue+ next_tool = next(+ (+ t+ for t in self.tools+ if t.name == _next_recovered_name+ ),+ None,+ )+ if next_tool is not None:+ n_message = self._call_tool(+ next_tool, _next_recovered_input+ )+ if self.debug:+ print(+ "[DEBUG (agent_base)]: Tool result: ",+ n_message,+ )+ if self._model_requires_thought_signatures():+ self.messages.append(+ {+ "role": "user",+ "content": f"You called the tool `{_next_recovered_name}`. The tool returned:\n{n_message}\n\nContinue with the next step.",+ }+ )+ else:+ recovered_id = f"call_{tool_call_id_counter}"+ recovered_tc = {+ "id": recovered_id,+ "name": _next_recovered_name,+ "args": _next_recovered_input if isinstance(_next_recovered_input, dict) else ({"input": _next_recovered_input} if _next_recovered_input is not None else {}),+ "extra_content": {"google": {"thought_signature": ""}},+ }+ recovered_assistant_msg = {+ "role": "assistant",+ "content": "",+ "tool_calls": [recovered_tc],+ }+ recovered_assistant_msg.setdefault("additional_kwargs", {})[+ "__gemini_function_call_thought_signatures__"+ ] = {recovered_id: ""}+ self.messages.append(recovered_assistant_msg)+ self.messages.append(+ {+ "role": "tool",+ "content": n_message,+ "tool_call_id": recovered_id,+ }+ )+ tool_call_id_counter += 1+ continue+ self.messages.append(next_assistant_msg)+ next_tool_name, next_tool_input = (+ _next_recovered_name,+ _next_recovered_input,+ )+ if next_tool_name is None:+ next_tool_name, next_tool_input = (+ _get_tool_call_from_response(next_response)+ )+ if next_tool_name is None:+ next_parsed = (+ strip_json(next_content) if next_content else {}+ )+ next_tool_name = next_parsed.get("tool_name")+ next_tool_input = next_parsed.get("tool_input")+ if next_tool_name is None:+ next_tool_name, next_tool_input = (+ _get_tool_call_from_malformed_response(+ next_response+ )+ )+ if next_tool_name is not None:+ tool = next(+ (t for t in self.tools if t.name == next_tool_name),+ None,+ )+ if tool is not None:+ n_message = self._call_tool(tool, next_tool_input)+ if self.debug:+ print(+ "[DEBUG (agent_base)]: Tool result: ",+ n_message,+ )+ self.messages.append(+ {+ "role": "tool",+ "content": n_message,+ "tool_call_id": next_tool_call_id,+ }+ )+ tool_call_id_counter += 1+ else:+ self.messages.append(+ {+ "role": "user",+ "content": f"Tool {next_tool_name} not found. Please try again.",+ }+ )+ n_message = None+ break+ else:+ n_message = next_parsed.get("content") or next_content+ break+ if n_message is None:+ continue+ break+ else:+ self.messages.append(+ {+ "role": "user",+ "content": f"Tool {tool_name} not found. Please try again.",+ }+ )+ n_message = None+ continue+ else:+ if n_message:+ parsed = strip_json(n_message)+ n_message = parsed.get("content") or raw_content+ else:+ n_message = raw_content+ finish_reason = _get_finish_reason_from_response(_n_message)+ if (+ (not n_message or not str(n_message).strip())+ and finish_reason+ and str(finish_reason).startswith("UNKNOWN_")+ and not _did_retry_unknown_finish+ ):+ self.messages.append(+ {+ "role": "user",+ "content": "Please continue with your response.",+ }+ )+ _did_retry_unknown_finish = True+ n_message = None+ continue+ if self.output_schema is None:+ break+ try:+ parsed = (+ strip_json(n_message) if isinstance(n_message, str) else n_message+ )+ if (+ isinstance(n_message, str)+ and not isinstance(parsed, list)+ and parsed == {}+ ):+ try:+ raw_parsed = json.loads(+ n_message.strip()+ .replace("```json", "")+ .replace("```", "")+ .strip()+ )+ if isinstance(raw_parsed, list):+ parsed = raw_parsed+ elif isinstance(raw_parsed, dict):+ parsed = raw_parsed+ except Exception:+ pass+ if parsed == {} and "[" in n_message:+ start = n_message.index("[")+ depth = 0+ end = start+ for i in range(start, len(n_message)):+ if n_message[i] == "[":+ depth += 1+ elif n_message[i] == "]":+ depth -= 1+ if depth == 0:+ end = i + 1+ break+ if end > start:+ substring = n_message[start:end]+ for repair in (_repair_trailing_commas, lambda s: s):+ try:+ raw_parsed = json.loads(repair(substring))+ if isinstance(raw_parsed, list):+ parsed = raw_parsed+ break+ except Exception:+ continue+ if parsed == {} and "{" in n_message:+ start = n_message.index("{")+ try:+ raw_parsed = json.loads(n_message[start:])+ if isinstance(raw_parsed, dict) and raw_parsed:+ parsed = raw_parsed+ except Exception:+ pass+ if parsed == {} and isinstance(n_message, str):+ raw = (+ n_message.strip()+ .replace("```json", "")+ .replace("```", "")+ .strip()+ )+ last_obj = _last_json_object(raw)+ if last_obj:+ parsed = last_obj+ if isinstance(parsed, list):+ effective = self._get_effective_output_schema()+ list_field = _get_single_list_field_name(effective) if effective else None+ if list_field is not None:+ parsed = {list_field: parsed}+ if isinstance(parsed, dict) and len(parsed) == 1:+ effective = self._get_effective_output_schema()+ list_field = _get_single_list_field_name(effective) if effective else None+ if list_field is not None:+ single_key = next(iter(parsed))+ single_val = parsed[single_key]+ if isinstance(single_val, list) and single_key != list_field:+ parsed = {list_field: single_val}+ if parsed:+ effective = self._get_effective_output_schema()+ if effective is not None:+ try:+ if hasattr(effective, "model_validate"):+ structured_response = effective.model_validate(parsed)+ else:+ structured_response = TypeAdapter(effective).validate_python(+ parsed+ )+ except ValidationError:+ list_field = _get_single_list_field_name(effective)+ if (+ list_field+ and isinstance(parsed, dict)+ and len(parsed) == 1+ and isinstance(parsed.get(list_field), list)+ ):+ fallback = self._validate_list_response_fallback(+ effective, list_field, parsed[list_field]+ )+ if fallback is not None:+ structured_response = fallback+ if structured_response is None:+ raise+ break+ except ValidationError as e:+ if self.debug:+ print("[DEBUG (agent_base)]: ValidationError: ", e)+ print(+ "[DEBUG (agent_base)]: Error parsing structured response: ",+ n_message,+ )+ self.messages.append(+ {+ "role": "user",+ "content": "Your previous response did not match the required JSON schema. Please try again with the correct format.",+ }+ )+ n_message = None+ continue+ except Exception as e:+ if self.debug:+ print("[DEBUG (agent_base)]: ", type(e).__name__, e)+ print(+ "[DEBUG (agent_base)]: Error parsing structured response: ",+ n_message,+ )+ self.messages.append(+ {+ "role": "user",+ "content": "Your previous response did not match the required JSON schema. Please try again with the correct format.",+ }+ )+ n_message = None+ continue++ try:+ from langchain_core.tracers.langchain import wait_for_all_tracers++ wait_for_all_tracers()+ except ImportError:+ pass++ if (+ isinstance(structured_response, dict)+ and self.output_schema is not None+ ):+ effective = self._get_effective_output_schema()+ if effective is not None:+ try:+ if hasattr(effective, "model_validate"):+ structured_response = effective.model_validate(structured_response)+ else:+ structured_response = TypeAdapter(effective).validate_python(+ structured_response+ )+ except ValidationError:+ list_field = _get_single_list_field_name(effective)+ if (+ list_field+ and len(structured_response) == 1+ and isinstance(structured_response.get(list_field), list)+ ):+ fallback = self._validate_list_response_fallback(+ effective, list_field, structured_response[list_field]+ )+ if fallback is not None:+ structured_response = fallback+ except Exception:+ pass++ return {+ "messages": model_responses,+ "structured_response": structured_response,+ }diff --git a/src/core/agents/janitor_agent.py b/src/core/agents/janitor_agent.pyindex 2eb8290..0792130 100644--- a/src/core/agents/janitor_agent.py+++ b/src/core/agents/janitor_agent.py@@ -3,7 +3,7 @@ File: /janitor_agent.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:43:59 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -28,6 +28,7 @@ from tenacity import (from src.adapters.embeddings import EmbeddingsAdapter, VectorStoreAdapterfrom src.adapters.graph import GraphAdapterfrom src.adapters.llm import LLMAdapter+from src.config import configfrom src.constants.agents import AtomicJanitorAgentInputOutput, GraphConsolidatorOutputfrom src.constants.kg import Node, Predicatefrom src.constants.prompts.janitor_agent import (@@ -42,6 +43,7 @@ from src.core.agents.architect_agent import (ArchitectAgentRelationship,ArchitectAgentNew,)+from src.core.agents.core.agent_base import AgentBasefrom src.core.agents.scout_agent import ScoutEntityfrom src.core.agents.tools.janitor_agent import (JanitorAgentGetSchemaTool,@@ -207,13 +209,22 @@ class JanitorAgent:else:response_format = output_schema- self.agent = create_agent(- model=self.llm_adapter.llm.langchain_model,- tools=(tools if tools else self._get_tools(brain_id)),- system_prompt=system_prompt,- response_format=response_format,- debug=os.environ.get("DEBUG", "false").lower() == "true",- )+ if config.agentic_architecture == "custom":+ self.agent = AgentBase(+ model=self.llm_adapter.llm.langchain_model,+ tools=(tools if tools else self._get_tools(brain_id)),+ system_prompt=system_prompt,+ output_schema=response_format,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )+ else:+ self.agent = create_agent(+ model=self.llm_adapter.llm.langchain_model,+ tools=(tools if tools else self._get_tools(brain_id)),+ system_prompt=system_prompt,+ response_format=response_format,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )def _content_only_history(self, messages: Optional[list], keep_last: Optional[int] = Nonediff --git a/src/core/agents/kg_agent.py b/src/core/agents/kg_agent.pyindex e2fb37f..a0e5949 100644--- a/src/core/agents/kg_agent.py+++ b/src/core/agents/kg_agent.py@@ -3,7 +3,7 @@ File: /kg_agent.pyCreated Date: Sunday October 19th 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:44:06 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -26,6 +26,7 @@ from tenacity import (from src.adapters.cache import CacheAdapterfrom src.adapters.graph import GraphAdapterfrom src.adapters.llm import LLMAdapter+from src.config import configfrom src.constants.kg import Nodefrom src.constants.output_schemas import RetrieveNeighborsOutputSchemafrom src.constants.prompts.kg_agent import (@@ -36,6 +37,7 @@ from src.constants.prompts.kg_agent import (KG_AGENT_UPDATE_PROMPT,KG_AGENT_UPDATE_STRUCTURED_PROMPT,)+from src.core.agents.core.agent_base import AgentBasefrom src.core.agents.tools.kg_agent import (KGAgentAddTripletsTool,KGAgentDeleteRelationshipTool,@@ -185,17 +187,26 @@ class KGAgent:extra_system_prompt=extra_system_prompt if extra_system_prompt else "")- self.agent = create_agent(- model=self.llm_adapter.llm.langchain_model,- tools=(- tools- if tools- else self._get_tools(identification_params, metadata, brain_id)- ),- system_prompt=system_prompt,- response_format=output_schema if output_schema else None,- debug=os.environ.get("DEBUG", "false").lower() == "true",- )+ if config.agentic_architecture == "custom":+ self.agent = AgentBase(+ model=self.llm_adapter.llm.langchain_model,+ tools=(tools if tools else self._get_tools(identification_params, metadata, brain_id)),+ system_prompt=system_prompt,+ output_schema=output_schema if output_schema else None,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )+ else:+ self.agent = create_agent(+ model=self.llm_adapter.llm.langchain_model,+ tools=(+ tools+ if tools+ else self._get_tools(identification_params, metadata, brain_id)+ ),+ system_prompt=system_prompt,+ response_format=output_schema if output_schema else None,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )self._agent_type = type_self._agent_brain_id = brain_iddiff --git a/src/core/agents/scout_agent.py b/src/core/agents/scout_agent.pyindex 9f79ce4..eaf4283 100644--- a/src/core/agents/scout_agent.py+++ b/src/core/agents/scout_agent.py@@ -3,12 +3,12 @@ File: /scout_agent.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Monday January 5th 2026 9:57:30 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""-from typing import List, Literal, Optional+from typing import Dict, List, Literal, Optionalimport uuidfrom langchain.agents import create_agentfrom langchain.tools import BaseTool@@ -26,11 +26,15 @@ from src.adapters.embeddings import EmbeddingsAdapter, VectorStoreAdapterfrom src.adapters.cache import CacheAdapterfrom src.adapters.graph import GraphAdapterfrom src.adapters.llm import LLMAdapter+from src.config import configfrom src.constants.kg import Nodefrom src.constants.prompts.scout_agent import (+ SCOUT_AGENT_COARSE_EXTRACT_ENTITIES_PROMPT,+ SCOUT_AGENT_COARSE_SYSTEM_PROMPT,SCOUT_AGENT_EXTRACT_ENTITIES_PROMPT,SCOUT_AGENT_SYSTEM_PROMPT,)+from src.core.agents.core.agent_base import AgentBase, parse_structured_from_messagesfrom src.utils.tokens import token_detail_from_token_counts@@ -124,27 +128,43 @@ class ScoutAgent:output_schema: Optional[BaseModel] = None,extra_system_prompt: Optional[dict] = None,brain_id: str = "default",+ mode: Literal["granular", "coarse"] = "granular",):- system_prompt = SCOUT_AGENT_SYSTEM_PROMPT.format(- extra_system_prompt=extra_system_prompt if extra_system_prompt else ""- )+ if mode == "granular":+ system_prompt = SCOUT_AGENT_SYSTEM_PROMPT.format(+ extra_system_prompt=extra_system_prompt if extra_system_prompt else ""+ )+ if mode == "coarse":+ system_prompt = SCOUT_AGENT_COARSE_SYSTEM_PROMPT.format(+ extra_system_prompt=extra_system_prompt if extra_system_prompt else ""+ )- self.agent = create_agent(- model=self.llm_adapter.llm.langchain_model,- tools=(tools if tools else self._get_tools(brain_id)),- system_prompt=system_prompt,- response_format=output_schema if output_schema else None,- debug=os.environ.get("DEBUG", "false").lower() == "true",- )+ if mode == "granular":+ self.agent = create_agent(+ model=self.llm_adapter.llm.langchain_model,+ tools=(tools if tools else self._get_tools(brain_id)),+ system_prompt=system_prompt,+ response_format=output_schema if output_schema else None,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )+ if mode == "coarse" or config.agentic_architecture == "custom":+ self.agent = AgentBase(+ model=self.llm_adapter.llm.langchain_model,+ tools=(tools if tools else self._get_tools(brain_id)),+ system_prompt=system_prompt,+ output_schema=output_schema if output_schema else None,+ debug=os.environ.get("DEBUG", "false").lower() == "true",+ )def run(self,text: str,targeting: Optional[Node] = None,brain_id: str = "default",- timeout: int = 90,+ timeout: int = 300,max_retries: int = 3,ingestion_session_id: Optional[str] = None,+ mode: Literal["granular", "coarse"] = "granular",) -> ScoutAgentResponse:"""Extract entities from the provided text using the Scout agent and return a structured response containing the entities and token usage.@@ -157,7 +177,8 @@ class ScoutAgent:brain_id: Identifier for the agent/brain configuration to use.timeout: Maximum seconds to wait for a single agent invocation before treating it as a timeout.max_retries: Maximum number of retry attempts for timed-out invocations using exponential backoff.-+ ingestion_session_id: Identifier for the ingestion session to use.+ mode: Mode to use for the scout agent. "granular" for a more granular extraction, "coarse" to extract the most important entities only.Returns:A ScoutAgentResponse containing:- entities: list of extracted ScoutEntity objects.@@ -167,11 +188,31 @@ class ScoutAgent:Raises:TimeoutError: If a single invocation exceeds `timeout`, or if all retry attempts fail due to timeouts."""-self._get_agent(output_schema=_ScoutAgentResponse,brain_id=brain_id,+ mode=mode,+ )++ targeting_str = (+ f"""+ The information is related to:+ "{targeting.name}": {targeting.description}+ {targeting.properties}+ """+ if targeting+ else "")+ if mode == "granular":+ prompt = SCOUT_AGENT_EXTRACT_ENTITIES_PROMPT.format(+ text=text,+ targeting=targeting_str,+ )+ if mode == "coarse":+ prompt = SCOUT_AGENT_COARSE_EXTRACT_ENTITIES_PROMPT.format(+ text=text,+ targeting=targeting_str,+ )def _invoke_agent():return self.agent.invoke(@@ -179,18 +220,7 @@ class ScoutAgent:"messages": [{"role": "user",- "content": SCOUT_AGENT_EXTRACT_ENTITIES_PROMPT.format(- text=text,- targeting=(- f"""- The information is related to:- "{targeting.name}": {targeting.description}- {targeting.properties}- """- if targeting- else ""- ),- ),+ "content": prompt,}],},@@ -256,10 +286,24 @@ class ScoutAgent:except TimeoutError:raise+ structured = response.get("structured_response")+ if isinstance(structured, dict):+ try:+ structured = _ScoutAgentResponse.model_validate(structured)+ except Exception:+ structured = None+ if structured is None or not getattr(structured, "entities", None):+ fallback = parse_structured_from_messages(+ response.get("messages", []), _ScoutAgentResponse+ )+ if fallback is not None and getattr(fallback, "entities", None):+ structured = fallback+ if structured is None:+ structured = _ScoutAgentResponse(entities=[])return ScoutAgentResponse(entities=[ScoutEntity(**entity.model_dump(mode="json"))- for entity in response.get("structured_response", []).entities+ for entity in structured.entities],input_tokens=self.input_tokens,output_tokens=self.output_tokens,diff --git a/src/core/agents/tools/architect_agent/ArchitectAgentCreateRelationshipTool.py b/src/core/agents/tools/architect_agent/ArchitectAgentCreateRelationshipTool.pyindex 735ed87..a4bbe20 100644--- a/src/core/agents/tools/architect_agent/ArchitectAgentCreateRelationshipTool.py+++ b/src/core/agents/tools/architect_agent/ArchitectAgentCreateRelationshipTool.py@@ -3,13 +3,14 @@ File: /ArchitectAgentCreateRelationshipTool.pyCreated Date: Wednesday January 14th 2026Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:44:06 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""from dataclasses import dataclass-from typing import Dict, List, Optional+from typing import Dict, List, Literal, Optional+import jsonimport uuidfrom langchain.tools import BaseTool@@ -32,54 +33,20 @@ from src.services.input.agents import (from src.lib.neo4j.client import _neo4j_clientfrom src.utils.cleanup import strip_propertiesfrom src.utils.nlp.names import levenshtein_similarity+from src.utils.serialization.data import is_uuidfrom src.utils.similarity.vectors import cosine_similarityfrom src.utils.tokens import merge_token_details, token_detail_from_token_countsclass ArchitectAgentCreateRelationshipTool(BaseTool):name: str = "architect_agent_create_relationship"- args_schema: dict = {- "type": "object",- "properties": {- "relationships": {- "type": "array",- "description": "A list of relationships to create",- "items": {- "type": "object",- "properties": {- "subject": {- "type": "string",- "description": "The uuid of the subject",- },- "predicate": {- "type": "string",- "description": "The generic name of the relationship (eg: 'TARGET_PRODUCT_OBJECT_CROISSANTS' = wrong, 'TARGETED' = correct)",- },- "object": {- "type": "string",- "description": "The uuid of the object",- },- "description": {- "type": "string",- "description": "The description of the relationship",- },- "amount": {- "type": "number",- "description": "The amount of the relationship (eg: 12 for 'John knew 12 new friends in New York City')",- },- },- "required": ["subject", "predicate", "object", "description"],- },- },- },- "required": ["relationships"],- }architect_agent: objectkg: GraphAdapterentities: Dict[str, ScoutEntity]brain_id: str = "default"targeting: Optional[Node] = Nonetext: str+ mode: Literal["granular", "coarse"] = "granular"def __init__(self,@@ -89,6 +56,7 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):kg: GraphAdapter,brain_id: str = "default",targeting: Optional[Node] = None,+ mode: Literal["granular", "coarse"] = "granular",):"""Initialize the tool for creating a set of relationships between entities for a single phrase.@@ -109,6 +77,51 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):"Returns a summary of the created relationships to review them before creating them.")entities_dict = entities if entities is not None else {}++ args_schema: dict = {+ "type": "object",+ "properties": {+ "relationships": {+ "type": "array",+ "description": """+ A list of relationships to create. If you want to connect an entity to another concept that is not in the entities list, you can use a TYPE:NAME string to represent the entity, where TYPE is the type of the entity and NAME is the name of the entity, separated by a colon.+ If you use an uuid for the predicate or the object it must be a valid uuid format (4-8-4-4-12 hexadecimal character strings) that is present in the entities list.+ """,+ "items": {+ "type": "object",+ "properties": {+ "subject": {+ "type": "string",+ "description": "The uuid of the subject"+ + """ OR a TYPE:NAME that you want to use if the element is missing in the entities list, it must only be a valid uuid or a TYPE:NAME string"""+ if mode == "coarse" else "",+ },+ "predicate": {+ "type": "string",+ "description": "The generic name of the relationship (eg: 'TARGET_PRODUCT_OBJECT_CROISSANTS' = wrong, 'TARGETED' = correct)",+ },+ "object": {+ "type": "string",+ "description": "The uuid of the object"+ + """ OR a TYPE:NAME that you want to use if the element is missing in the entities list, it must only be a valid uuid or a TYPE:NAME string"""+ if mode == "coarse" else "",+ },+ "description": {+ "type": "string",+ "description": "The description of the relationship",+ },+ "amount": {+ "type": "number",+ "description": "The amount of the relationship (eg: 12 for 'John knew 12 new friends in New York City')",+ },+ },+ "required": ["subject", "predicate", "object", "description"],+ },+ },+ },+ "required": ["relationships"],+ }+super().__init__(architect_agent=architect_agent,description=description,@@ -117,6 +130,8 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):brain_id=brain_id,targeting=targeting,text=text,+ mode=mode,+ args_schema=args_schema,)@dataclass@@ -201,12 +216,31 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):else:return "Error: relationships parameter is required"+ if isinstance(relationships, str):+ try:+ relationships = json.loads(relationships)+ except (json.JSONDecodeError, TypeError):+ return "Error: relationships could not be parsed"+ if isinstance(relationships, dict):+ relationships = [relationships]+ if not isinstance(relationships, list):+ return "Error: relationships must be a list"+print("[DEBUG (architect_agent_create_relationship)]: Relationships: ",relationships,)for rel in relationships:+ newly_created_nodes = []+ if not isinstance(rel, dict):+ if isinstance(rel, str):+ try:+ rel = json.loads(rel)+ except (json.JSONDecodeError, TypeError):+ continue+ if not isinstance(rel, dict):+ continuesubject = rel.get("subject")predicate = rel.get("predicate")object = rel.get("object")@@ -226,10 +260,26 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):object = object.strip()def _resolve_entity(ref: str):- entity = self.entities.get(ref)+ if not is_uuid(ref) and ":" in ref:+ scout_entity = ScoutEntity(+ uuid=str(uuid.uuid4()),+ name=ref.split(":")[1],+ type=ref.split(":")[0],+ description="",+ properties={},+ )+ self.entities[scout_entity.uuid] = scout_entity+ self.architect_agent.entities.update(+ {scout_entity.uuid: scout_entity}+ )+ newly_created_nodes.append(scout_entity.model_dump(mode="json"))+ return scout_entity+ elif not is_uuid(ref):+ return None+ entity = self.entities.get(ref.lower())if entity:return entity- entity = self.architect_agent.used_entities_dict.get(ref)+ entity = self.architect_agent.used_entities_dict.get(ref.lower())if entity:return entityall_ents = list(self.entities.values()) + list(@@ -322,96 +372,105 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):# ]# )- from src.core.agents.janitor_agent import JanitorAgent-- janitor_agent = getattr(self.architect_agent, "janitor_agent", None)- janitor_agent_brain_id = getattr(- self.architect_agent, "_janitor_agent_brain_id", None- )- if janitor_agent is None or janitor_agent_brain_id != self.brain_id:- janitor_agent = JanitorAgent(- llm_small_adapter,- kg=graph_adapter,- vector_store=vector_store_adapter,- embeddings=embeddings_adapter,- database_desc=_neo4j_client.graphdb_description,- )- self.architect_agent.janitor_agent = janitor_agent- self.architect_agent._janitor_agent_brain_id = self.brain_id- start_input_tokens = janitor_agent.input_tokens- start_output_tokens = janitor_agent.output_tokens- start_cached_tokens = janitor_agent.cached_tokens- start_reasoning_tokens = janitor_agent.reasoning_tokens-- janitor_response: AtomicJanitorAgentInputOutput = (- janitor_agent.run_atomic_janitor(- input_relationships=input_rels,- text=self.text,- targeting=self.targeting,- brain_id=self.brain_id,- timeout=300,- max_retries=3,- )- )-- print(- "[DEBUG (architect_agent_create_relationship)]: Janitor response: ",- janitor_response,- )+ fixed_relationships = []+ fixed_rels_sets = set()+ janitor_response = None- janitor_token_detail = token_detail_from_token_counts(- janitor_agent.input_tokens - start_input_tokens,- janitor_agent.output_tokens - start_output_tokens,- janitor_agent.cached_tokens - start_cached_tokens,- janitor_agent.reasoning_tokens - start_reasoning_tokens,- "janitor_agent",- )- self.architect_agent.token_detail = merge_token_details(- [self.architect_agent.token_detail, janitor_token_detail]- )+ if self.mode == "granular":+ from src.core.agents.janitor_agent import JanitorAgent- required_new_nodes = getattr(janitor_response, "required_new_nodes", [])- newly_created_nodes = []- if required_new_nodes:- for node in required_new_nodes:- scout_entity = ScoutEntity(- uuid=node.uuid,- name=node.name,- type=node.type,- description=node.description,- properties=node.properties,+ janitor_agent = getattr(self.architect_agent, "janitor_agent", None)+ janitor_agent_brain_id = getattr(+ self.architect_agent, "_janitor_agent_brain_id", None+ )+ if janitor_agent is None or janitor_agent_brain_id != self.brain_id:+ janitor_agent = JanitorAgent(+ llm_small_adapter,+ kg=graph_adapter,+ vector_store=vector_store_adapter,+ embeddings=embeddings_adapter,+ database_desc=_neo4j_client.graphdb_description,+ )+ self.architect_agent.janitor_agent = janitor_agent+ self.architect_agent._janitor_agent_brain_id = self.brain_id+ start_input_tokens = janitor_agent.input_tokens+ start_output_tokens = janitor_agent.output_tokens+ start_cached_tokens = janitor_agent.cached_tokens+ start_reasoning_tokens = janitor_agent.reasoning_tokens++ janitor_response: AtomicJanitorAgentInputOutput = (+ janitor_agent.run_atomic_janitor(+ input_relationships=input_rels,+ text=self.text,+ targeting=self.targeting,+ brain_id=self.brain_id,+ timeout=300,+ max_retries=3,)- self.entities[scout_entity.uuid] = scout_entity- self.architect_agent.entities.update({scout_entity.uuid: scout_entity})- newly_created_nodes.append(scout_entity.model_dump(mode="json"))+ )- fixed_rels_sets = set()- fixed_relationships = getattr(janitor_response, "fixed_relationships", []) or []+ print(+ "[DEBUG (architect_agent_create_relationship)]: Janitor response: ",+ janitor_response,+ )- if fixed_relationships:- fixed_rels_sets = set(- frozenset((fr.tip.uuid, fr.tail.uuid, fr.name))- for fr in fixed_relationships+ janitor_token_detail = token_detail_from_token_counts(+ janitor_agent.input_tokens - start_input_tokens,+ janitor_agent.output_tokens - start_output_tokens,+ janitor_agent.cached_tokens - start_cached_tokens,+ janitor_agent.reasoning_tokens - start_reasoning_tokens,+ "janitor_agent",)- output_rels.extend(- [- ArchitectAgentRelationship(- flow_key=rel_key,- tip=rel.tip,- name=rel.name,- description=rel.description,- tail=rel.tail,- properties=getattr(rel, "properties", {}),- **(- {"amount": getattr(rel, "amount", None)}- if getattr(rel, "amount", None)- else {}- ),+ self.architect_agent.token_detail = merge_token_details(+ [self.architect_agent.token_detail, janitor_token_detail]+ )++ required_new_nodes = getattr(janitor_response, "required_new_nodes", [])++ if required_new_nodes:+ for node in required_new_nodes:+ scout_entity = ScoutEntity(+ uuid=node.uuid,+ name=node.name,+ type=node.type,+ description=node.description,+ properties=node.properties,)- for rel in fixed_relationships- ]+ self.entities[scout_entity.uuid] = scout_entity+ self.architect_agent.entities.update(+ {scout_entity.uuid: scout_entity}+ )+ newly_created_nodes.append(scout_entity.model_dump(mode="json"))++ fixed_rels_sets = set()+ fixed_relationships = (+ getattr(janitor_response, "fixed_relationships", []) or [])+ if fixed_relationships:+ fixed_rels_sets = set(+ frozenset((fr.tip.uuid, fr.tail.uuid, fr.name))+ for fr in fixed_relationships+ )+ output_rels.extend(+ [+ ArchitectAgentRelationship(+ flow_key=rel_key,+ tip=rel.tip,+ name=rel.name,+ description=rel.description,+ tail=rel.tail,+ properties=getattr(rel, "properties", {}),+ **(+ {"amount": getattr(rel, "amount", None)}+ if getattr(rel, "amount", None)+ else {}+ ),+ )+ for rel in fixed_relationships+ ]+ )+# Batch embed texts for similarity comparisontexts_to_embed = set()for rel in input_rels:@@ -496,7 +555,10 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):for rel in output_relsif isinstance(rel, ArchitectAgentRelationship)]-+ print(+ "[DEBUG (architect_agent_create_relationship)]: Relationships data: ",+ relationships_data,+ )if relationships_data:from src.workers.tasks.ingestion import process_architect_relationshipsfrom src.lib.redis.client import _redis_client@@ -527,7 +589,6 @@ class ArchitectAgentCreateRelationshipTool(BaseTool):session_id = getattr(self.architect_agent, "session_id", None)if session_id and output_rels:from src.lib.redis.client import _redis_client- import jsonrelationships_data = [rel.model_dump(mode="json")diff --git a/src/core/saving/auto_kg.py b/src/core/saving/auto_kg.pyindex 7ba752b..f7eef30 100644--- a/src/core/saving/auto_kg.py+++ b/src/core/saving/auto_kg.py@@ -3,7 +3,7 @@ File: /auto_kg.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:43:59 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -81,117 +81,139 @@ def _enrich_kg_impl(input: str, targeting, brain_id: str, ingestion_session_id:ingestion_manager=ingestion_manager,)- token_details = []- print(f"[DEBUG (ingestion_session_id)]: {ingestion_session_id}")+ if config.pipeline_mode == "lightweight":+ print("[DEBUG (enrich_kg_from_input)]: Lightweight pipeline mode selected")- entities = scout_agent.run(- input,- targeting=targeting,- brain_id=brain_id,- ingestion_session_id=ingestion_session_id,- )- token_details.append(- token_detail_from_token_counts(- scout_agent.input_tokens,- scout_agent.output_tokens,- scout_agent.cached_tokens,- scout_agent.reasoning_tokens,- "scout_agent",+ entities = scout_agent.run(+ input,+ targeting=targeting,+ brain_id=brain_id,+ ingestion_session_id=ingestion_session_id,+ mode="coarse",+ )+ print("[DEBUG (initial_scout_entities)]: ", entities.entities)+ architect_agent.run_tooler(+ input,+ entities.entities,+ targeting=targeting,+ brain_id=brain_id,+ timeout=20000,+ ingestion_session_id=ingestion_session_id,+ mode="coarse",)- )- print("[DEBUG (initial_scout_entities)]: ", entities)+ return- architect_agent.run_tooler(- input,- entities.entities,- targeting=targeting,- brain_id=brain_id,- timeout=20000,- ingestion_session_id=ingestion_session_id,- )- token_details.append(- token_detail_from_token_counts(- architect_agent.input_tokens,- architect_agent.output_tokens,- architect_agent.cached_tokens,- architect_agent.reasoning_tokens,- "architect_agent",- )- )+ if config.pipeline_mode == "accurate":+ token_details = []+ print(f"[DEBUG (ingestion_session_id)]: {ingestion_session_id}")- if config.run_graph_consolidator and architect_agent.session_id:- from src.lib.redis.client import _redis_client- import time+ entities = scout_agent.run(+ input,+ targeting=targeting,+ brain_id=brain_id,+ ingestion_session_id=ingestion_session_id,+ )+ token_details.append(+ token_detail_from_token_counts(+ scout_agent.input_tokens,+ scout_agent.output_tokens,+ scout_agent.cached_tokens,+ scout_agent.reasoning_tokens,+ "scout_agent",+ )+ )- print(- f"[DEBUG (enrich_kg_from_input)]: Waiting for async tasks to complete for session {architect_agent.session_id}"+ architect_agent.run_tooler(+ input,+ entities.entities,+ targeting=targeting,+ brain_id=brain_id,+ timeout=20000,+ ingestion_session_id=ingestion_session_id,+ )+ token_details.append(+ token_detail_from_token_counts(+ architect_agent.input_tokens,+ architect_agent.output_tokens,+ architect_agent.cached_tokens,+ architect_agent.reasoning_tokens,+ "architect_agent",+ ))- max_wait_time = 300- check_interval = 2- elapsed_time = 0+ if config.run_graph_consolidator and architect_agent.session_id:+ from src.lib.redis.client import _redis_client+ import time- while elapsed_time < max_wait_time:- pending_count = _redis_client.client.get(- f"{brain_id}:session:{architect_agent.session_id}:pending_tasks"+ print(+ f"[DEBUG (enrich_kg_from_input)]: Waiting for async tasks to complete for session {architect_agent.session_id}")- if pending_count is None or int(pending_count) == 0:+ max_wait_time = 300+ check_interval = 2+ elapsed_time = 0++ while elapsed_time < max_wait_time:+ pending_count = _redis_client.client.get(+ f"{brain_id}:session:{architect_agent.session_id}:pending_tasks"+ )++ if pending_count is None or int(pending_count) == 0:+ print(+ f"[DEBUG (enrich_kg_from_input)]: All async tasks completed after {elapsed_time}s"+ )+ break++ print(+ f"[DEBUG (enrich_kg_from_input)]: {pending_count} tasks still pending, waiting..."+ )+ time.sleep(check_interval)+ elapsed_time += check_interval+ else:print(- f"[DEBUG (enrich_kg_from_input)]: All async tasks completed after {elapsed_time}s"+ f"[DEBUG (enrich_kg_from_input)]: Timeout waiting for tasks to complete after {max_wait_time}s")- breakprint(- f"[DEBUG (enrich_kg_from_input)]: {pending_count} tasks still pending, waiting..."+ "[DEBUG (consolidate_graph)]: Consolidating graph with ",+ len(architect_agent.relationships_set),+ " relationships",+ )++ from src.workers.tasks.ingestion import consolidate_graph_async++ task_result = consolidate_graph_async.delay(+ session_id=architect_agent.session_id,+ brain_id=brain_id,+ ingestion_session_id=ingestion_session_id,)- time.sleep(check_interval)- elapsed_time += check_interval- else:print(- f"[DEBUG (enrich_kg_from_input)]: Timeout waiting for tasks to complete after {max_wait_time}s"+ f"[DEBUG (enrich_kg_from_input)]: Consolidation task {task_result.id} queued")- print(- "[DEBUG (consolidate_graph)]: Consolidating graph with ",- len(architect_agent.relationships_set),- " relationships",+ token_details = merge_token_details(+ [+ scout_agent.token_detail,+ architect_agent.token_detail,+ ])- from src.workers.tasks.ingestion import consolidate_graph_async-- task_result = consolidate_graph_async.delay(- session_id=architect_agent.session_id,- brain_id=brain_id,- ingestion_session_id=ingestion_session_id,+ print("-----------------------------------")+ print(+ f"> Input tokens: {token_details.input.total} -> ${token_details.input.total * config.pricing.input_token_price}")print(- f"[DEBUG (enrich_kg_from_input)]: Consolidation task {task_result.id} queued"+ f"> Output tokens: {token_details.output.total} -> ${token_details.output.total * config.pricing.output_token_price}")-- token_details = merge_token_details(- [- scout_agent.token_detail,- architect_agent.token_detail,- ]- )-- print("-----------------------------------")- print(- f"> Input tokens: {token_details.input.total} -> ${token_details.input.total * config.pricing.input_token_price}"- )- print(- f"> Output tokens: {token_details.output.total} -> ${token_details.output.total * config.pricing.output_token_price}"- )- print(- f"> Cost -> ${token_details.input.total * config.pricing.input_token_price + token_details.output.total * config.pricing.output_token_price} for {len(input)} characters"- )- print(- f"> Cost/Character -> ${((token_details.input.total * config.pricing.input_token_price + token_details.output.total * config.pricing.output_token_price) / len(input)):.12f}"- )- print("> Token details: ", token_details.model_dump_json(indent=2))- print("-----------------------------------")+ print(+ f"> Cost -> ${token_details.input.total * config.pricing.input_token_price + token_details.output.total * config.pricing.output_token_price} for {len(input)} characters"+ )+ print(+ f"> Cost/Character -> ${((token_details.input.total * config.pricing.input_token_price + token_details.output.total * config.pricing.output_token_price) / len(input)):.12f}"+ )+ print("> Token details: ", token_details.model_dump_json(indent=2))+ print("-----------------------------------")try:from langchain_core.tracers.langchain import wait_for_all_tracersdiff --git a/src/lib/embeddings/local.py b/src/lib/embeddings/local.pynew file mode 100644index 0000000..702b780--- /dev/null+++ b/src/lib/embeddings/local.py@@ -0,0 +1,52 @@+"""+File: /local.py+Project: embeddings+Created Date: Sunday February 22nd 2026+Author: Christian Nonis <[email protected]>+-----+Last Modified: Sunday February 22nd 2026 5:24:22 pm+Modified By: Christian Nonis <[email protected]>+-----+"""++from sentence_transformers import SentenceTransformer++from src.adapters.interfaces.embeddings import EmbeddingsClient+from src.config import config++E5_PREFIX = "passage: "++_model = SentenceTransformer(config.embeddings.local_model)+++class EmbeddingError(Exception):+ pass+++class LocalEmbeddingsClient(EmbeddingsClient):+ def __init__(self):+ self.model = _model++ def _prefix(self, text: str) -> str:+ if text.strip().lower().startswith(E5_PREFIX.strip().lower()):+ return text+ return E5_PREFIX + text++ def embed_text(self, text: str) -> list[float]:+ try:+ prefixed = self._prefix(text)+ embedding = self.model.encode(prefixed, convert_to_numpy=True)+ return embedding.tolist()+ except Exception as e:+ raise EmbeddingError(f"Embedding failed: {e}") from e++ def embed_texts(self, texts: list[str]) -> list[list[float]]:+ try:+ prefixed = [self._prefix(t) for t in texts]+ embeddings = self.model.encode(prefixed, convert_to_numpy=True)+ return embeddings.tolist()+ except Exception as e:+ raise EmbeddingError(f"Embedding failed: {e}") from e+++_embeddings_local_client = LocalEmbeddingsClient()diff --git a/src/lib/llm/client_ollama.py b/src/lib/llm/client_ollama.pynew file mode 100644index 0000000..cd6328f--- /dev/null+++ b/src/lib/llm/client_ollama.py@@ -0,0 +1,161 @@+"""+File: /client_ollama.py+Project: llm+Created Date: Sunday February 22nd 2026+Author: Christian Nonis <[email protected]>+-----+Last Modified: Sunday February 22nd 2026 5:22:16 pm+Modified By: Christian Nonis <[email protected]>+-----+"""++import json+import logging+from typing import Any++from openai import OpenAI+from langchain_core.outputs import ChatResult+from langchain_openai import ChatOpenAI++from src.adapters.interfaces.llm import LLM+from src.config import config++logger = logging.getLogger(__name__)+++def _ollama_base_url():+ return f"http://{config.ollama.host}:{config.ollama.port}/v1"+++class ChatOllamaWithThinking(ChatOpenAI):+ def __init__(self, **kwargs: Any):+ kwargs.setdefault("model_kwargs", {})+ kwargs["extra_body"] = kwargs.get("extra_body") or {}+ super().__init__(**kwargs)++ def _create_chat_result(+ self,+ response: Any,+ generation_info: dict | None = None,+ ) -> ChatResult:+ result = super()._create_chat_result(response, generation_info)+ response_dict = (+ response if isinstance(response, dict) else response.model_dump()+ )+ for i, choice in enumerate(response_dict.get("choices") or []):+ msg_dict = choice.get("message") or {}+ if "thinking" in msg_dict and i < len(result.generations):+ thinking = msg_dict["thinking"]+ result.generations[i].message.additional_kwargs["thinking"] = thinking+ if thinking:+ logger.info("thinking: %s", thinking)+ return result+++class LLMClientLarge(LLM):+ def __init__(self):+ self.model = config.ollama.llm_large_model+ self.client = OpenAI(+ base_url=f"{_ollama_base_url()}/",+ api_key="ollama",+ )+ self.langchain_model = ChatOllamaWithThinking(+ base_url=f"{_ollama_base_url()}/",+ api_key="ollama",+ model=self.model,+ )++ def generate_text(self, prompt: str, max_new_tokens: int = None) -> str:+ response = self.client.chat.completions.create(+ model=self.model,+ messages=[{"role": "user", "content": prompt}],+ **({"max_tokens": max_new_tokens} if max_new_tokens else {}),+ )+ return response.choices[0].message.content++ def generate_json(+ self, prompt: str, max_new_tokens: int = None, max_retries: int = 3+ ) -> dict:+ response = None+ while max_retries > 0 and response is None:+ try:+ _response = self.client.chat.completions.create(+ model=self.model,+ messages=[{"role": "user", "content": prompt}],+ **({"max_tokens": max_new_tokens} if max_new_tokens else {}),+ response_format={"type": "json_object"},+ )+ _response = (+ _response.choices[0].message.content.strip("```json").strip("```")+ )+ response = json.loads(_response)+ except Exception as e:+ max_retries -= 1+ if max_retries <= 0:+ raise e+ return response+++_llm_large_client = LLMClientLarge()+++class LLMClientSmall(LLM):+ def __init__(self):+ self.model = config.ollama.llm_small_model+ self.client = OpenAI(+ base_url=f"{_ollama_base_url()}/",+ api_key="ollama",+ )+ self.langchain_model = ChatOllamaWithThinking(+ base_url=f"{_ollama_base_url()}/",+ api_key="ollama",+ model=self.model,+ )+ self.default_timeout = 120++ def generate_text(+ self, prompt: str, max_new_tokens: int = None, timeout: int = None+ ) -> str:+ if not prompt or len(prompt.strip()) == 0:+ return "Input prompt is empty"+ timeout = timeout or self.default_timeout+ response = self.client.chat.completions.create(+ model=self.model,+ messages=[{"role": "user", "content": prompt}],+ **({"max_tokens": max_new_tokens} if max_new_tokens else {}),+ timeout=timeout,+ )+ return response.choices[0].message.content++ def generate_json(+ self,+ prompt: str,+ max_new_tokens: int = None,+ max_retries: int = 3,+ timeout: int = None,+ ) -> dict:+ timeout = timeout or self.default_timeout+ response = None+ last_error = None+ for _ in range(max_retries):+ try:+ _response = self.client.chat.completions.create(+ model=self.model,+ messages=[{"role": "user", "content": prompt}],+ **({"max_tokens": max_new_tokens} if max_new_tokens else {}),+ response_format={"type": "json_object"},+ timeout=timeout,+ )+ raw = (+ _response.choices[0]+ .message.content.strip("```json")+ .strip("```")+ .strip()+ )+ return json.loads(raw)+ except (json.JSONDecodeError, Exception) as e:+ last_error = e+ raise last_error+++_llm_small_client = LLMClientSmall()diff --git a/src/lib/llm/client_small.py b/src/lib/llm/client_small.pyindex b220475..95a45ed 100644--- a/src/lib/llm/client_small.py+++ b/src/lib/llm/client_small.py@@ -3,7 +3,7 @@ File: /client_small.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Tuesday December 23rd 2025 9:24:20 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -91,19 +91,21 @@ class LLMClientSmall(LLM):os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = (config.gcp.credentials_path)- self._langchain_model = ChatVertexAI(- model_name=self.model,- project=config.gcp.project_id,- max_retries=5,- location="global",- request_timeout=120,- streaming=False,- wait_exponential_kwargs={+ kwargs = {+ "model_name": self.model,+ "project": config.gcp.project_id,+ "max_retries": 5,+ "location": "global",+ "request_timeout": 120,+ "streaming": False,+ "wait_exponential_kwargs": {"multiplier": 1,"min": 2,"max": 60,},- )+ }+ kwargs["max_output_tokens"] = 65000+ self._langchain_model = ChatVertexAI(**kwargs)return self._langchain_modeldef generate_text(diff --git a/src/lib/qdrant/__init__.py b/src/lib/qdrant/__init__.pynew file mode 100644index 0000000..a12ada6--- /dev/null+++ b/src/lib/qdrant/__init__.py@@ -0,0 +1,11 @@+"""+File: /__init__.py+Project: qdrant+Created Date: Sunday February 22nd 2026+Author: Christian Nonis <[email protected]>+-----+Last Modified: Sunday February 22nd 2026 6:10:45 pm+Modified By: Christian Nonis <[email protected]>+-----+"""+diff --git a/src/services/api/middlewares/brains.py b/src/services/api/middlewares/brains.pyindex 11f7d23..6edbaf2 100644--- a/src/services/api/middlewares/brains.py+++ b/src/services/api/middlewares/brains.py@@ -8,9 +8,14 @@ Modified By: Christian Nonis <[email protected]>-----"""+import jsonimport os+from email import policy+from email.parser import BytesParser+from fastapi import Requestfrom fastapi.responses import JSONResponse+from pymongo.errors import OperationFailure, ServerSelectionTimeoutErrorfrom starlette.middleware.base import BaseHTTPMiddlewarefrom starlette import status@@ -18,6 +23,25 @@ from src.services.data.main import data_adapterfrom src.services.kg_agent.main import cache_adapter+def _brain_id_from_multipart(body: bytes, content_type: str) -> str | None:+ try:+ message_bytes = (+ f"Content-Type: {content_type}\r\n\r\n".encode("utf-8", errors="replace")+ + body+ )+ msg = BytesParser(policy=policy.HTTP).parsebytes(message_bytes)+ for part in msg.iter_parts():+ if part.get_content_disposition() != "form-data":+ continue+ name = part.get_param("name", header="content-disposition")+ if name == "brain_id":+ raw = part.get_content_text()+ return raw.rstrip() if raw else None+ except Exception:+ pass+ return None++class BrainMiddleware(BaseHTTPMiddleware):async def dispatch(self, request: Request, call_next):async def _get_brain_id():@@ -34,11 +58,10 @@ class BrainMiddleware(BaseHTTPMiddleware):brain_id = brain_id.rstrip()if brain_id is None and request.method in ("POST", "PUT", "PATCH"):+ content_type = request.headers.get("content-type", "") or ""body = await request.body()- if body:+ if "application/json" in content_type and body:try:- import json-body_data = json.loads(body)if isinstance(body_data, dict):brain_id = body_data.get("brain_id")@@ -46,13 +69,20 @@ class BrainMiddleware(BaseHTTPMiddleware):brain_id = brain_id.rstrip()except (json.JSONDecodeError, ValueError):pass+ elif "multipart/form-data" in content_type and body:+ form_brain_id = _brain_id_from_multipart(body, content_type)+ if form_brain_id:+ brain_id = form_brain_id- if body:+ body_sent = [False]- async def receive():- return {"type": "http.request", "body": body}+ async def receive():+ if not body_sent[0]:+ body_sent[0] = True+ return {"type": "http.request", "body": body, "more_body": False}+ return {"type": "http.request", "body": b"", "more_body": False}- request._receive = receive+ request._receive = receiverequest.state.brain_id = brain_idreturn brain_id@@ -78,42 +108,50 @@ class BrainMiddleware(BaseHTTPMiddleware):content={"detail": "Brain ID must be alphanumeric."},)- # Brains logic -------------------------------------------- if brain_id and not cached_brain_id:- stored_brain = data_adapter.get_brain(name_key=brain_id)-- request.state.brain_id = brain_id-- if not stored_brain and brain_creation_allowed:- new_brain = data_adapter.create_brain(name_key=brain_id)- cache_adapter.set(- key=f"brain:{brain_id}",- value=new_brain.id,- brain_id="system",- )- elif stored_brain:- cache_adapter.set(- key=f"brain:{brain_id}",- value=stored_brain.id,- brain_id="system",- )- elif not brain_id and default_brain_fallback:- default_brain = data_adapter.get_brain(name_key="default")- if not default_brain:- default_brain = data_adapter.create_brain(name_key="default")- cache_adapter.set(- key="brain:default",- value=default_brain.id,- brain_id="system",- )- request.state.brain_id = "default"- else:- cache_adapter.set(- key="brain:default",- value=default_brain.id,- brain_id="system",- )- request.state.brain_id = "default"+ try:+ if brain_id and not cached_brain_id:+ stored_brain = data_adapter.get_brain(name_key=brain_id)++ request.state.brain_id = brain_id++ if not stored_brain and brain_creation_allowed:+ new_brain = data_adapter.create_brain(name_key=brain_id)+ cache_adapter.set(+ key=f"brain:{brain_id}",+ value=new_brain.id,+ brain_id="system",+ )+ elif stored_brain:+ cache_adapter.set(+ key=f"brain:{brain_id}",+ value=stored_brain.id,+ brain_id="system",+ )+ elif not brain_id and default_brain_fallback:+ default_brain = data_adapter.get_brain(name_key="default")+ if not default_brain:+ default_brain = data_adapter.create_brain(name_key="default")+ cache_adapter.set(+ key="brain:default",+ value=default_brain.id,+ brain_id="system",+ )+ request.state.brain_id = "default"+ else:+ cache_adapter.set(+ key="brain:default",+ value=default_brain.id,+ brain_id="system",+ )+ request.state.brain_id = "default"+ except (OperationFailure, ServerSelectionTimeoutError) as e:+ return JSONResponse(+ status_code=status.HTTP_503_SERVICE_UNAVAILABLE,+ content={+ "detail": "Database unavailable. Check MongoDB connection and credentials (e.g. MONGO_* or MONGO_CONNECTION_STRING).",+ "error": str(e),+ },+ )if getattr(request.state, "brain_id", None) is None:return JSONResponse(diff --git a/src/services/api/routes/ingest.py b/src/services/api/routes/ingest.pyindex 44f13bf..a146803 100644--- a/src/services/api/routes/ingest.py+++ b/src/services/api/routes/ingest.py@@ -3,21 +3,21 @@ File: /ingest.pyCreated Date: Sunday October 19th 2025Author: Christian Nonis <[email protected]>------Last Modified: Monday January 5th 2026 7:57:27 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""-import jsonimport asyncio-import requests+import base64+import jsonfrom uuid import uuid4-from fastapi import APIRouter, HTTPException, Request-from typing import Literal-from typing_extensions import Annotated-from fastapi import File, Form, UploadFile-from starlette.responses import JSONResponse++import requestsfrom celery.exceptions import OperationalError+from fastapi import APIRouter, File, Form, HTTPException, Request, UploadFile+from starlette.responses import JSONResponse+from typing_extensions import Annotatedfrom src.config import configfrom src.services.api.constants.requests import (@@ -26,6 +26,7 @@ from src.services.api.constants.requests import ()from src.services.input.agents import cache_adapterfrom src.workers.tasks.ingestion import ingest_data as ingest_data_task+from src.workers.tasks.ingestion import ingest_file as ingest_file_taskfrom src.workers.tasks.ingestion import (ingest_structured_data as ingest_structured_data_task,)@@ -111,35 +112,61 @@ async def ingest_file(task = str(uuid4())- cache_adapter.set(- key=f"task:{task}",- value=json.dumps({"status": "queued", "task_id": task}),- brain_id=brain_id,- expires_in=3600 * 24 * 7,- )-try:file.file.seek(0)- # We are forwarding to the DocParser API to convert files into markdown text- # and by forwarding the webhook (our app host) and the task identifier,- # we can be called back from the DocParser API to start the ingestion process- # with the created markdown text.- response = requests.post(- f"{config.docparser_endpoint}/ingest",- files={"file": (file.filename or "file", file.file, file.content_type)},- data={- "brain_id": brain_id,- "webhook_callback": config.app_host,- "identifier": task,- },- headers={"Authorization": f"Bearer {config.docparser_token}"},- )- if response.status_code != 200:- raise HTTPException(status_code=500, detail=response.text)+ if config.ocr_mode == "docling":+ content_b64 = base64.b64encode(file.file.read()).decode("ascii")+ filename = file.filename or "file"+ for attempt in range(MAX_TASK_RETRIES):+ try:+ ingest_file_task.apply_async(+ args=[content_b64, filename, brain_id],+ task_id=task,+ )+ break+ except OperationalError:+ if attempt == MAX_TASK_RETRIES - 1:+ raise HTTPException(+ status_code=503, detail="Task queue unavailable"+ )+ await asyncio.sleep(RETRY_DELAY_BASE * (attempt + 1))+ cache_adapter.set(+ key=f"task:{task}",+ value=json.dumps({"status": "queued", "task_id": task}),+ brain_id=brain_id,+ expires_in=3600 * 24 * 7,+ )+ response_content = {+ "message": "File ingested successfully",+ "task_id": task,+ }+ else:+ cache_adapter.set(+ key=f"task:{task}",+ value=json.dumps({"status": "queued", "task_id": task}),+ brain_id=brain_id,+ expires_in=3600 * 24 * 7,+ )+ response = requests.post(+ f"{config.docparser_endpoint}/ingest",+ files={"file": (file.filename or "file", file.file, file.content_type)},+ data={+ "brain_id": brain_id,+ "webhook_callback": config.app_host,+ "identifier": task,+ },+ headers={"Authorization": f"Bearer {config.docparser_token}"},+ )+ if response.status_code != 200:+ raise HTTPException(status_code=500, detail=response.text)+ response_content = {+ "message": "File ingested successfully",+ "task_id": task,+ }+ except HTTPException:+ raiseexcept Exception as e:raise HTTPException(status_code=500, detail=str(e))- return JSONResponse(- content={"message": "File ingested successfully", "task_id": task}- )+ return JSONResponse(content=response_content)diff --git a/src/services/input/agents.py b/src/services/input/agents.pyindex 841f182..3a2b7f2 100644--- a/src/services/input/agents.py+++ b/src/services/input/agents.py@@ -3,29 +3,49 @@ File: /agents.pyCreated Date: Sunday December 21st 2025Author: Christian Nonis <[email protected]>------Last Modified: Tuesday December 23rd 2025 9:24:20 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""from src.adapters.cache import CacheAdapter-from src.adapters.embeddings import EmbeddingsAdapter+from src.adapters.embeddings import EmbeddingsAdapter, VectorStoreAdapterfrom src.adapters.graph import GraphAdapterfrom src.adapters.llm import LLMAdapter+from src.config import config+from src.lib.milvus.client import _milvus_client+from src.lib.neo4j.client import _neo4j_client+from src.lib.redis.client import _redis_client-from src.adapters.embeddings import VectorStoreAdapter+_MODES = ("local", "remote")-from src.lib.llm.client_small import _llm_small_client-from src.lib.redis.client import _redis_client-from src.lib.neo4j.client import _neo4j_client-from src.lib.embeddings.client import _embeddings_client-from src.lib.embeddings.client_small import _embeddings_small_client-from src.lib.milvus.client import _milvus_client++def _require_mode():+ if config.models_mode not in _MODES:+ raise ValueError(f"Invalid models mode: {config.models_mode}")+ return config.models_mode == "local"-# Initialze the adapters ================================-llm_small_adapter = LLMAdapter()-llm_small_adapter.add_client(_llm_small_client)+_is_local = _require_mode()++if _is_local:+ from src.lib.llm.client_ollama import _llm_large_client, _llm_small_client++ _llm_small = LLMAdapter()+ _llm_small.add_client(_llm_small_client)+ _llm_large = LLMAdapter()+ _llm_large.add_client(_llm_large_client)+else:+ from src.lib.llm.client_large import _llm_large_client+ from src.lib.llm.client_small import _llm_small_client++ _llm_small = LLMAdapter()+ _llm_small.add_client(_llm_small_client)+ _llm_large = LLMAdapter()+ _llm_large.add_client(_llm_large_client)++llm_small_adapter = _llm_small+llm_large_adapter = _llm_largecache_adapter = CacheAdapter()cache_adapter.add_client(_redis_client)@@ -33,11 +53,25 @@ cache_adapter.add_client(_redis_client)graph_adapter = GraphAdapter()graph_adapter.add_client(_neo4j_client)-embeddings_adapter = EmbeddingsAdapter()-embeddings_adapter.add_client(_embeddings_client)+if _is_local:+ from src.lib.embeddings.local import _embeddings_local_client+ from src.lib.embeddings.client_small import _embeddings_small_client++ _embeddings_primary = EmbeddingsAdapter()+ _embeddings_primary.add_client(_embeddings_local_client)+ _embeddings_small = EmbeddingsAdapter()+ _embeddings_small.add_client(_embeddings_small_client)+else:+ from src.lib.embeddings.client import _embeddings_client+ from src.lib.embeddings.client_small import _embeddings_small_client++ _embeddings_primary = EmbeddingsAdapter()+ _embeddings_primary.add_client(_embeddings_client)+ _embeddings_small = EmbeddingsAdapter()+ _embeddings_small.add_client(_embeddings_small_client)-embeddings_small_adapter = EmbeddingsAdapter()-embeddings_small_adapter.add_client(_embeddings_small_client)+embeddings_adapter = _embeddings_primary+embeddings_small_adapter = _embeddings_smallvector_store_adapter = VectorStoreAdapter()vector_store_adapter.add_client(_milvus_client)diff --git a/src/services/kg_agent/main.py b/src/services/kg_agent/main.pyindex 43ed062..f36524c 100644--- a/src/services/kg_agent/main.py+++ b/src/services/kg_agent/main.py@@ -8,21 +8,39 @@ Modified By: the developer formerly known as Christian Nonis at <alch.infoemail@-----"""+from src.adapters.cache import CacheAdapterfrom src.adapters.embeddings import EmbeddingsAdapter, VectorStoreAdapterfrom src.adapters.graph import GraphAdapterfrom src.adapters.llm import LLMAdapter+from src.config import configfrom src.core.agents.kg_agent import KGAgent--from src.lib.llm.client_large import _llm_large_client-from src.lib.redis.client import _redis_client-from src.adapters.cache import CacheAdapter-from src.lib.neo4j.client import _neo4j_client-from src.lib.embeddings.client import _embeddings_clientfrom src.lib.milvus.client import _milvus_client+from src.lib.neo4j.client import _neo4j_client+from src.lib.redis.client import _redis_client++_MODES = ("local", "remote")+-# Initialze the adapters-llm_large_adapter = LLMAdapter()-llm_large_adapter.add_client(_llm_large_client)+def _require_mode():+ if config.models_mode not in _MODES:+ raise ValueError(f"Invalid models mode: {config.models_mode}")+ return config.models_mode == "local"+++_is_local = _require_mode()++if _is_local:+ from src.lib.llm.client_ollama import _llm_large_client++ _llm_large = LLMAdapter()+ _llm_large.add_client(_llm_large_client)+else:+ from src.lib.llm.client_large import _llm_large_client++ _llm_large = LLMAdapter()+ _llm_large.add_client(_llm_large_client)++llm_large_adapter = _llm_largecache_adapter = CacheAdapter()cache_adapter.add_client(_redis_client)@@ -30,18 +48,27 @@ cache_adapter.add_client(_redis_client)graph_adapter = GraphAdapter()graph_adapter.add_client(_neo4j_client)-embeddings_adapter = EmbeddingsAdapter()-embeddings_adapter.add_client(_embeddings_client)+if _is_local:+ from src.lib.embeddings.local import _embeddings_local_client++ _embeddings = EmbeddingsAdapter()+ _embeddings.add_client(_embeddings_local_client)+else:+ from src.lib.embeddings.client import _embeddings_client++ _embeddings = EmbeddingsAdapter()+ _embeddings.add_client(_embeddings_client)++embeddings_adapter = _embeddingsvector_store_adapter = VectorStoreAdapter()vector_store_adapter.add_client(_milvus_client)-# Initialize the knowledge graph agentkg_agent = KGAgent(llm_large_adapter,cache_adapter,kg=graph_adapter,vector_store=vector_store_adapter,embeddings=embeddings_adapter,- database_desc=_neo4j_client.graphdb_description,+ database_desc=graph_adapter.graphdb_description,)diff --git a/src/utils/cleanup.py b/src/utils/cleanup.pyindex 4e6ef6c..e1a697e 100644--- a/src/utils/cleanup.py+++ b/src/utils/cleanup.py@@ -4,11 +4,52 @@ Project: utilsCreated Date: Saturday January 31st 2026Author: Christian Nonis <[email protected]>------Last Modified: Saturday January 31st 2026 9:44:03 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""+import json+import re+++def _repair_array_json(s: str) -> str:+ s = s.replace(',"{', ",{")+ s = re.sub(r'\}{2,}\s*,\s*"', '},"', s)+ return s+++def _repair_trailing_commas(s: str) -> str:+ s = re.sub(r',\s*]', ']', s)+ s = re.sub(r',\s*}', '}', s)+ return s+++def _extract_json_array_after_key(text: str, key: str):+ pattern = re.escape(key) + r"\s*:\s*\["+ match = re.search(pattern, text)+ if not match:+ return None+ start = match.end() - 1+ depth = 0+ i = start+ while i < len(text):+ if text[i] == "[":+ depth += 1+ elif text[i] == "]":+ depth -= 1+ if depth == 0:+ substring = text[start : i + 1]+ try:+ return json.loads(substring)+ except Exception:+ try:+ return json.loads(_repair_array_json(substring))+ except Exception:+ return None+ i += 1+ return None+def strip_properties(objs: list[dict], pop_also: list[str] = []) -> list[dict]:cleaned_objs = []@@ -57,3 +98,96 @@ def strip_properties(objs: list[dict], pop_also: list[str] = []) -> list[dict]:cleaned_objs.append(cleaned_obj)return cleaned_objs+++def _last_json_object(text: str) -> dict:+ if not text or "{" not in text:+ return {}+ start = text.rfind("{")+ depth = 0+ for i in range(start, len(text)):+ if text[i] == "{":+ depth += 1+ elif text[i] == "}":+ depth -= 1+ if depth == 0:+ try:+ return json.loads(text[start : i + 1])+ except Exception:+ try:+ return json.loads(_repair_array_json(text[start : i + 1]))+ except Exception:+ pass+ return {}+ return {}+++def strip_json(text: str) -> dict:+ if not text:+ return {}+ if not isinstance(text, str):+ return {}+ raw = text.strip().replace("```json", "").replace("```", "").strip()+ try:+ parsed = json.loads(raw)+ if isinstance(parsed, dict):+ return parsed+ if isinstance(parsed, list):+ return {"entities": parsed}+ except Exception:+ pass+ try:+ repaired = _repair_array_json(raw)+ parsed = json.loads(repaired)+ if isinstance(parsed, dict):+ return parsed+ if isinstance(parsed, list):+ return {"entities": parsed}+ except Exception:+ pass+ try:+ repaired = _repair_trailing_commas(raw)+ parsed = json.loads(repaired)+ if isinstance(parsed, dict):+ return parsed+ if isinstance(parsed, list):+ return {"entities": parsed}+ except Exception:+ pass+ if raw.strip().startswith("["):+ depth = 0+ start = raw.index("[")+ end = start+ for i in range(start, len(raw)):+ if raw[i] == "[":+ depth += 1+ elif raw[i] == "]":+ depth -= 1+ if depth == 0:+ end = i + 1+ break+ if end > start:+ substring = raw[start:end]+ for repair in (lambda s: s, _repair_trailing_commas, _repair_array_json):+ try:+ parsed = json.loads(repair(substring))+ if isinstance(parsed, list):+ return {"entities": parsed}+ except Exception:+ continue+ obj_match = re.search(r"\{.*\}", raw, flags=re.DOTALL)+ if obj_match:+ try:+ return json.loads(obj_match.group(0))+ except Exception:+ try:+ return json.loads(_repair_array_json(obj_match.group(0)))+ except Exception:+ pass+ entities = _extract_json_array_after_key(raw, "entities")+ if entities is not None:+ return {"entities": entities}+ last = _last_json_object(raw)+ if last and isinstance(last.get("entities"), list):+ return last+ return {}diff --git a/src/utils/serialization/data.py b/src/utils/serialization/data.pyindex 5c86eab..acd288c 100644--- a/src/utils/serialization/data.py+++ b/src/utils/serialization/data.py@@ -3,7 +3,7 @@ File: /data.pyCreated Date: Friday October 24th 2025Author: Christian Nonis <[email protected]>------Last Modified: Friday October 24th 2025 6:52:20 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""@@ -11,6 +11,7 @@ Modified By: Christian Nonis <[email protected]>import jsonimport refrom typing import Any+import uuiddef str_to_json(text: str | None, empty_fallback: bool = False) -> list[str]:@@ -58,3 +59,13 @@ def always_dict(obj: Any) -> dict:print(f"Invalid JSON string: {obj}")return {}return {}++def is_uuid(text: str) -> bool:+ """+ Check if a string is a valid UUID.+ """+ try:+ uuid.UUID(text.strip())+ return True+ except Exception:+ return False\ No newline at end of filediff --git a/src/workers/app.py b/src/workers/app.pyindex ad1f254..b79db0c 100644--- a/src/workers/app.py+++ b/src/workers/app.py@@ -3,12 +3,13 @@ File: /celery.pyCreated Date: Sunday October 19th 2025Author: Christian Nonis <[email protected]>------Last Modified: Sunday October 19th 2025 9:16:36 am+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""import os+import warningsfrom pathlib import Pathimport dotenv@@ -16,6 +17,12 @@ import dotenv_project_root = Path(__file__).resolve().parent.parent.parentdotenv.load_dotenv(_project_root / ".env")+warnings.filterwarnings(+ "ignore",+ message=r"Unrecognized FinishReason enum value",+ category=UserWarning,+)+from celery import Celeryfrom kombu import Queue@@ -48,6 +55,7 @@ TASK_QUEUES = (),Queue("ingest_structured_data", routing_key="ingest_structured_data"),Queue("consolidate_graph", routing_key="consolidate_graph"),+ Queue("ingest_file", routing_key="ingest_file"),)TASK_ROUTES = {@@ -61,6 +69,7 @@ TASK_ROUTES = {"src.workers.tasks.ingestion.consolidate_graph_async": {"queue": "consolidate_graph"},+ "src.workers.tasks.ingestion.ingest_file": {"queue": "ingest_file"},}ingestion_app.conf.update(diff --git a/src/workers/tasks/ingestion.py b/src/workers/tasks/ingestion.pyindex 4e218b4..c4cf88e 100644--- a/src/workers/tasks/ingestion.py+++ b/src/workers/tasks/ingestion.py@@ -3,13 +3,17 @@ File: /ingestion.pyCreated Date: Sunday October 19th 2025Author: Christian Nonis <[email protected]>------Last Modified: Thursday January 29th 2026 8:44:06 pm+Last Modified: Thursday February 19th 2026 7:45:12 pmModified By: Christian Nonis <[email protected]>-----"""+import base64import datetimeimport json+import os+import tempfile+import timeimport tomllibfrom pathlib import Pathfrom uuid import uuid4@@ -19,6 +23,7 @@ from concurrent.futures import (ThreadPoolExecutor,TimeoutError as FutureTimeoutError,)+from src.config import configfrom src.constants.data import (KGChangeLogPredicateUpdatedProperty,KGChanges,@@ -47,6 +52,7 @@ from src.workers.app import ingestion_appfrom src.constants.tasks.ingestion import (IngestionTaskArgs,IngestionTaskDataType,+ IngestionTaskTextArgs,)from src.services.kg_agent.main import cache_adapter@@ -79,6 +85,7 @@ def ingest_data(self, args: dict):Returns:task_id (str): The identifier of the ingestion task (Celery request id) that was created/updated."""+payload = Nonetry:payload = IngestionTaskArgs(**args)@@ -126,6 +133,7 @@ def ingest_data(self, args: dict):brain_id=payload.brain_id,)text_chunk_vector = embeddings_adapter.embed_text(text_chunk.text)+text_chunk_vector.metadata = {**(payload.meta_keys if payload.meta_keys else {}),"resource_id": text_chunk.id,@@ -135,28 +143,32 @@ def ingest_data(self, args: dict):"data",)- # ================================================- # --------------- Observations -------------------- # ================================================- observations = observations_agent.observe(- text=(- payload.data.text_data- if payload.data.data_type == IngestionTaskDataType.TEXT.value- else json.dumps(payload.data.json_data)- ),- observate_for=payload.observate_for,- )+ if config.pipeline_mode == "lightweight":+ print("[DEBUG (ingest_data)]: Lightweight pipeline mode selected")- data_adapter.save_observations(- [- Observation(- text=observation,- metadata=payload.meta_keys,- resource_id=text_chunk.id,- )- for observation in observations- ]- )+ if config.pipeline_mode == "accurate":+ # ================================================+ # --------------- Observations -------------------+ # ================================================+ observations = observations_agent.observe(+ text=(+ payload.data.text_data+ if payload.data.data_type == IngestionTaskDataType.TEXT.value+ else json.dumps(payload.data.json_data)+ ),+ observate_for=payload.observate_for,+ )++ data_adapter.save_observations(+ [+ Observation(+ text=observation,+ metadata=payload.meta_keys,+ resource_id=text_chunk.id,+ )+ for observation in observations+ ]+ )# ================================================# ------------ Triplet Extraction ----------------@@ -800,3 +812,87 @@ def consolidate_graph_async(f"[DEBUG (consolidate_graph_async)]: Consolidation failed for session {session_id}: {e}")raise+++FILE_INGEST_MAX_RETRIES = 3+FILE_INGEST_RETRY_DELAY = 0.1+++@ingestion_app.task(bind=True)+def ingest_file(self, content_b64: str, filename: str, brain_id: str):+ """+ Ingest a file via Docling: convert to markdown (per page), enqueue one+ ingest_data task per page.+ """+ from celery.exceptions import OperationalError+ from docling.document_converter import DocumentConverter++ cache_adapter.set(+ key=f"task:{self.request.id}",+ value=json.dumps({"status": "started", "task_id": self.request.id}),+ brain_id=brain_id,+ expires_in=3600 * 24 * 7,+ )+ content = base64.b64decode(content_b64)+ suffix = ""+ if filename:+ for ext in (".pdf", ".docx", ".pptx", ".html", ".htm"):+ if filename.lower().endswith(ext):+ suffix = ext+ break+ with tempfile.NamedTemporaryFile(delete=False, suffix=suffix) as tmp:+ tmp.write(content)+ tmp_path = tmp.name+ try:+ converter = DocumentConverter()+ result = converter.convert(tmp_path)+ num_pages = len(result.document.pages)+ if num_pages == 0:+ markdown = result.document.export_to_markdown()+ page_markdowns = [markdown] if markdown.strip() else []+ else:+ page_markdowns = [+ result.document.export_to_markdown(page_no=p)+ for p in range(1, num_pages + 1)+ ]+ finally:+ os.unlink(tmp_path)+ task_ids = [str(uuid4()) for _ in page_markdowns]+ for page_task_id in task_ids:+ cache_adapter.set(+ key=f"task:{page_task_id}",+ value=json.dumps({"status": "queued", "task_id": page_task_id}),+ brain_id=brain_id,+ expires_in=3600 * 24 * 7,+ )+ for page_task_id, markdown in zip(task_ids, page_markdowns):+ payload = {+ "data": IngestionTaskTextArgs(+ data_type="text", text_data=markdown+ ).model_dump(),+ "brain_id": brain_id,+ }+ for attempt in range(FILE_INGEST_MAX_RETRIES):+ try:+ ingest_data.apply_async(+ args=[payload],+ task_id=page_task_id,+ )+ break+ except OperationalError:+ if attempt == FILE_INGEST_MAX_RETRIES - 1:+ raise+ time.sleep(FILE_INGEST_RETRY_DELAY * (attempt + 1))+ cache_adapter.set(+ key=f"task:{self.request.id}",+ value=json.dumps(+ {+ "status": "completed",+ "task_id": self.request.id,+ "task_ids": task_ids,+ }+ ),+ brain_id=brain_id,+ expires_in=3600 * 24 * 7,+ )+ return {"task_id": self.request.id, "task_ids": task_ids}