Categories
AI AnythingLLM

AnythingLLM and Jira, love at first sight

Now I have my own RAG database installed, what now? What kind of documents can I store? How should I feed it? How can I then retrieve this information?

In short, you can do everything and very easy. You can store PDFs, links or text documents; anything you need and as easy as asking your LLM, in my case Cursor with the needed MCP configuration, to do it. For example:

“I want to add into AnythingLLM, in ‘tech-docs’ workspace”.

Then you can ask about any topic stored in these documents and it will return which ones contains them.

The next step is to lever you document retrieval and do batch processing. Instead of adding a document or a link per command, you can create a script or a skill to, periodically or on demand, add multiple entries to the RAG database, to feed the monster faster. Do you want some examples?

From Jira to your local AI: syncing tickets into AnythingLLM with Cursor.

Jira provides JQL (Jira Query Language). You can search full-text across descriptions and comments using the text field or specific fields:

text ~ "your search term"

This searches across summary, description, comments, and other text fields simultaneously. You can also combine it with other filters:

project = MYPROJECT AND text ~ "authentication error" AND updated >= -30d

This is fine… but insufficient. Why not having the flexibility of a LLM + RAG? This is where jira-to-anythingllm comes into play. This is a Cursor skill (and a Python script) that will help you to pull all the tickets from a project and store them locally in your database, so you can query your project history, bug reports and feature requests through natural language.

What the skill does.

The skill runs a Python script that incrementally fetches issues from one or more Jira projects, converts each ticket into a markdown document (including comments and metadata), uploads them to your AnythingLLM instance, and embeds them into a workspace so they become searchable via RAG (retrieval-augmented generation).

The sync is incremental and resumable. Every ticket that has already been uploaded is tracked in a local cache, so re-running the script only processes new issues. If a run is interrupted, it picks up where it left off using a progress file.

What you need before starting.

You need three things running and accessible:

  1. A Jira account with an API token. You can generate one at your Atlassian account settings page.
  2. Your local AnythingLLM instance.
  3. An AnythingLLM workspace, specific for the Jira tickets (we’ll discuss about this in next posts). You can create a workspace through the AnythingLLM web UI, via a quick API call… or asking Cursor to do it.

Configuring credentials.

The script resolves credentials from three sources in order: CLI flags, environment variables, and your ~/.cursor/mcp.json file. The last one is the easiest: once configured, Cursor will always retrieve it without asking for credentials.

A typical ~/.cursor/mcp.json that covers both servers looks like this:

{
  "mcpServers": {
    "jira_rh": {
      "command": "npx",
      "args": ["-y", "@sooperset/mcp-atlassian"],
      "env": {
        "JIRA_URL": "https://your-company.atlassian.net",
        "JIRA_USERNAME": "your-email@company.com",
        "JIRA_API_TOKEN": "your-jira-api-token"
      }
    },
    "anythingllm": {
      "command": "npx",
      "args": ["-y", "@woyo/anythingllm-mcp-server"],
      "env": {
        "ANYTHINGLLM_BASE_URL": "http://localhost:3001/api",
        "ANYTHINGLLM_API_KEY": "your-anythingllm-api-key",
        "ANYTHINGLLM_WORKSPACE": "my-workspace"
      }
    }
  }
}

Running the sync.

The simplest invocation specifies just the project key:

python scripts/jira_to_anythingllm.py --project MYPROJECT

If you want to preview what would be synced without actually uploading anything, use the dry-run flag:

python scripts/jira_to_anythingllm.py --dry-run --project MYPROJECT

To cap the number of new tickets processed in a single run (useful when onboarding a large project for the first time):

python scripts/jira_to_anythingllm.py --project MYPROJECT --limit 50

Or, as usual, instead of this, you can always ask Cursor:

“Update the Jira tickets of project in AnythingLLM”

It will retrieve the needed skill, the script and will run it with the needed parameters.

Just one heads-up: if you have more than 10.000 entries, it will take around 4 hours to retrieve all the links (the first time). Run the script and go for a long walk.

Leave a Reply

Your email address will not be published. Required fields are marked *