A Python-based AI agent system that provides various NLP capabilities including summarization, article writing, and data sanitization. The system uses Ollama as the LLM backend and provides a Streamlit-based web interface for easy interaction.
Arpit Agarwal arpit.dev@outlook.com
- Text Summarization
- Article Writing
- Data Sanitization
- Real-time Validation
- Streamlit-based Web Interface
- Logging and Error Handling
ai-agent-practice/
├── agents/ # Core AI agent implementations
│ ├── __init__.py # Agent manager and initialization
│ ├── agent_base.py # Base class for all agents
│ ├── summarize_tool.py # Text summarization agent
│ ├── article_tool.py # Article writing agent
│ ├── sanitize_data.py # Data sanitization agent
│ ├── write_article_validator_agent.py
│ ├── sanitize_data_validator_agent.py
│ ├── summary_validator_agent.py
│ └── refiner_agent.py
├── utils/ # Utility modules
│ └── logger.py # Custom logging implementation
├── app.py # Streamlit web application
├── requirements.txt # Project dependencies
└── logs/ # Application logs
- Clone the repository:
git clone <repository-url>
cd ai-agent-practice- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Install Ollama and download the model:
brew install ollama
ollama pull llama3- Start the application:
streamlit run app.py- Open your web browser and navigate to
http://localhost:8501
The application provides a simple web interface with three main functionalities:
- Summarize: Enter text to get a concise summary
- Write Article: Generate articles based on your input
- Sanitize Data: Clean and process your data
Each operation includes real-time validation to ensure quality.
The application includes comprehensive error handling with:
- Retry mechanism for LLM calls
- Detailed logging
- User-friendly error messages
The application uses a custom logging system that:
- Logs to both console and file
- Rotates logs automatically
- Includes timestamps and log levels
Logs are stored in the logs directory.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Ollama for providing the LLM backend
- Streamlit for the web interface