Skip to content

Paraschamoli/books-recommendation-agent

 
 

Repository files navigation

bindu Logo

books-recommender-agent

An intelligent AI agent that delivers personalized book suggestions based on reader preferences, favorite titles, genres, ratings, reviews, and upcoming releases. It analyzes input to curate tailored literary recommendations with detailed metadata like author, genre, plot summary, and ratings. Ideal for discovering new reads, genre-specific lists, or books similar to favorites, this agent helps users explore diverse fiction and non-fiction options with contextual, engaging suggestions

Build status License


📖 Overview

An intelligent AI agent that delivers personalized book suggestions based on reader preferences, favorite titles, genres, ratings, reviews, and upcoming releases. It analyzes input to curate tailored literary recommendations with detailed metadata like author, genre, plot summary, and ratings. Ideal for discovering new reads, genre-specific lists, or books similar to favorites, this agent helps users explore diverse fiction and non-fiction options with contextual, engaging suggestions. Built on the Bindu Agent Framework for the Internet of Agents.

Key Capabilities:

  • � Personalized book recommendations using Exa search
  • 🎯 Analysis of reader preferences and reading history
  • ⭐ Integration of ratings and reviews from Goodreads/StoryGraph
  • � Detailed book metadata including genres, awards, and content warnings
  • 🔮 Support for diverse genres and author perspectives

🚀 Quick Start

Prerequisites

  • Python 3.10+
  • uv package manager
  • API keys for OpenRouter and Mem0 (both have free tiers)

Installation

# Clone the repository
git clone https://github.com/raahulrahl/books-recommender-agent.git
cd books-recommender-agent

# Create virtual environment
uv venv --python 3.12.9
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
uv sync

# Configure environment
cp .env.example .env

Configuration

Edit .env and add your API keys:

Key Get It From Required
OPENROUTER_API_KEY OpenRouter ✅ Yes
MEM0_API_KEY Mem0 Dashboard If you want to use Mem0 tools

Run the Agent

# Start the agent
uv run python -m books_recommender_agent

# Agent will be available at http://localhost:3773

Github Setup

# Initialize git repository and commit your code
git init -b main
git add .
git commit -m "Initial commit"

# Create repository on GitHub and push (replace with your GitHub username)
gh repo create raahulrahl/books-recommender-agent --public --source=. --remote=origin --push

💡 Usage

Example Queries

# Get personalized recommendations
"I loved The Night Circus and The Invisible Life of Addie LaRue. Can you recommend similar books?"

# Genre-specific search
"Recommend 5 fantasy books with strong female protagonists published in the last 2 years"

# Based on preferences
"I enjoy literary fiction with magical realism elements, around 300-400 pages"

Input Formats

Plain Text:

I'm looking for mystery novels similar to Agatha Christie with modern settings

JSON:

{
  "role": "user",
  "content": "Recommend science fiction books with themes of AI and consciousness"
}

Output Structure

The agent returns structured output with:

  • Book Recommendations: Title, author, publication year
  • Detailed Metadata: Genre, ratings, page count, awards
  • Summaries: Engaging plot descriptions and content advisories
  • Additional Info: Series information, similar authors, audiobook availability

🔌 API Usage

The agent exposes a RESTful API when running. Default endpoint: http://localhost:3773

Quick Start

For complete API documentation, request/response formats, and examples, visit:

📚 Bindu API Reference - Send Message to Agent

Additional Resources


🎯 Skills

personalized-book-recommendation (v1.0.0)

Primary Capability:

  • Curates personalized book recommendations using Exa search
  • Analyzes reader preferences and reading patterns
  • Provides comprehensive book metadata and ratings

Features:

  • Exa-powered book discovery and search
  • Goodreads/StoryGraph rating integration
  • Content warnings and trigger advisories
  • Series information and author suggestions
  • Markdown-formatted recommendations with emoji indicators

Best Used For:

  • Finding books similar to favorites
  • Genre-specific recommendations
  • Discovering new authors and diverse perspectives
  • Getting detailed book information with ratings

Not Suitable For:

  • Academic paper recommendations
  • Technical documentation searches
  • Non-book media recommendations

Performance:

  • Average processing time: ~1-2 seconds
  • Max concurrent requests: 10
  • Memory per request: 256MB

🐳 Docker Deployment

Local Docker Setup

# Build and run with Docker Compose
docker-compose up --build

# Agent will be available at http://localhost:3773

Docker Configuration

The agent runs on port 3773 and requires:

  • OPENROUTER_API_KEY environment variable
  • MEM0_API_KEY environment variable

Configure these in your .env file before running.

Production Deployment

# Use production compose file
docker-compose -f docker-compose.prod.yml up -d

🌐 Deploy to bindus.directory

Make your agent discoverable worldwide and enable agent-to-agent collaboration.

Setup GitHub Secrets

# Authenticate with GitHub
gh auth login

# Set deployment secrets
gh secret set BINDU_API_TOKEN --body "<your-bindu-api-key>"
gh secret set DOCKERHUB_TOKEN --body "<your-dockerhub-token>"

Get your keys:

Deploy

# Push to trigger automatic deployment
git push origin main

GitHub Actions will automatically:

  1. Build your agent
  2. Create Docker container
  3. Push to Docker Hub
  4. Register on bindus.directory

🛠️ Development

Project Structure

books-recommender-agent/
├── books_recommender_agent/
│   ├── skills/
│   │   └── books_recommender_agent/
│   │       ├── skill.yaml          # Skill configuration
│   │       └── __init__.py
│   ├── __init__.py
│   ├── __main__.py
│   ├── main.py                     # Agent entry point
│   └── agent_config.json           # Agent configuration
├── tests/
│   └── test_main.py
├── .env.example
├── docker-compose.yml
├── Dockerfile.agent
└── pyproject.toml

Running Tests

make test              # Run all tests
make test-cov          # With coverage report

Code Quality

make format            # Format code with ruff
make lint              # Run linters
make check             # Format + lint + test

Pre-commit Hooks

# Install pre-commit hooks
uv run pre-commit install

# Run manually
uv run pre-commit run -a

🤝 Contributing

Contributions are welcome! Please follow these steps:

  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

See CONTRIBUTING.md for detailed guidelines.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Powered by Bindu

Built with the Bindu Agent Framework

Why Bindu?

  • 🌐 Internet of Agents: A2A, AP2, X402 protocols for agent collaboration
  • Zero-config setup: From idea to production in minutes
  • 🛠️ Production-ready: Built-in deployment, monitoring, and scaling

Build Your Own Agent:

uvx cookiecutter https://github.com/getbindu/create-bindu-agent.git

📚 Resources


Built with 💛 by the team from Amsterdam 🌷

⭐ Star this repo💬 Join Discord🌐 Agent Directory

About

An intelligent AI agent that delivers personalized book suggestions based on reader preferences, favorite titles, genres, ratings, reviews, and upcoming releases. It analyzes input to curate tailored literary recommendations with detailed metadata like author, genre, plot summary, and ratings

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 88.5%
  • Makefile 10.2%
  • Shell 1.3%