Skip to content

codecravings/omgenesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OmGenesis 🤖

An AI coding agent that learns from its mistakes.
Unlike your last intern, it actually gets better
over time.


What is this?

OmGenesis is a self-improving AI coding agent that
runs in your terminal.
It uses DeepSeek (or Groq, Anthropic, Ollama — your call) to think,
and a growing brain of persistent learnings to
avoid repeating the same dumb mistakes across sessions.

Think of it as a senior dev who:

  • Reads your codebase before touching it
  • Actually remembers what went wrong last time
  • Won't accidentally rm -rf your project
    (probably)
  • Doesn't need coffee, lunch breaks, or a salary

Features

  • Self-improving — reflects after every turn,
    stores learnings, injects them back next session
  • 11 built-in tools — bash, read/write/edit files, search, list dirs, web fetch, move/delete/create
  • Parallel tool execution — read-only calls run concurrently (speed goes brrr)
  • Multi-provider — DeepSeek (default), Groq,
    Anthropic, Ollama (offline)
  • Session persistence — resume exactly where you
    left off
  • Shell hooks — run custom scripts before/after
    any tool call
  • Conversation compaction — summarizes old context to save tokens when things get long
  • Cost tracking — so you know exactly how broke
    you're getting

Install

git clone https://github.com/codecravings/omgenesis
cd omgenesis                                
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
                                                      
Set your API key:                           
export DEEPSEEK_API_KEY="sk-..."                      
                                                    
Run it:                                               
omgenesis                          # interactive REPL
omgenesis "refactor this mess"     # one-shot         
omgenesis --provider groq          # fast mode      
omgenesis --offline                # local Ollama, no 
API key needed                                        
omgenesis --resume latest          # pick up where you
 left off
                                                      
---                                                 
Tools                                                 
                                                      
┌────────────┬───────────────────┬────────────────┐
│    Tool    │   What it does    │   Permission   │   
├────────────┼───────────────────┼────────────────┤ 
│ bash       │ Runs shell        │ full-access    │
│            │ commands          │                │
├────────────┼───────────────────┼────────────────┤   
│ read_file  │ Reads a file with │ read-only      │
│            │  line numbers     │                │   
├────────────┼───────────────────┼────────────────┤ 
│ write_file │ Creates/overwrite │ workspace-writ │   
│            │ s a file          │ e              │
├────────────┼───────────────────┼────────────────┤   
│ edit_file  │ Surgical string   │ workspace-writ │ 
│            │ replacement       │ e              │
├────────────┼───────────────────┼────────────────┤
│ glob_searc │ Finds files by    │ read-only      │
│ h          │ pattern           │                │   
├────────────┼───────────────────┼────────────────┤
│ grep_searc │ Searches file     │ read-only      │   
│ h          │ contents by regex │                │ 
├────────────┼───────────────────┼────────────────┤
│ list_dir   │ Lists a directory │ read-only      │
│            │  with sizes       │                │   
├────────────┼───────────────────┼────────────────┤
│ web_fetch  │ Fetches a URL,    │ read-only      │   
│            │ strips HTML       │                │ 
├────────────┼───────────────────┼────────────────┤
│ move_file  │ Moves or renames  │ workspace-writ │
│            │ files             │ e              │   
├────────────┼───────────────────┼────────────────┤
│ delete_fil │ Deletes           │ workspace-writ │   
│ e          │ files/dirs        │ e              │   
├────────────┼───────────────────┼────────────────┤
│ create_dir │ Makes directories │ workspace-writ │   
│            │                   │ e              │ 
└────────────┴───────────────────┴────────────────┘

---                                                   
Slash Commands
                                                      
┌────────────┬─────────────────────────────────────┐
│  Command   │                Does                 │
├────────────┼─────────────────────────────────────┤
│ /help      │ Lists all commands                  │
├────────────┼─────────────────────────────────────┤
│ /switch    │ Hot-swap provider mid-session       │
├────────────┼─────────────────────────────────────┤
│ /tools     │ Shows tools + permission levels     │
├────────────┼─────────────────────────────────────┤
│ /status    │ Tokens, turns, cost so far          │  
├────────────┼─────────────────────────────────────┤
│ /compact   │ Summarize old messages to save      │  
│            │ tokens                              │
├────────────┼─────────────────────────────────────┤  
│ /learnings │ What the agent has learned about    │
│            │ you                                 │  
├────────────┼─────────────────────────────────────┤
│ /reset     │ Fresh session + rebuilt system      │  
│            │ prompt                              │
├────────────┼─────────────────────────────────────┤  
│ /model     │ Show or change the model            │
├────────────┼─────────────────────────────────────┤  
│ /cost      │ How much damage you've done         │
├────────────┼─────────────────────────────────────┤  
│ /exit      │ Goodbye                             │
└────────────┴─────────────────────────────────────┘
                                        
