This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Example Sessions

In these sample sessions, extra informative output (mainly recarding ICA) is removed for readability. Also, the terminal output is formatted to make it more readable. The output of the AI is written in italics. Please see GitHub documentation for full output.

1 - Computer interaction, example 1

A demonstration of computer interaction.

Request: “What are the largest files in the current directory and below?”

In this session, the user first inquires about the largest files in the current directory, then asks for suggestions on which of these might be deleted. This example demonstrates that:

  • The assistant can provide ready-to-use terminal commands, including command chaining.
  • The assistant can analyze the output of invoked tools, supported by an automatic contextual query.

❯ ./ditana-assistant -a “What are the largest files in the current directory and below?”

find . -type f -exec du -h {} + | sort -rh | head -n 10

Execute above command? (y/n) y

364K	./packaging/arch/ditana-assistant-1.036-1-any.pkg.tar.zst
284K	./src/ditana-logo.png
284K	./packaging/arch/pkg/ditana-assistant/usr/share/ditana/assistant/ditana-logo.png
284K	./packaging/arch/ditana-logo.png
276K	./.git/objects/21/e3382f3ee049d91368ce79218cb4049bae6222
248K	./myenv/lib/python3.12/site-packages/__pycache__/bottle.cpython-312.pyc
248K	./myenv/bin/__pycache__/bottle.cpython-312.pyc
204K	./myenv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc
160K	./myenv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc
156K	./myenv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc

Your Message (’enter’ to quit): Which one of these are safe to delete?

          contextual query: "Which file in the list has the smallest size and can be safely deleted?"
answer to contextual query: "The file with the smallest size in the list is:  ./myenv/lib/python3.12/site-packages/pip/_vendor..."

It is important to exercise caution when deleting files, especially system files or files related to applications. In the list provided, the file that appears to be safe to delete without causing any major issues is:

./myenv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc

This file seems to be a Python cache file and deleting it should not have a significant impact on the functionality of the application. However, it is always recommended to make a backup of the file before deleting it, in case it is needed later on.

2 - Computer interaction, example 2

A demonstration of computer interaction.

Request: “Is the network name resolution service running stably?”

In this session, the user first inquires about the status of a service, then requests a summary. This example illustrates that:

  • The assistant can deduce the specific name of the service with the help of System-Specific Context (on Windows or macOS, the answer is different).
  • The assistant can analyze the output of invoked tools, supported by an automatic contextual query (see the following log).

❯ ./ditana-assistant “Is the network name resolution service running stably?”

systemctl status systemd-resolved.service

Execute above command? (y/n) y

● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-09-23 10:16:39 CEST; 3 days ago
 Invocation: 1e937e9c439a4fed968ce8d0e976e201
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://systemd.io/WRITING_NETWORK_CONFIGURATION_MANAGERS
             https://systemd.io/WRITING_RESOLVER_CLIENTS
   Main PID: 737 (systemd-resolve)
     Status: "Processing requests..."
      Tasks: 1 (limit: 154223)
     Memory: 11.8M (peak: 15M)
        CPU: 55.832s
     CGroup: /system.slice/systemd-resolved.service
             └─737 /usr/lib/systemd/systemd-resolved

Sep 23 10:16:39 akino systemd[1]: Starting Network Name Resolution...
Sep 23 10:16:39 akino systemd-resolved[737]: Positive Trust Anchors:
Sep 23 10:16:39 akino systemd-resolved[737]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Sep 23 10:16:39 akino systemd-resolved[737]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa 170.0.0.192.in-addr.arpa 171.0.0.192.in-addr.arpa 168.192.in-addr.arpa d.f.ip6.arpa …
Sep 23 10:16:39 akino systemd-resolved[737]: Using system hostname 'akino'.
Sep 23 10:16:39 akino systemd[1]: Started Network Name Resolution.
Sep 23 10:16:43 akino systemd-resolved[737]: enp5s0: Bus client set search domain list to: fritz.box
Sep 23 10:16:43 akino systemd-resolved[737]: enp5s0: Bus client set default route setting: yes
Sep 23 10:16:43 akino systemd-resolved[737]: enp5s0: Bus client set DNS server list to: 192.168.178.1
Hint: Some lines were ellipsized, use -l to show in full.

Your Message ('enter' to quit): Can you please summarize this?

