### Start Development Environment (Bash) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Command to start the development environment with hot-reloading capabilities using Docker Compose. ```bash docker-compose -f docker-compose.dev.yml up --build ``` -------------------------------- ### Clone and Run Telegram Bot (Bash) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Commands to clone the repository, set up the environment by copying and editing the .env file, and start the bot's services using Docker Compose. ```bash git clone https://github.com/francescofano/langgraph-telegram-bot.git cd langgraph-telegram-bot cp .env.example .env # Edit .env with your credentials docker-compose up --build ``` -------------------------------- ### Start Telegram Bot Services (Bash) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Command to start the bot's services using a specific Docker Compose file. ```bash docker-compose -f docker-compose.yml up --build ``` -------------------------------- ### Implement Advanced LangGraph (Python) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Python code showing how to set up an advanced LangGraph by defining nodes, conditional edges, and the entry point within the AgentFactory. ```python @staticmethod async def create_advanced_graph(...): graph = StateGraph(Any) graph.add_node("classify_intent", classify_user_intent) graph.add_node("answer_question", answer_general_question) # Define edges graph.add_conditional_edges( "classify_intent", route_by_intent, { "question": "answer_question", "search": "search_knowledge" } ) # Set the entry point graph.set_entry_point("classify_intent") return graph ``` -------------------------------- ### Environment Variables for Telegram Bot (Bash) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Lists essential environment variables for configuring the Telegram bot, including database connection strings, Telegram token, OpenAI API key, and model configurations. ```bash # Database configuration PG_CONNECTION_STRING=postgresql://user:pass@host:port/db REDIS_URL=redis://redis:6379/0 # Telegram configuration TELEGRAM_TOKEN=your_telegram_bot_token DEBOUNCE_TIME=5.0 LLM_CALLS_PER_MINUTE=5 # Agent configuration LLM_MODEL=gpt-4o-mini EMBED_MODEL=openai:text-embedding-3-small VECTOR_DIMS=1536 # API Keys OPENAI_API_KEY=your_openai_key ``` -------------------------------- ### Scale Bot Instances and Add Healthchecks (Bash) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Bash commands for scaling the bot instances using Docker Compose and checking the health of the running services. ```bash # Scale bot instances docker-compose up --scale bot=3 -d # Add healthchecks curl http://localhost:8000/health ``` -------------------------------- ### Add Custom Tool to Agent (Python) Source: https://github.com/francescofano/langgraph-telegram-bot/blob/main/README.md Python code snippet demonstrating how to add a custom tool to the agent's capabilities by modifying the AgentFactory class. ```python # Example: Adding a new tool to the agent from langmem import create_manage_memory_tool from some_package import create_custom_tool class AgentFactory: @staticmethod async def create_agent(...): return create_react_agent( f"openai:{llm_model}", prompt=AgentFactory.create_prompt, tools=[ create_manage_memory_tool(namespace=("memories",)), create_custom_tool() # Add your custom tool here ], checkpointer=checkpointer, store=store, ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.