A lightweight implementation of a ReAct Agent (Reasoning and Acting) built with Python and LiteLLM.
first_agent/ βββ main.py # The Agent Loop βββ tools.py # File system functions βββ requirements.txt # Dependencies βββ README.md # Documentation
- Recursive Search: Automatically looks for files in current and parent directories if the path isn't provided.
- Tool Use: Demonstrates how an LLM can interact with a local file system via structured JSON actions.
- Short-term Memory: The agent remembers previous steps to complete complex tasks.
list_files: Inspects directory contents.find_file: Smart search across directory levels.read_and_summarize: Reads local files and generates insights.
- Clone the repo.
- Install dependencies:
pip install litellm openai - Set your API Key:
export OPENAI_API_KEY='your_key_here' - Run:
python main.py