JDogo
Open playground

Quick start

Three calls cover most of what you'll do: encode, decode, and build a prompt.

Encode and decode

Pass any JSON-compatible value. You get JDogo text back, and decoding it returns exactly the same value.

import jdogo

users = [
    {"id": 1001, "name": "Ada Lovelace", "role": "admin", "active": True},
    {"id": 1002, "name": "Grace Hopper", "role": "editor", "active": True},
    {"id": 1003, "name": "Alan Turing", "role": "viewer", "active": False},
    {"id": 1004, "name": "Katherine Johnson", "role": "editor", "active": True},
]

text = jdogo.dumps(users)
print(text)
assert jdogo.loads(text) == users

Output:

@id+,name,role,active
1001,Ada Lovelace,admin,true
1,Grace Hopper,editor,true
1,Alan Turing,viewer,false
1,Katherine Johnson,editor,true

id+ stores each id as the step from the row above. The format guide covers every symbol.

Send it to a model

The prompt builder writes the instruction, the data and the question in the layout that tested best across models. It keeps full key names and quoted values so the model can match your question to the data.

prompt = jdogo.format_query_prompt("Which users are editors?", users)
reply = call_your_model(prompt)

Get exact numbers with ask()

For counts, totals and averages, let the model write a query instead of reading rows. You pass a function that calls your model; JDogo does the rest.

from jdogo import ask

result = ask("How many active admins are there?", users, llm=call_your_model)
print(result.answer, result.route, result.expression)
# 1 compute count where role = "admin" and active = true

Read AI prompts and ask() for routing, fallbacks and what the model may write.

Next steps