Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ozmed AI, explained simply

Ozmed AI is a chat assistant that lives in your terminal and can actually do things on your computer, not just talk. You type what you want in plain words, and it can run Python code, run PowerShell commands, and search the internet, all on its own, to get the job done.

What this app actually does

Think of it like talking to a very capable assistant who also has their hands on your keyboard. You open a terminal, run the program, and it greets you and waits for you to type.

Startup screen

Once you type something, the assistant does not just answer right away. It first thinks through the request, deciding what you actually want, whether it needs one specific tool to do it, and whether it should search the internet first before trying anything risky. This thinking step is shown to you openly in a small panel, so you can see its reasoning instead of it acting like a black box.

Thinking panel

For simple questions, it just answers in plain text, like a normal chat assistant would.

AI response

For tasks that need real work, it writes and runs actual Python code by itself, and shows you both the code it wrote and the result it got back.

Running a python script

It can also run PowerShell commands directly, which is useful for anything involving files, processes, or general Windows system tasks.

Running a powershell command

And when it needs current information it does not already know, it can search the internet on its own and read the results before continuing.

Searching the internet

The assistant has some built in discipline as well. Once it commits to using one tool for a task, it is not allowed to randomly switch to a different one halfway through. If something involves installing a package or calling an outside service, it is required to search for how to do that safely first, instead of guessing. It also remembers past conversations in a simple memory file, so it does not start from zero every time.

Since it is talking to real AI services behind the scenes, it can sometimes run into normal service hiccups, like being asked to slow down after too many requests in a short time. When that happens, it tells you plainly what went wrong instead of just failing silently.

An error being shown

If more than one access key is available, the app is built to quietly switch to a backup key and keep going instead of stopping completely.

For developers

Tech stack

Ozmed AI is written in Python. It uses the rich library to draw all of the colored panels, spinners, and formatted text you see in the terminal. AI responses come from Groq, using the groq Python package to talk to large language models hosted there. Internet search is handled with duckduckgo-search, and beautifulsoup4 together with requests are used to fetch and read web page content. Configuration and API keys are loaded from a .env file using python-dotenv.

How it is structured

The main.py file is the entry point and contains the main loop that reads your input, sends it to the AI, and decides which tool to run based on the AI's response. The llm_core folder holds the AI side of things, including the chat logic, the API key handling with automatic fallback to backup keys, model selection, and a memory system that saves short term and long term context to JSON files on disk. The runner folder holds the actual tools the assistant can use, one file each for running Python code, running PowerShell commands, and performing an internet search. The ui.py file controls everything you see printed to the terminal, all the panels, colors, and status messages.

How to use it

Clone the repository and install the dependencies.

git clone https://github.com/haider1928/ozmed.git
cd ozmed
pip install -r requirements.txt

Create a .env file in the project folder and add a Groq API key to it. You can add more than one key using names like GROQ_API_KEY, GROQ_API_KEY_2, and so on, and the app will automatically fall back to the next one if a key hits its rate limit.

GROQ_API_KEY=your_key_here

Then run the assistant.

python main.py

Type your request in plain English at the You: prompt, and type exit or quit when you are done.

About

Ozmed AI is a chat assistant that lives in your terminal and can actually do things on your computer, not just talk. You type what you want in plain words, and it can run Python code, run PowerShell commands, and search the internet, all on its own, to get the job done.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages