Metadata-Version: 2.4
Name: bssagent
Version: 0.1.1
Summary: BSS Agent – A simple AI agent framework based on LangGraph
Author: BSS Agent Team
Maintainer: BSS Agent Team
License: MIT
Project-URL: Homepage, https://github.com/bssagent/bssagent
Project-URL: Documentation, https://bssagent.readthedocs.io
Project-URL: Repository, https://github.com/bssagent/bssagent.git
Project-URL: Bug Tracker, https://github.com/bssagent/bssagent/issues
Project-URL: Changelog, https://github.com/bssagent/bssagent/blob/main/CHANGELOG.md
Keywords: ai,agent,langchain,langgraph,business,automation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langchain>=0.3.26
Requires-Dist: langgraph>=0.5.3
Requires-Dist: langchain-community>=0.0.20
Requires-Dist: langchain-openai>=0.3.0
Requires-Dist: langchain-google-genai>=2.1.6
Requires-Dist: langchain-anthropic>=0.3.17
Requires-Dist: langchain-deepseek>=0.1.0
Requires-Dist: langchain-ollama>=0.3.0
Requires-Dist: langgraph-supervisor>=0.0.28
Requires-Dist: langgraph-checkpoint-postgres>=2.0.21
Requires-Dist: langgraph-checkpoint-mongodb>=0.1.4
Requires-Dist: langgraph-checkpoint-mysql>=2.0.15
Requires-Dist: langgraph-checkpoint-redis>=0.0.8
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.10
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: websockets>=11.0.0
Requires-Dist: beautifulsoup4>=4.11.0
Requires-Dist: urllib3>=1.26.0
Requires-Dist: trafilatura>=1.5.0
Requires-Dist: PyPDF2>=3.0.0
Requires-Dist: python-docx>=0.8.11
Requires-Dist: pandas>=1.5.0
Requires-Dist: openpyxl>=3.0.0
Requires-Dist: docx2txt>=0.9
Requires-Dist: xlrd>=2.0.0
Requires-Dist: python-pptx>=0.6.0
Requires-Dist: rtfparse>=0.9.5
Requires-Dist: pyarrow>=10.0.0
Requires-Dist: fastavro>=1.7.0
Requires-Dist: lxml>=4.9.0
Requires-Dist: html5lib>=1.1
Requires-Dist: nltk>=3.8
Requires-Dist: textstat>=0.7.0
Requires-Dist: weaviate-client>=4.16.3
Requires-Dist: langchain-chroma>=0.2.5
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: alembic>=1.11.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: redis>=4.5.0
Requires-Dist: PyMySQL>=1.1.0
Requires-Dist: celery>=5.3.0
Requires-Dist: boto3>=1.26.0
Requires-Dist: azure-mgmt-compute>=30.0.0
Requires-Dist: google-cloud-compute>=1.10.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: jwt>=1.3.1
Requires-Dist: bcrypt>=4.0.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: slowapi>=0.1.9
Requires-Dist: uvicorn>=0.20.0
Requires-Dist: docker>=6.1.0
Requires-Dist: kubernetes>=26.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-mock>=3.11.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: pre-commit>=3.3.0; extra == "dev"
Requires-Dist: tox>=4.6.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
Provides-Extra: deploy
Requires-Dist: docker>=6.1.0; extra == "deploy"
Requires-Dist: kubernetes>=26.1.0; extra == "deploy"
Requires-Dist: helm>=0.1.0; extra == "deploy"
Requires-Dist: terraform>=0.1.0; extra == "deploy"
Dynamic: license-file

# BSS Agent

A comprehensive AI agent framework built with LangChain and LangGraph for business support systems.

## Features
- **Authentication**: Support client access via API Key.
- **Server API**: 
    - FastAPI-based REST API
    - Support agent response streaming
- **Security**: 
    - Rate limiter to avoid DDOS
    - Data Privacy protector
    - Prompt santinizer.
- **Environment Management**: Configuration and environment handling
- **Database Integration**:
    - For checkpoints
    - For long memory context (store)
    - Multi DB connection
- **RAGPipeline**:
    - Extract data from multi sources
    - Automatic create embedding model based on name
    - Easy to use Vector DB
- **Core Framework**: Base agent and multi user sessions management
- **Testing**: Comprehensive unit test for all features

## Installation

### From PyPI

```bash
pip install bssagent
```

### From Source

```bash
git clone https://github.com/bssagent/bssagent.git
cd bssagent
pip install -e .
```

### Development Installation

```bash
git clone https://github.com/bssagent/bssagent.git
cd bssagent
pip install -e ".[dev]"
```

## Quick Start

