Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

typescript-langgraph-workflow

LangGraph workflow that diagnoses one application log line with local models running through Ollama.

Install

Install Ollama and download the models:

ollama pull granite3-dense:2b

Install the Node.js requirements:

npm install

Run

Run the verbose example:

npm run start -- example.log --verbose

Pass a log line directly:

npm run start -- --input "ERROR api - Request rejected: authentication token expired" --verbose

Workflow

flowchart LR
    A[classify_log<br/>Model] -->|category found| B[analyse_log<br/>Model]
    A -->|unknown| E[rejected_response]
    B --> C[validate_analysis<br/>Model]
    C -->|valid| D[final_response<br/>TypeScript]
    C -->|rejected| E[rejected_response]
Loading

The first error or warning line becomes a work package diagnosis. Zod validates each model response, LangGraph shares state between nodes, and TypeScript builds the final response.

The workflow uses IBM Granite 3 Dense 2B for every node. Change it with OLLAMA_MODEL.

Example output

{
  "final_result": {
    "category": "authentication",
    "probable_cause": "The client or application making the API request has not provided a valid or refreshed authentication token.",
    "confidence": 90,
    "recommended_next_steps": [
      "Check if the authentication token is being properly stored and refreshed.",
      "Verify that the token is not expired and has sufficient validity period.",
      "Ensure the client application is correctly handling token expiration events.",
      "Contact the API provider or support team if the issue persists."
    ]
  }
}

The exact response may vary between runs.

References

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages