{"id":13877811,"url":"https://github.com/AgentOps-AI/Jaiqu","last_synced_at":"2025-07-16T13:32:41.821Z","repository":{"id":223955232,"uuid":"756734193","full_name":"AgentOps-AI/Jaiqu","owner":"AgentOps-AI","description":"Automatically reformat any JSON into any schema with AI","archived":false,"fork":false,"pushed_at":"2024-10-01T22:22:26.000Z","size":3381,"stargazers_count":303,"open_issues_count":2,"forks_count":19,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-21T08:34:43.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgentOps-AI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-13T07:50:01.000Z","updated_at":"2024-11-19T06:33:48.000Z","dependencies_parsed_at":"2024-11-12T04:02:25.367Z","dependency_job_id":null,"html_url":"https://github.com/AgentOps-AI/Jaiqu","commit_stats":null,"previous_names":["agentops-ai/jaiqu"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentOps-AI%2FJaiqu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentOps-AI%2FJaiqu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentOps-AI%2FJaiqu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentOps-AI%2FJaiqu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgentOps-AI","download_url":"https://codeload.github.com/AgentOps-AI/Jaiqu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225700927,"owners_count":17510445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:01:25.128Z","updated_at":"2025-07-16T13:32:41.791Z","avatar_url":"https://github.com/AgentOps-AI.png","language":"Python","funding_links":[],"categories":["Python","Learning"],"sub_categories":["Repositories"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/AgentOps-AI/Jaiqu/blob/8d4c66b2603bf14fedd2bf4c615c8919f79ece9f/jaiqu.png\" height=\"300\" alt=\"Jaiqu\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eNatural language to DSL agent for JSON querying\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/jaiqu/\" target=\"_blank\"\u003e\n        \u003cimg alt=\"Python\" src=\"https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\" /\u003e\n        \u003cimg alt=\"Version\" src=\"https://img.shields.io/pypi/v/jaiqu?style=for-the-badge\u0026color=3670A0\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://jaiqu-agent.streamlit.app/\"\u003e🔗 Main site\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"https://twitter.com/agentopsai/\"\u003e🐦 Twitter\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"https://discord.gg/JHPt4C7r\"\u003e📢 Discord\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;•\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"https://agentops.ai/?jaiqu\"\u003e🖇️ AgentOps\u003c/a\u003e\n\u003c/p\u003e\n\n# Jaiqu\n\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)]([https://\u003cyour-custom-subdomain\u003e.streamlit.app](https://jaiqu-agent.streamlit.app)) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![PyPI - Version](https://img.shields.io/pypi/v/jaiqu)\n[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/AgentOpsAI)](https://x.com/agentopsai)\n\n\nReplicable, AI-generated JSON transformation queries. Transform any JSON into any schema automatically.\n\nJaiqu is an AI agent for creating repeatable JSON transforms using [jq query language](https://jqlang.github.io/jq/) syntax. Jaiqu translates any arbitrary JSON inputs into any desired schema.\n\nBuilding AI agents? Check out [AgentOps](https://agentops.ai/?jaiqu)\n\n[Live Demo](https://jaiqu-agent.streamlit.app)\n\n[Video Overview](https://youtu.be/exbV35-XWA0)\n\n![Alt text](architecture.png)\n\n\n### Features\n* **Translate any schema to any schema** AI agent automatically maps data from a source schema to a desired format by iteratively prompting GPT-4 to create valid jq query syntax.\n* **Schema validation** Given a requirement schema, automatically validate whether the required data is present in the input json.\n* **Fuzzy term matching** Infers keys based on symantic similarity (i.e. datetime vs date_time). GPT-4 automatically maps and translates input keys to desired output keys.\n\n### Example usage:\n\n```python\nfrom jaiqu import validate_schema, translate_schema\n\n# Desired data format \nschema = {\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"id\": {\n            \"type\": [\"string\", \"null\"],\n            \"description\": \"A unique identifier for the record.\"\n        },\n        \"date\": {\n            \"type\": \"string\",\n            \"description\": \"A string describing the date.\"\n        },\n        \"model\": {\n            \"type\": \"string\",\n            \"description\": \"A text field representing the model used.\"\n        }\n    },\n    \"required\": [\n        \"id\",\n        \"date\"\n    ]\n}\n\n# Provided data\ninput_json = {\n    \"call.id\": \"123\",\n    \"datetime\": \"2022-01-01\",\n    \"timestamp\": 1640995200,\n    \"Address\": \"123 Main St\",\n    \"user\": {\n        \"name\": \"John Doe\",\n        \"age\": 30,\n        \"contact\": \"john@email.com\"\n    }\n}\n\n# (Optional) Create hints so the agent knows what to look for in the input\nkey_hints=\"We are processing outputs of an containing an id, a date, and a model. All the required fields should be present in this input, but the names might be different.\"\n```\n\nValidating an input json contains all the information required in a schema\n```python\nschema_properties, valid = validate_schema(input_json, schema, key_hints)\n\nprint(schema_properties)\n\n\u003e\u003e\u003e {\n      \"id\": {\n          \"identified\": true,\n          \"key\": \"call.id\",\n          \"message\": \"123\",\n          \"type\": [\n          \"string\",\n          \"null\"\n          ],\n          \"description\": \"A unique identifier for the record.\",\n          \"required\": true\n      },\n      \"date\": {\n          \"identified\": true,\n          \"key\": \"datetime\",\n          \"message\": \"2022-01-01\",\n          \"type\": \"string\",\n          \"description\": \"A string describing the date.\"\n          \"required\": true\n      }\n    }\nprint(valid)\n\u003e\u003e\u003e True\n```\n\nCreating a repeatable jq query for extracitng data from identically formatted input JSONs\n```python\njq_query = jaiqu.translate_schema(input_json, schema, key_hints, max_retries=30)\n\u003e\u003e\u003e'{\"id\": .attributes[\"call.id\"], \"date\": .datetime}'\n```\n\n### CLI Usage\n\n```bash\ngit clone https://github.com/AgentOps-AI/Jaiqu.git\ncd Jaiqu/samples/\n\njaiqu -s schema.json -d data.json\n# Validating schema: 100%|███████████████████████████| 3/3 [00:11\u003c00:00,  3.73s/it, Key: model]\n# Translating schema: 100%|███████████████████████████| 2/2 [00:02\u003c00:00,  1.46s/it, Key: date]\n# Retry attempts:  20%|███████████████████▌                     | 2/10 [00:02\u003c00:11,  1.46s/it]\n# Validation attempts:  10%|█████████▎                          | 1/10 [00:00\u003c00:08,  1.02it/s]\n\njq '{ \"id\": (if .[\"call.id\"] then .[\"call.id\"] else null end), \"date\": (if has(\"datetime\") then .datetime else \"None\" end) }' data.json\n# Run command?\n# [E]xecute, [A]bort: e\n# {\n#   \"id\": \"123\",\n#   \"date\": \"2022-01-01\"\n# }\n```\n\n\u003e Note: usage is currently limited to python 3.9 \u0026 3.10\n\n## Installation\n\n#### Recommended: [PyPI](https://pypi.org/project/jaiqu/):\n\n```bash\npip install jaiqu\n```\n\n\n## Architecture\nUnraveling the Jaiqu agentic workflow pattern \n```mermaid\nflowchart TD\n    A[Start translate_schema] --\u003e B{Validate input schema}\n    B -- Valid --\u003e C[For each key, create a jq filter query]\n    B -- Invalid --\u003e D[Throw RuntimeError]\n    C --\u003e E[Compile and Test jq Filter]\n    E -- Success --\u003e F[Validate JSON]\n    E -- Fail --\u003e G[Retry Create jq Filter]\n    G -- Success --\u003e E\n    G -- Fail n times--\u003e H[Throw RuntimeError]\n    F -- Success --\u003e I[Return jq query string]\n    F -- Fail --\u003e J[Retry Validate JSON]\n    J -- Success --\u003e I\n    J -- Fail n times --\u003e K[Throw RuntimeError]\n```\n\n\n## Running tests\n\n0. Install `pytest` if you don't have it already\n\n```shell\npip install pytest\n```\n\n1. Run the `tests/` folder while in the parent directory\n\n```shell\npytest tests\n```\n\nThis repo also supports `tox`, simply run `python -m tox`.\n\n## Contributing\n\nContributions to Jaiqu are welcome! Feel free to create an [issue](https://github.com/AgentOps-AI/jaiqu/issues) for any bug reports, complaints, or feature suggestions.\n\n## License\n\nJaiqu is released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAgentOps-AI%2FJaiqu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAgentOps-AI%2FJaiqu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAgentOps-AI%2FJaiqu/lists"}