AI chatbot with functionalities such as tool usage, conversational memory, streaming, RAG etc. built using LangChain.
The project has a simplified structure with all core functionality in a single directory:
.
├── conversify/ # Main package directory
│ ├── __init__.py # Package initialization and exports
│ ├── config.py # Configuration loading and logging setup
│ ├── executor.py # AgentExecutor for running agents
│ ├── memory.py # Various memory implementations
│ ├── streaming.py # Streaming functionality for async responses
│ └── tools.py # Tool implementations for agent use
├── config.yaml # Configuration settings
├── example.py # Example script showing basic usage
├── requirements.txt # Project dependencies
└── logs/ # Directory for log files
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables by creating a
.env
file in the project root:
# Edit the .env file with your API keys
nano .env
- Add your API keys to the
.env
file:
# Google Gemini API Key for LLM
GOOGLE_API_KEY=your_google_api_key_here
# SerpAPI Key for web search
SERPAPI_KEY=your_serpapi_key_here
The project uses config.yaml
for configuration settings. You can customize:
- LLM settings (model, temperature, max tokens)
- Memory type and parameters
- Logging configuration
- Agent settings (max iterations, async mode)
- Tool-specific settings
- Streaming settings
See the config.yaml
file for all available options.
The project includes an example script to demonstrate its capabilities:
python example.py
The example script will:
- Load the configuration from
config.yaml
- Initialize the language model and tools
- Create an agent with the specified memory type
- Run a series of test queries to demonstrate different features
- Show the memory state at the end
- Multiple memory implementations (Buffer, Window, Summary)
- Streaming responses for real-time output
- Various tools (calculator, datetime, web search, etc.)
- Configurable via YAML
- Comprehensive logging
- Async operation mode for improved performance