The output shows that the systemd-resolved service is active and running stably since September 23, 2024. It is processing requests and has a main PID of 737. The service is managing network name resolution and has a positive trust anchor listed. The system hostname is 'akino' and the service has set search domain list and DNS server list for the network interface enp5s0.

3 - Automatic use of Wolfram|Alpha

A demonstration of the automatic internal use of Wolfram|Alpha.
Ditana Assistant GUI

This screenshot illustrates the seamless integration of real-time data from the Wolfram|Alpha API, which is automatically accessed as needed. The assistant leverages this capability to provide up-to-date and context-aware responses. The answer itself is generated by the LLM, but the additional context is automatically retrieved from Wolfram|Alpha. See Introspective Contextual Augmentation for details.

4 - Sophisticated calculator

A demonstration of the automatic direct use of Wolfram|Alpha.

This example demonstrates a direct output from Wolfram|Alpha’s Short Answers API, used for immediately suitable queries. Therefore, the language style of the output can be more formal than the natural style of LLMs. However, in the majority of cases, Ditana Assistant employs Wolfram|Alpha internally for Introspective Contextual Augmentation, enabling a powerful synergy between Wolfram|Alpha and the LLM to generate more comprehensive responses.

❯ ditana-assistant --quiet "solve x^2 + 2x + 5 = 0"

the 1st is x equals minus 1 minus 2 times i and the 2nd is x equals minus 1 plus 2 times i

Note 1: In this case, the assistant decided via an internal query to the LLM if to use Wolfram|Alpha or not. You may force the use of Wolfram|Alpha by adding the flag -w.

Note 2: The --quiet flag is used in this example to display only the assistant’s response without additional output.

5 - Pastime mode, example 1

A demonstration of the pastime mode without impersonation.

This screenshot illustrates a conversion in the --pastime mode (without specific impersonation). In this case, gpt-4 has been used.

Ditana Assistant GUI

6 - Pastime mode, example 2

A demonstration of the pastime mode with impersonation.

This terminal session illustrates impersonation of a specific character or personality (in this case, using gpt-3.5-turbo):

ditana-assistant -p -i "Detective Sherlock Holmes"

Ah, good afternoon. So you’re the one who asked me for help. Please tell me everything you know about the incident.

Your Message (‘enter’ to quit): All I know is that there was a lot of fog. I could hardly see anything. And suddenly the car was gone. Just disappeared. It was terrible.

Interesting. Can you tell me more about the car? Make, colour, registration number?

Your Message (‘enter’ to quit): It was a green VW Beetle. Licence plate number MN P-16.

Thank you for the information. Did you see any suspects or people behaving suspiciously?

Your Message (‘enter’ to quit): Precisely not, because of the fog. I only remember that, strangely enough, a parrot flew past just before the incident. That’s very strange, because parrots are not native to this area.

A parrot, you say? That is indeed unusual. Have you noticed anything else that you think is important?

7 - ICA example 1

A demonstration of the effect of Introspective Contextual Augmentation (ICA).

Request: “What should I wear today for a travel to New York?”

The response without ICA lacks specific information about today’s weather. But even without ICA, if Wolfram|Alpha is configured, Ditana Assistant will always assess whether the request is directly suitable for Wolfram|Alpha (which it is not in this case). Here, Ditana Assistant’s System-Specific Context proves helpful. It provides a more informed answer than one without even knowing the current month.

The second response, with ICA enabled, automatically utilizes real-time information from Wolfram|Alpha to check the current temperature in New York.

Without ICA (default)

❯ ./ditana-assistant "What should I wear today for a travel to New York?"
                                    is English: "What should I wear today for a travel to New York?"
                  does not refer to a computer: "What should I wear today for a travel to New York?"
                not suitable for Wolfram|Alpha: "What should I wear today for a travel to New York?"

I recommend wearing comfortable and stylish clothing for your travel to New York. Since it’s September, you may want to consider layering options as the weather can be unpredictable. A light jacket or sweater, comfortable jeans or pants, and comfortable shoes for walking are good choices. Don’t forget to check the weather forecast for New York to ensure you are prepared for any conditions. Safe travels!

With ICA

❯ ./ditana-assistant -a "What should I wear today for a travel to New York?"
                                    is English: "What should I wear today for a travel to New York?"
                  does not refer to a computer: "What should I wear today for a travel to New York?"
                not suitable for Wolfram|Alpha: "What should I wear today for a travel to New York?"
                              contextual query: "What is the average temperature in New York City on September 26th, 2024?"
    Wolfram|Alpha’s answer to contextual query: "On Thursday, 26 September 2024, the mean temperature in New York City, United States, was 21 degr..."

