Configuring your Repo for AI Assist
Once you have an AskJack agent and an empty knowledge base, it’s time to configure your GitHub repo with the secrets and variables it will need to sync content changes to your AskJack knowledge base.
GitHub workflows that sync your content with AskJack
The process of syncing your jhDocs content with AskJack is handled by two GitHub workflow actions:
- The AskJack Doc Sync GitHub workflow runs whenever any content changes are pushed to your main branch, including all content additions, revisions, and deletions.
- This workflow syncs all changes with AskJack since the last time that it ran.
- The workflow stores a new GitHub repo tag every time it runs, summarizing how far it got with syncing your content. The next run will pick up where the previous run left off.
- The AskJack Full Doc Sync GitHub workflow can be run once if you have already pushed changes to your repo before setting up AI Assist.
- This workflow pushes all existing content from your repo into your AskJack knowledge base.
- Do not run this workflow after the AskJack Doc Sync GitHub workflow is up and running regularly.
Both of those workflows are distributed as part of the jhDocs starter template. Check your repo; in the off chance you don’t see these two workflows in the .github/workflows folder in your repo, you can either pull those from the jhDocs starter template repo or you can contact us and we can provide these for you.
Only your markdown is synced
It’s important to note that only the markdown in your site gets synced to AskJack. Hugo renders your markdown to HTML when it builds your site, but it’s the raw markdown that is synced with AskJack, not the rendered HTML.
This distinction only becomes relevant if you have content locked up in local data files that gets rendered to HTML by local shortcodes. For example, say you have a JSON data file in your /data folder, and you have a shortcode that renders that JSON data as content when the site gets built. None of that data will be visible to AskJack, as it only sees the shortcode tag in your markdown.
This is a somewhat rare case, but if this is true for your repo, you will need to either re-architect how that data is rendered (so that it gets rendered into the markdown) or you’ll have to live without that content in your AskJack knowledge base. (You could also manually upload this data; see the following section for details.)
Other data can be stored in AskJack too
You can also manually upload documents to AskJack.
For example, say you have a PDF file that has content not found in your markdown but that you would like to include in your AskJack content. You can manually upload this PDF to AskJack for inclusion in your knowledge base.
This section covers the automatic syncing of your repo’s markdown with AskJack, not manual uploads. Contact the AskJack team with any questions on managing your knowledge base.
Configuring the secrets and variables in your GitHub repo
We need to store the four values that you previously received from the AskJack team as secrets and repo variables within your GitHub repo. These secrets and variables are referenced by the Github workflows mentioned above; if they aren’t in place, these workflows cannot run successfully.
You must have admin access to your GitHub repo in order to configure the values below.
If you do not have this access, contact the admin for your repo and ask them to make these changes.
- In your repo, go to the Settings tab.
- In the list on the left, select Secrets and variables then Actions.
- Make sure that the “Secrets” tab is selected.
- In the Repository secrets section:
- If you don’t see that an
AI_ASSIST_CLIENT_IDsecret has been defined, press the “New repository secret” button.- In the “Name” field, enter
AI_ASSIST_CLIENT_ID. - In the “Secret” field, enter the Client ID value that you received from the AskJack team.
- In the “Name” field, enter
- If you don’t see that an
AI_ASSIST_PRIVATE_KEYsecret has been defined, press the “New repository secret” button.- In the “Name” field, enter
AI_ASSIST_PRIVATE_KEY. - In the “Secret” field, enter the private value that you received from the AskJack team.
- Note that this value must begin with
-----BEGIN PRIVATE KEY-----and must end with-----END PRIVATE KEY-----.
- In the “Name” field, enter
- If you don’t see that an
- Switch to the “Variables” tab.
- In the Repository variables section:
- If you don’t see that an
AI_ASSIST_AGENT_IDvariable has been defined, press the “New repository variable” button.- In the “Name” field, enter
AI_ASSIST_AGENT_ID. - In the “Secret” field, enter the Agent ID value that you received from the AskJack team.
- In the “Name” field, enter
- If you don’t see that an
AI_ASSIST_KB_IDvariable has been defined, press the “New repository variable” button.- In the “Name” field, enter
AI_ASSIST_KB_ID. - In the “Secret” field, enter the knowledge base ID value that you received from the AskJack team.
- In the “Name” field, enter
- If you don’t see that an
AI_ASSIST_BASE_URLvariable has been defined, press the “New repository variable” button.- In the “Name” field, enter
AI_ASSIST_BASE_URL. - In the “Secret” field, enter the base URL for your site.
- This should contain the same value that you have entered for the
baseURLfield in theconfig.yamlfile in your repo.
- In the “Name” field, enter
- If you don’t see that an
After adding these secrets and variables, you have successfully configured your GitHub repo secrets and variables. The two AskJack GitHub workflows described above should be able to run successfully now and start syncing your content with AskJack.
Next topic: Configuring jhDocs for AI Assist