Skip to main content

Best Practices

Prompt Writing

When using generative AI to ask questions or seek suggestions, it's essential to be specific and ask multiple questions to arrive at the desired answer.

Below are some tips for utilizing our generative AI prompt:

1. Chat History

It's essential to keep in mind that your chat history can have an impact on the answers you receive during a chat session. For example, if you're asking questions about a Java application and then suddenly switch to asking about Python applications, the answers you receive may need to be more helpful and accurate.

  • If you want to change the subject of the conversation, it's best to start a new chat rather than simply clearing the chat history. Clearing the chat history removes the messages from the page, but creating a new chat resets the conversation history and can result in better answers.

  • If you want to change the subject, click on a new chat to start fresh.

2. Give more information

  • Add specific details on what you want.
  • There is no wrong answer; you need to keep asking questions. Keep chatting and adding more information. The more details, the better.

3. Examples

See below the best practices for writing questions:

  • Not so good: I want to generate a bank slip in Kotlin.

  • Excellent: I must create an API Rest in Kotlin using Springboot with OpenFeign integration. Create a payment link.

  • Not so good: I want to create a user registration.

  • Excellent: I need a user registration with name, address, zip code, and phone number.

4. Chat way

Chat in phases. Ask questions, wait for the answer, and depending on that, ask for more details. See below:

  • How do I implement this?
  • Bring more information on this.
  • Change this to that.
  • Get this class and do this.

Knowledge Source

Creating a Knowledge Source is crucial as it helps provide context to StackSpot AI. If you have already created one and are asking questions that don't yield the desired results, check if your Knowledge Source has enough information and context.

See below some bits of advice:

1. When creating a knowledge source, it's best only to include the information that you need and separate it by subject. StackSpot AI selects and ranks documents based on their relevance to your topic, so if you have a lot of unrelated information in one source, you may not get accurate results.

2. Instead of grouping different code snippets, frameworks, and programming languages in one Knowledge Source, it's better to create separate ones for each context. It allows StackSpot AI to find more relevant and in-depth documents for each subject, resulting in a wider variety of high-quality documents.

3. See examples:

  • Knowledge Source with Kafka Integration snippets.
  • Knowledge Source with best practices for functional programming.

4. Consider organizing Knowledge Sources to improve search results.

5. You can add specific Knowledge Sources to your Workspace's context.