๐จ Bookoala is an LLM-based autonomous agent designed to help users find and select books based on their preferences.
- Problem Statement
- Workflow
- Technology Stack
- Getting Started
- Usage
- Project Structure
- Design Decisions
- Demo Video
- Future Improvements
Develop a simple LLM-based autonomous agent for book recommendations with the following workflow:
- Allow users to find the top books in fiction or any genre.
The agent follows these steps:
a. User asks the agent for the top 100 books in any genre. b. Agent finds the top 10 books in the given genre from the 100 books. c. Agent helps the user select 1 book from the top ten based on their preferences. d. Agent concludes the workflow with a thank you message. e. The agent is exposed via a REST API endpoint using Streamlit for easy testing.
- LLM: Ollama (llama3:instruct model)
- Frontend: Streamlit
- Backend: Python
- Agent Framework: Custom implementation
- Dependency Management: Poetry
- Python 3.12+
- Ollama installed and running locally
- Poetry for dependency management
- Clone the repository:
git clone https://github.com/swax10/bookoala.git
cd bookoala
- Install dependencies using Poetry:
poetry install
- Run the Streamlit app:
streamlit run main.py
- Open your web browser and go to
http://localhost:8501
. - You'll see the Bookoala interface with a chat input.
- Start by asking for book recommendations in any genre.
- Follow the agent's prompts to narrow down your selection.
main.py
: The main Streamlit applicationagents/bookoala.py
: The Bookoala agent implementationmodels/
: Contains the Ollama and OpenAI model implementationstools/
: Contains the tools used by the agent (e.g., book recommendation tool)prompts/
: Contains prompt templates used by the agentpyproject.toml
: Poetry configuration and dependency management
-
LLM Choice: We chose to use Ollama with the llama3:instruct model for its balance of performance and accessibility. It can run locally, which is beneficial for privacy and cost considerations.
-
Agent Architecture: We implemented a custom agent architecture that allows for flexible tool use and easy extension. This approach was chosen over existing frameworks to have more control over the agent's behavior and to tailor it specifically to the book recommendation task.
-
Streamlit Frontend: Streamlit was selected for its simplicity in creating interactive web applications with Python. It allows for rapid prototyping and easy deployment, making it ideal for this demonstration project.
-
Tool-based Approach: The agent uses a tool-based approach, where different functionalities (like book searching) are encapsulated in separate tools. This modular design allows for easy addition of new capabilities in the future.
-
Poetry for Dependency Management: We chose Poetry for its robust dependency management and packaging capabilities, ensuring consistency across development environments and simplifying the deployment process.
Check out our demo video showcasing the Bookoala in action:
Bookoala.mp4
- Integrate with a larger book database for more comprehensive recommendations
- Implement user profiles to remember preferences across sessions
- Add more sophisticated natural language processing for better understanding of user requests
- Expand the agent's capabilities to include book summaries, author information, etc.