---
How the self-improvement works                        
                              
After every turn, OmGenesis:                          
1. Looks at what tools succeeded and which ones     
faceplanted                                    
2. Extracts learnings (e.g. "use longer old_string 
next time", "check paths before reading")             
3. Saves them to ~/.config/omgenesis/learnings.json   
4. Injects them into the system prompt for the next   
session                                               
                                                      
It's like a developer who actually reads the
post-mortem and changes their behaviour.              
Revolutionary concept, I know.                      
                                                      
---                                                   
Providers
                                                      
┌───────────┬──────────┬───────┬──────────────────┐ 
│ Provider  │  Speed   │ Cost  │      Notes       │ 
├───────────┼──────────┼───────┼──────────────────┤ 
│ DeepSeek  │ Fast     │ Cheap │ Default. Strong  │ 
│           │          │       │ reasoning.       │ 
├───────────┼──────────┼───────┼──────────────────┤   
│ Groq      │ Very     │ Free  │ Great for quick  │
│           │ fast     │ tier  │ tasks            │   
├───────────┼──────────┼───────┼──────────────────┤ 
│ Anthropic │ Smart    │ $$$   │ For when you     │
│           │          │       │ really mean it   │   
├───────────┼──────────┼───────┼──────────────────┤
│           │          │       │ Fully offline,   │   
│ Ollama    │ Slow-ish │ Free  │ no data leaves   │   
│           │          │       │ your machine     │
└───────────┴──────────┴───────┴──────────────────┘   
                                                    
Switch anytime with /switch or --provider.  
                                        
---
Project structure                                     

clwad/                                                
├── agent/        # self-improving layer (reflection,
learnings)                                  
├── api/          # provider clients (DeepSeek, Groq,
Anthropic, Ollama)                          
├── cli/          # REPL, slash commands, rendering   
├── hooks/        # pre/post tool-use shell hooks
├── runtime/      # agent loop, config, session,      
prompt builder                                      
├── tools/        # all 11 tool implementations       
└── web/          # WebSocket server for remote       
session control                                       
                                                      
---                                                   
Config                                                
      
Reads from (in order, last wins):                     
                                                    
1. Defaults                             
2. ~/.config/omgenesis/config.json
3. .omgenesis/config.json in project dir              
4. Environment variables                    
                                                      
{                                                   
  "provider": "deepseek",                             
  "model": "deepseek-chat",
  "max_tokens": 8192                                  
}                                                   
                                        
Env vars: DEEPSEEK_API_KEY, GROQ_API_KEY,   
ANTHROPIC_API_KEY, OMGENESIS_MODEL, OMGENESIS_PROVIDER

---                                                   
Hooks                                               
                                                      
Run custom scripts before/after any tool:           

{                                           
  "pre_tool_hooks":                     
["~/.config/omgenesis/hooks/pre.sh"],
  "post_tool_hooks":                                  
["~/.config/omgenesis/hooks/post.sh"]       
}                                                     
                                                    
Exit code 2 = deny the tool call. Everything else =   
allow.                                  
Env vars injected: OMGENESIS_TOOL_NAME,               
OMGENESIS_TOOL_INPUT, OMGENESIS_TOOL_OUTPUT.          
                                        
---                                                   
Requirements                                          

- Python 3.11+                                        
- A working internet connection (or Ollama for      
offline)                                    
- An API key for your chosen provider   
- The audacity to let an AI touch your codebase
                                                      
---                                     
License                                               
                                                      
MIT. Do whatever you want with it.
If it deletes your project, that's on you. Read the   
permission levels.                                  
                                        
---                                                   
Built by https://github.com/codecravings   

About

OmGenesis — A self-improving AI coding agent. DeepSeek-powered, multi-provider, with persistent learning across sessions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors