A production-ready autonomous AI agent with multi-user auth, file upload, history, and export.
# 1. Install dependencies
pip install -r requirements.txt
# 2. Set API key (or enter in sidebar)
cp .env.example .env
# Edit .env → GROQ_API_KEY=gsk_...
# 3. Run
streamlit run app.pyGet a free Groq API key at: https://console.groq.com
| Field | Value |
|---|---|
| Username | demo |
| Password | demo1234 |
- First registered user becomes a regular user
- Set
role='admin'in DB to unlock the admin panel
| Feature | Details |
|---|---|
| 🔐 Auth | Register / Login / Sessions (SQLite) |
| ⚡ Agent | ReAct loop · 8 steps · LLaMA 3.3 70B |
| 🌐 Web Search | Live DuckDuckGo |
| 🐍 Code Runner | Safe Python execution (15s timeout) |
| 📁 File Upload | Upload & inject files into agent context |
| 📜 History | Per-user query history with delete |
| 💾 Export | CSV / JSON / TXT download |
| 🛡 Admin | View all users, global stats, full export |
| 🔑 Security | PBKDF2 hashed passwords, masked API keys |
- Frontend: Streamlit
- LLM: Groq API (LLaMA 3.3 70B)
- Database: SQLite
- Authentication: PBKDF2 hashed passwords
- Tools: DuckDuckGo Search, Python Eval, File Reader
AutoAgent/
├── app.py # Main Streamlit app
├── autoagent/
│ ├── agent.py # ReAct agent loop
│ ├── tools.py # Web search, Python, file reader
│ ├── database.py # SQLite: users, sessions, history, files
│ ├── auth.py # Login/register UI + session helpers
│ ├── file_handler.py # Upload, validate, read files
│ ├── export.py # CSV / JSON / TXT export
│ └── security.py # Key masking, input sanitization
├── db/ # Auto-created: autoagent.db
├── uploads/ # Auto-created: user files
├── requirements.txt
└── .env.example
Create a .env file:
GROQ_API_KEY=your_groq_api_key_here
SECRET_KEY=your_secret_key_here
DATABASE_URL=sqlite:///db/autoagent.db- Register/Login — Create an account or use demo credentials
- Ask Questions — Type your query and press Enter
- Upload Files — Upload documents for context
- View History — See all your past queries
- Export Data — Download your history as CSV / JSON / TXT
"What is today's AI news?""Calculate compound interest for 10k at 8% over 5 years""Explain what LangChain is""Write Python to find prime numbers up to 100"
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
- Groq for the LLM API
- Streamlit for the amazing framework
- DuckDuckGo for search capabilities