Skip to main content

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

pip install bssagent

From Source

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

Development Installation

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

Quick Start

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:

# 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:

# 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:

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:

docker compose up -d

Database Connection Verification

Test your database connections:

PostgreSQL:

# From host machine
psql -h localhost -U user -d mydatabase

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

MySQL:

# From host machine
mysql -h localhost -u user -p mydatabase

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

Redis:

# 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

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 file for details.

Support

Changelog

See CHANGELOG.md for a list of changes and version history.

Metadata

Release files for bssagent 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bssagent 0.1.1
File Interpreter ABI Platform Actions
bssagent-0.1.1-py3-none-any.whl Python 3 none any Details for bssagent-0.1.1-py3-none-any.whl

Release files / bssagent-0.1.1-py3-none-any.whl

Download URL bssagent-0.1.1-py3-none-any.whl
Size 66.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f1df122dfe484716f0fa16c1742e9ec486a6f8735451e2d7c1f61505b0c25fa
BLAKE2b-256 checksum
How to use checksums
bfbfc226685e7b5cdab1d9ec8f7360b81456b3ab2c7f36a068e67092c0543970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for bssagent 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page