Giter Club home page Giter Club logo

logagent's Introduction

LogAgent

Objective

LogAgent is a tool designed to help developers on production support by analyzing log files to debug issues that are difficult to reproduce, particularly logic or business flow issues that don't necessarily throw errors. It uses prompt engineering to guide an LLM in analyzing logs and identifying anomalies.

Features

  • Log Analysis: Reads and interprets log files to understand event flows and detect anomalies.
  • Prompt Engineering: Utilizes complex prompts to guide the LLM in analyzing logs and outputting tokens for debugging.
  • Open Source: Available for community use and contributions.

Future Enhancements

  • RAG Pipeline: Integrate a Retrieval-Augmented Generation pipeline for deeper codebase analysis and recommendations.
  • Large Log Support: Expand capacity to handle logs larger than 256k tokens.
  • Reproduction and Fixes: Provide steps to reproduce issues and suggest fixes using codebase references.

Setup

Local Setup

  1. Create Environment:

    conda create -n log_analyzer python=3.10 -y
    conda activate log_analyzer
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Run the Server:

    python app.py
  4. Run the Streamlit App:

    streamlit run streamlit_app.py

API Usage

Example cURL Request

curl -X POST "http://localhost:8000/analyze_log" \
     -H "Content-Type: application/json" \
     -d '{"file_path": "/path/to/your/logfile.log"}' \
     > analysis_results.json

Design Decisions

  • Backend: FastAPI for robust API endpoints.
  • Frontend: Streamlit for an intuitive user interface.
  • Log Analysis: AI21's API to leverage advanced language models.
  • Asynchronous Processing: Efficient handling of multiple requests in FastAPI.

Assumptions

  • Users have valid log files in a readable format.
  • The AI21 API is accessible and functioning.
  • Users have internet connectivity for app access and API communication.
  • The system has sufficient resources to process logs and API requests.

Limitations

  • Only supports .log files.
  • Analysis capabilities limited by the AI21 model.
  • No persistent storage for analysis results.
  • No user authentication or rate limiting.
  • Memory constraints may limit log file size processing.

Future Improvements

  • User authentication and session management.
  • Support for multiple file formats.
  • Integration with additional AI models for comparative analysis.
  • Caching and trend analysis over time.
  • Graphical visualization of log analysis data.
  • Batch processing for multiple log files.
  • Customizable prompts for analysis.
  • Improved error handling and user feedback.
  • Export functionality for analysis results.

Contribution

Contributions are welcome. Please fork the repository and submit pull requests.


By improving the README with clear sections on the objective, features, setup instructions, usage examples, design decisions, assumptions, limitations, and future improvements, users will have a comprehensive guide to understanding and using LogAgent.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.