For a trip to New York City on September 26th, 2024, you may want to wear comfortable clothing suitable for a temperature of around 21 degrees Celsius. It’s always a good idea to bring layers, as the weather can change throughout the day. Additionally, consider bringing an umbrella or rain jacket as there may be a chance of rain. Enjoy your trip!

8 - ICA example 2

A demonstration of the effect of Introspective Contextual Augmentation (ICA).

Request: “A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meters from the wall. What is the angle between the ladder and the ground?”

A detailed analysis by ChatGPT-o1 on the quality of the following two responses shows that Ditana Assistant’s ICA can avoid fundamental errors in the output:

  • Answer 2 is correct, and it demonstrates a proper understanding and application of trigonometric functions, with all intermediate steps accurately calculated.
  • Answer 1, while partially correct in its calculation, contains a fundamental error in explaining the trigonometric relationships and does not provide the final numerical value of the angle.

See public link to the comparison for the full picture.

Without ICA (default)

❯ ./ditana-assistant "A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meters from the wall. What is the angle between the ladder and the ground?"
                                    is English: "A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meter..."
                  does not refer to a computer: "A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meter..."

Here’s how to solve this problem using trigonometry: Understanding the Problem

  • We have a right triangle formed by the ladder, the wall, and the ground.
  • The ladder is the hypotenuse (the longest side).
  • The distance from the wall to the base of the ladder is one leg.
  • The angle between the ladder and the ground is what we need to find. Using Trigonometry The trigonometric function that relates the opposite side, adjacent side, and hypotenuse is the tangent (tan).
  • tan(angle) = opposite / adjacent Applying the Information
  1. Opposite: The ladder reaches 4 meters up the wall, so the opposite side is 4 meters.
  2. Adjacent: The base of the ladder is 3 meters from the wall, so the adjacent side is 3 meters. Calculating the Angle
  • tan(angle) = 4 / 3
  • angle = arctan(4/3) Using a Calculator You can use a calculator to find the arctangent of 4/3. The result will be the angle in degrees. Important Note: The angle will be an acute angle (less than 90 degrees). Let me know if you’d like me to calculate the angle using a specific calculator!

With ICA

❯ ./ditana-assistant -a "A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meters from the wall. What is the angle between the ladder and the ground?"
                             is English: "A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meter..."
           does not refer to a computer: "A ladder leaning against a wall reaches 4 meters up the wall. The bottom of the ladder is 3 meter..."
                       contextual query: "What is the angle between the ladder and the ground, given the ladder's height is 4 meters and it..."
Wolfram|Alpha declined contextual query: "The input cannot be interpreted or no short answer is available."
             answer to contextual query: "Here's how to solve this problem using trigonometry:  **Understanding the Problem**  * We have a ..."

Here’s how to solve this problem:

Understanding the Problem

  • We have a right triangle formed by the ladder, the ground, and the wall.
  • The ladder is the hypotenuse (the longest side).
  • The distance from the wall to the base of the ladder is one leg.
  • The height the ladder reaches on the wall is the other leg.

Using Trigonometry

We can use the sine function to find the angle:

  • sin(angle) = opposite side / hypotenuse

In our case:

  • Opposite side = height of the ladder = 4 meters
  • Hypotenuse = length of the ladder = unknown
  • We need to find the angle (angle)

Solving for the Angle

  1. Substitute the values: sin(angle) = 4 meters / hypotenuse
  2. Use the Pythagorean theorem: hypotenuse² = base² + height²
    • hypotenuse² = 3 meters² + 4 meters²
    • hypotenuse² = 25 meters²
    • hypotenuse = √25 meters² = 5 meters
  3. Substitute the hypotenuse back into the sine equation: sin(angle) = 4 meters / 5 meters
  4. Solve for the angle: angle = arcsin(4/5)
  5. Calculate the angle: angle ≈ 53.13 degrees

Answer: The angle between the ladder and the ground is approximately 53.13 degrees.

Let me know if you have any other geometry problems!

9 - ICA example 3

A demonstration of the effect of Introspective Contextual Augmentation (ICA).

Request: “Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockchain technology?”

A detailed analysis of ChatGPT-o1 on the quality of the following two responses indicates that Ditana Assistant’s ICA can better leverage the capabilities of the underlying LLM model:

Between the two answers, Answer 2 is of higher quality. It offers a more comprehensive and structured comparison of the proof-of-stake and proof-of-work consensus mechanisms. By organizing the information into key points, it enhances readability and makes it easier to understand the distinct differences. Additionally, Answer 2 covers extra dimensions such as centralization and the economic incentives that promote security in PoS, providing a more thorough explanation that directly relates to the question.

See public link to the detailed comparison for the full picture.

Without ICA (default)

❯ ./ditana-assistant "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockchain technology?"
                    is English: "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockcha..."
  does not refer to a computer: "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockcha..."
not suitable for Wolfram|Alpha: "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockcha..."

Certainly! In blockchain technology, both proof-of-stake (PoS) and proof-of-work (PoW) are consensus mechanisms used to validate transactions and secure the network.

Proof-of-work requires miners to solve complex mathematical puzzles in order to validate transactions and create new blocks. This process is energy-intensive and requires significant computational power. Miners compete to solve these puzzles, and the first one to do so is rewarded with newly minted cryptocurrency.

On the other hand, proof-of-stake does not require miners to solve complex puzzles. Instead, validators are chosen to create new blocks based on the amount of cryptocurrency they hold and are willing to “stake” as collateral. Validators are selected to create new blocks based on various factors, such as the amount of cryptocurrency they hold and how long they have been staking it.

One key difference between PoS and PoW is the energy consumption. PoW requires a significant amount of energy to solve the puzzles, leading to concerns about its environmental impact. PoS, on the other hand, is considered to be more energy-efficient since it does not require the same level of computational power.

Additionally, PoS is often seen as more secure and resistant to certain types of attacks, such as the 51% attack, where a single entity controls the majority of the network’s mining power. In PoS, an attacker would need to control the majority of the cryptocurrency supply to carry out a similar attack.

Overall, both PoW and PoS have their own advantages and disadvantages, and the choice between the two consensus mechanisms often depends on the specific goals and requirements of the blockchain network.

With ICA

❯ ./ditana-assistant -a "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockchain technology?"
                             is English: "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockcha..."
           does not refer to a computer: "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockcha..."
         not suitable for Wolfram|Alpha: "Can you explain how the proof-of-stake consensus mechanism differs from proof-of-work in blockcha..."
                       contextual query: "How does the energy consumption of the proof-of-stake consensus mechanism compare to that of proo..."
Wolfram|Alpha declined contextual query: "The input cannot be interpreted or no short answer is available."
             answer to contextual query: "The energy consumption of the proof-of-stake consensus mechanism is significantly lower compared ..."

Certainly! Here are the key differences between the proof-of-stake (PoS) and proof-of-work (PoW) consensus mechanisms in blockchain technology:

  1. Validation Process:

    • In PoW, miners compete to solve complex mathematical puzzles in order to validate transactions and create new blocks on the blockchain. The first miner to solve the puzzle gets to add the new block to the blockchain.
    • In PoS, validators are chosen to create new blocks based on the amount of cryptocurrency they hold and are willing to “stake” as collateral. Validators are selected based on various factors such as the amount of cryptocurrency they hold and how long they have been staking.
  2. Energy Consumption:

    • PoW requires a significant amount of computational power and electricity to solve the mathematical puzzles, leading to high energy consumption. This has raised concerns about the environmental impact of PoW blockchains.
    • PoS is much more energy-efficient as it does not rely on mining and the energy-intensive process of solving puzzles. Validators are chosen based on their stake in the network, reducing the overall energy consumption of the blockchain.
  3. Security:

    • PoW is considered to be secure due to the computational power required to solve the puzzles. The idea is that an attacker would need to control a majority of the network’s computational power to manipulate the blockchain.
    • PoS is also considered secure, as validators have a financial stake in the network. If they validate fraudulent transactions, they risk losing their stake, providing an economic incentive to act honestly.
  4. Centralization:

    • PoW has been criticized for centralization tendencies, as mining pools with significant computational power can dominate the network.
  • PoS is often seen as more decentralized, as validators are chosen based on their stake in the network rather than computational power.

Overall, PoS is seen as a more energy-efficient and environmentally friendly alternative to PoW, while still maintaining security and decentralization in blockchain networks.