Production Agentic AI, RAG & Computer Vision
Collection
Cloud-native AI agents, citation-grounded RAG systems, and explainable CV models engineered on AWS, LangGraph, and Hugging Face. • 7 items • Updated
An autonomous Python bug-fixing agent orchestrated with LangGraph and powered by Groq. It ingests a GitHub issue or bug report, inspects a repository, writes a failing pytest reproduction test, executes tests in an isolated sandbox, iterates on search/replace code fixes (up to 8 attempts), and pauses for human-in-the-loop approval before committing or exporting a patch.
flowchart TD
A[ingest_issue] --> B[inspect_repo]
B --> C[write_repro_test]
C --> D[run_repro_test]
D -->|fails as expected| E[propose_fix]
D -->|passes: not reproduced| C
E --> F[apply_fix] --> G[run_tests]
G -->|pass| H[human_approval -- interrupt]
G -->|fail, under 8 iterations| I[analyze_failure] --> E
H -->|approve| J[commit_and_pr]
H -->|reject + feedback| I
The full architecture specification is in SPEC.md.
| Pillar | Implementation |
|---|---|
| LLM | Groq (openai/gpt-oss-120b) with structured JSON outputs (src/agent/llm.py) |
| Framework | LangGraph state machine & conditional edge routers (src/agent/graph.py) |
| Memory | AgentState + MemorySaver / PostgresSaver checkpointing (src/agent/state.py) |
| Tools | Path-jailed Workspace, Git/GitHub REST API & Sandbox test runners (src/tools/, src/sandbox/) |
TypedDict state with Pydantic v2 sub-models, pure conditional edge routers, and MemorySaver / PostgresSaver checkpointing.tenacity exponential backoff for 429 rate-limit and transient API errors.RunBudget).summarize_past_attempts) and tail-truncated sandbox outputs to stay well under Groq's 8K tokens/min free tier.DockerSandbox (src/sandbox/docker_runner.py): Locked-down container (non-root user, cap_drop=["ALL"], memory/CPU/PID limits, network disabled).LocalSandbox (src/sandbox/local_runner.py): Subprocess fallback for environments without a Docker daemon (e.g., Streamlit Community Cloud), with environment secret scrubbing and process-tree timeout kills.base/ + work/) so your target repository is never modified until approval. Supports built-in sample repos, local folders, or shallow-cloning any GitHub repository URL.commit_and_pr is reachable only after human_approval resumes from langgraph.types.interrupt().src/
agent/ state.py · llm.py · prompts.py · nodes.py · graph.py
sandbox/ base.py · docker_runner.py · local_runner.py · factory.py · Dockerfile
tools/ file_tools.py · git_tools.py
ui/ streamlit_app.py · mock_graph.py · report_pdf.py
tests/
unit/ test_state.py · test_docker_runner.py · test_routing.py · test_mock_graph.py · test_streamlit_app.py
fixtures/ buggy_repo/
deploy/ cloudshell_deploy.sh · ec2_userdata.sh
Dockerfile · docker-compose.yml · SPEC.md · requirements.txt · pyproject.toml
python -m venv .venv
.\.venv\Scripts\Activate.ps1 # Linux/macOS: source .venv/bin/activate
pip install -e ".[dev,ui]"
copy .env.example .env # Set GROQ_API_KEY in .env
Optional — build the Docker sandbox image if running with Docker:
docker build -t bugfix-agent-sandbox:latest src/sandbox
streamlit run src/ui/streamlit_app.py
In the sidebar you can:
human_approval, then click Approve, Request changes, or Reject.Run the one-command bootstrap scripts in AWS CloudShell (deploy/):
# 1. Launch EC2 Docker instance
curl -sSL https://raw.githubusercontent.com/farazmalik180/autonomous-bug-fixing-agent/main/deploy/cloudshell_deploy.sh | tr -d '\r' | GROQ_API_KEY="gsk_..." bash
# 2. Provision CloudFront HTTPS CDN
curl -sSL https://raw.githubusercontent.com/farazmalik180/autonomous-bug-fixing-agent/main/deploy/aws_https_cloudfront.sh | tr -d '\r' | bash
# 3. Provision S3 Report Bucket, DynamoDB Run History & Lambda Webhook
curl -sSL https://raw.githubusercontent.com/farazmalik180/autonomous-bug-fixing-agent/main/deploy/aws_free_tier_stack.sh | tr -d '\r' | bash
s3://bugfix-agent-reports-706999906997-us-east-1BugFixAgentRunssrc/ui/streamlit_app.py.GROQ_API_KEY = "gsk_..."
SANDBOX_BACKEND = "local"
pytest
Tests marked docker execute real containers and are skipped automatically when no Docker daemon is reachable.
SPEC.md) & project scaffoldingstate.py & docker_runner.py with unit testsfile_tools.py, git_tools.py, and local_runner.pyllm.py), context pruner (prompts.py), LangGraph nodes.py & graph.pytests/fixtures/buggy_repo & interactive Streamlit UI