```python
from bssagent.core import BSSAgent
from bssagent.environment import EnvironmentManager

# Initialize environment
env_manager = EnvironmentManager()
env_manager.load_config()

# Create agent
agent = BSSAgent(
    name="business_agent",
    description="Business support agent",
    tools=["file_io", "api_integration", "database"]
)

# Run agent
response = agent.run("Analyze the current business metrics")
print(response)
```

## Project Structure

```
bssagent/
├── src/bssagent/
│   ├── core/           # Core agent framework
│   ├── infrastructure/ # Infrastructure management
│   ├── auth/           # Authentication
│   ├── security/       # Security features
│   ├── environment/    # Environment management
│   ├── mcp/           # Model Context Protocol
│   ├── rag/           # Tool ecosystem
│   ├── database/      # Database integration
│   └── shared/        # Shared utilities
├── tests/             # Test suite
├── docs/              # Documentation
```

## Configuration

Setup Environment Variables

Create a `.env` file in your project root with the following configuration:

```env
# LLM API Keys (choose your preferred provider)
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GOOGLE_API_KEY=your_google_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
OLLAMA_BASE_URL=http://localhost:11434

# LangSmith Tracing (optional)
LANGCHAIN_API_KEY=your_langsmith_api_key
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=your_project_name

# Database Configuration
# Option 1: Use separate databases for checkpointer and store
LANGGRAPH_CHECKPOINTER_TYPE=postgres
LANGGRAPH_CHECKPOINTER_USERNAME=user
LANGGRAPH_CHECKPOINTER_PASSWORD=password
LANGGRAPH_CHECKPOINTER_HOST=localhost
LANGGRAPH_CHECKPOINTER_PORT=5432
LANGGRAPH_CHECKPOINTER_DATABASE=bssagent_checkpoint

LANGGRAPH_STORE_TYPE=postgres
LANGGRAPH_STORE_USERNAME=user
LANGGRAPH_STORE_PASSWORD=password
LANGGRAPH_STORE_HOST=localhost
LANGGRAPH_STORE_PORT=5432
LANGGRAPH_STORE_DATABASE=bssagent_store

# Option 2: Use single database for all purposes
ONE_DB=1
DB_TYPE=postgres
DB_USERNAME=user
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
DB_NAME=bssagent

```

## Setup Database with Docker

BSS Agent supports multiple database backends. The easiest way to get started is using Docker Compose.

### Quick Database Setup

Use the provided Docker Compose file:

```bash
# Navigate to the examples directory
cd examples/dockerdbfile

# Start the databases
docker compose up -d

# Verify containers are running
docker ps
```

This will start:
- **PostgreSQL** on port 5432
- **MySQL** on port 3306  
- **Redis** on port 6379

### Manual Docker Setup

If you prefer to set up databases manually, create a `docker-compose.yml` file:

```yaml
services:
  postgres_db:
    image: postgres:14.18-bookworm
    container_name: postgres_container
    restart: always
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
      POSTGRES_DB: mydatabase
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  mysql_db:
    image: mysql:oracle
    container_name: mysql_container
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: mydatabase
      MYSQL_USER: user
      MYSQL_PASSWORD: password
    ports:
      - "3306:3306"
    volumes:
      - mysql_data:/var/lib/mysql

  redis_db:
    image: redis:bookworm
    container_name: redis_container
    restart: always
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  mysql_data:
  redis_data:
```

Then run:

```bash
docker compose up -d
```

### Database Connection Verification

Test your database connections:

**PostgreSQL:**
```bash
# From host machine
psql -h localhost -U user -d mydatabase

# From Docker container
docker exec -it postgres_container psql -U user -d mydatabase
```

**MySQL:**
```bash
# From host machine
mysql -h localhost -u user -p mydatabase

# From Docker container
docker exec -it mysql_container mysql -u user -p mydatabase
```

**Redis:**
```bash
# From host machine
redis-cli -h localhost -p 6379

# From Docker container
docker exec -it redis_container redis-cli
```

## Supported Database Types

BSS Agent supports the following database backends:

| Database | Type | Use Case |
|----------|------|----------|
| PostgreSQL | `postgres` | Checkpointer and Store |
| MySQL | `mysql` | Checkpointer and Store |
| MongoDB | `mongodb` | Checkpointer only |
| Redis | `redis` | Checkpointer and Store |
| SQLite | `sqlite` | Checkpointer and Store |

## Documentation

- [API Reference](https://bssagent.readthedocs.io/en/latest/api/)
- [User Guide](https://bssagent.readthedocs.io/en/latest/user_guide/)
- [Developer Guide](https://bssagent.readthedocs.io/en/latest/developer/)
- [Deployment Guide](https://bssagent.readthedocs.io/en/latest/deployment/)

## Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- Documentation: https://bssagent.readthedocs.io
- Issues: https://github.com/bssagent/bssagent/issues
- Discussions: https://github.com/bssagent/bssagent/discussions
- Email: team@bssagent.com

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a list of changes and version history. 
