khojkar (pa: ਖੋਜਕਾਰ, ipa: /kʰoːd͡ʒ.kɑːɾ/) is a deep research agent.
- Python 3.12
- uv - Fast Python package installer and resolver
The easiest way to run khojkar is directly using uvx, which will fetch it from PyPI:
# Run directly from PyPI using uvx
uvx khojkar research --topic "Your research topic" --output report.mdTo set up credentials when using this method, create a .env file in your current working directory with your API keys. uvx will automatically load environment variables from a .env file.
khojkar uses LLMs via the LiteLLM library, which requires API keys for the models you want to use.
-
Create a
.envfile in your current working directory:touch .env
-
Add your API keys to the
.envfile. You only need the key for the model you intend to use. The default isgemini/gemini-2.0-flash, which requires theGEMINI_API_KEY. For other providers like OpenAI or Anthropic, you would useOPENAI_API_KEYorANTHROPIC_API_KEYrespectively. You also need to add credentials for the Google Programmable Search Engine:SEARCH_ENGINE_IDandSEARCH_ENGINE_API_KEY.# Required for the default model (gemini/gemini-2.0-flash) GEMINI_API_KEY=your_gemini_api_key # Required for Google Programmable Search Engine SEARCH_ENGINE_ID=your_search_engine_id SEARCH_ENGINE_API_KEY=your_search_engine_api_key # Optional: add other LLM API keys as needed # OPENAI_API_KEY=your_openai_api_key # ANTHROPIC_API_KEY=your_anthropic_api_key
Note: Refer to the LiteLLM documentation for the specific environment variable names required for different LLM providers.
Basic Usage:
khojkar research --topic "Your research topic" --output report.mdAdvanced Options:
# Use a different model
khojkar research --topic "Your research topic" --model "openai/gpt-4o" --output report.md
# Limit research steps
khojkar research --topic "Your research topic" --max-steps 5 --output report.md
# Use multi-agent research mode
khojkar research --topic "Your research topic" --multi-agent --output report.mdSee LICENSE file for details.