A collection of CLI agents that use LiteLLM with Function Calling to perform various tasks, with an Orchestrator to coordinate multiple agents.
Manages files autonomously using AI function calling.
Features:
- AI-powered file management
- Function calling for file operations
- Secure path traversal protection
- Conversation history
Browses the internet autonomously using AI function calling.
Features:
- AI-powered web search and page fetching
- Supports Google Custom Search and DuckDuckGo
- Extracts text content from URLs
- Multi-round tool calling support
Creates well-formatted markdown summaries from raw research data.
Features:
- Converts raw search/fetch results into clean markdown
- Organizes content with proper structure
- Includes source citations
See: Summary Agent Documentation
Searches through .txt files using the Okapi BM25 ranking algorithm with LLM-powered adaptive research.
Features:
- BM25 Ranking: Full-text search with relevance scoring
- Persistent Index: Index saved to disk and auto-loaded
- Auto-Reindex: Rebuilds when files change
- Adaptive 20-Turn Research: LLM generates query variations based on found content
- LLM Key Concepts: Extracts key concepts from documents using LLM
- 1008+ Files: Handles large document collections with 25,000+ unique terms
Environment Variables:
| Variable | Description | Default |
|---|---|---|
AI_FOLDER_PATH |
Folder containing .txt files | ./ai_files |
BM25_INDEX_PATH |
Path to save/load index | ./bm25_index.pkl |
Usage:
# Interactive mode
python search_agent.py
# Commands in interactive mode:
/search <query> # Run 20-turn adaptive research
/stats # Show index statistics
/reindex # Rebuild the indexPython API:
from search_agent import (
search_files, # Simple BM25 search
simple_research_loop, # 20-turn adaptive research with LLM
save_full_research_report, # Save complete report with full content
generate_markdown_report, # Generate markdown summary
get_index_stats, # Get index statistics
extract_key_concepts, # Extract concepts using LLM
)
# Simple search
results = search_files("pembaikan kerosakan kecil", top_k=10)
# 20-turn adaptive research (LLM generates queries)
results = simple_research_loop(
"EMBAIKAN KEROSAKAN KECIL PEJABAT KERAJAAN",
max_turns=20,
top_k=10
)
# Save full report with complete document contents
save_full_research_report(results)
generate_markdown_report(results)
# Extract key concepts from content
concepts = extract_key_concepts(document_content, max_concepts=10)How Adaptive Research Works:
- Turn 1: Search with original query
- Turn 2-5: Use LLM to analyze found documents and generate query variations
- Turn 6-15: Continue exploring related terms and concepts
- Turn 16-20: Deep exploration with specific terms from previous results
See: Search Agent Documentation
Coordinates multiple agents using LLM-planned workflows.
Features:
- LLM-Planned Pipelines: The LLM dynamically plans the best agent sequence for each request
- Flexible Input Routing: Each step knows what input to pass (user message, accumulated content, or tool results)
- Extensible Design: Easily add new agents - the LLM will consider them for planning
- Fallback Planning: Simple keyword-based planner if LLM planning fails
- Maintains conversation history across agents
See: Orchestrator Documentation
Set the following environment variables in .env:
| Variable | Description | Default |
|---|---|---|
LITELLM_BASEURL |
LiteLLM API base URL | (required) |
LITELLM_API_KEY |
API key for authentication | (required) |
LITELLM_MODEL |
Model name to use | gpt-3.5-turbo-1106 |
AI_FOLDER_PATH |
Folder for search agent (contains .txt files) | ./ai_files |
BM25_INDEX_PATH |
Path for BM25 index file | ./bm25_index.pkl |
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your LiteLLM settingsModels that support function calling:
gpt-3.5-turbo-1106and newergpt-4-turboand neweropenai/qwen3-vl-235b-a22b-instructazure/chatgpt-functioncallingxai/grok-2-latest- Other function-calling supported models
The Orchestrator uses LLM-powered workflow planning to handle complex multi-step tasks.
# Start the orchestrator
python orchestrator.pyHow it works:
- User submits a request
- LLM analyzes the request and available agents
- LLM creates a dynamic execution plan
- Orchestrator executes each step in sequence
Example commands:
> search for 2025 ai news related to malaysia and save it into .md file
> find information about python tutorials and write to notes.md
> look up latest tech news and create a summary document
> research about EMBAIKAN KEROSAKAN KECIL PEJABAT KERAJAAN using search agent and save results
Example with Search Agent (20-turn research):
> use search_agent loop for 20 times to gather about EMBAIKAN KEROSAKAN KECIL PEJABAT-PEJABAT KERAJAAN NEGERI SABAH
Available commands in Orchestrator:
/agents- List all registered agents/plan <query>- Preview the planned agent pipeline for a query/history- Show conversation history/clear- Clear conversation history/quit- Exit
Dynamic Planning: For any request, the LLM decides which agents to use and in what order. Example output:
[Request] search for 2025 ai news related to malaysia and save it into .md file
[Planning] LLM planned 3 steps
1. web_agent: Research the topic and gather information from the web
2. summary_agent: Create a well-formatted summary from the research
3. file_agent: Write the summary to the specified file
To add a new agent:
-
Create your agent module (e.g.,
db_agent.py) -
Export these required components:
SYSTEM_PROMPT- Agent's system promptTOOLS- List of tool definitionsAVAILABLE_FUNCTIONS- Dict of function name -> callablechat_func(message, history, max_turns)- Chat function
-
Register in orchestrator.py:
def create_db_agent():
import db_agent
return Agent(
name="db_agent",
description="Database operations",
system_prompt=db_agent.SYSTEM_PROMPT,
tools=db_agent.TOOLS,
available_functions=db_agent.AVAILABLE_FUNCTIONS,
chat_func=db_agent.chat,
)
orchestrator.register_agent(create_db_agent())- Python 3.8+
- litellm >= 1.0.0
- httpx >= 0.25.0 (for web agent)
- python-dotenv >= 1.0.0