NOT-OMEGA commited on
Commit
18f406e
·
verified ·
1 Parent(s): 7286998

Delete README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -222
README.md DELETED
@@ -1,222 +0,0 @@
1
- ---
2
- title: AutoForge
3
- emoji: 🤖
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: docker
7
- pinned: false
8
- license: mit
9
- ---
10
-
11
- # AutoForge (AgentOS)
12
-
13
- AutoForge is an autonomous DAG-based code generation and verification platform. Users submit natural-language software tasks; the system plans, generates code, tests, analyzes, executes in Docker, verifies, and autonomously repairs failures — with full workflow history persisted in PostgreSQL.
14
-
15
- **Project Status:** Fully implemented MVP (Phases 1-20 completed).
16
-
17
- The system supports the full autonomous loop:
18
- - Frontend React DAG visualization and event streaming
19
- - Gemini 3.1 Pro LLM adapter for planning and code generation
20
- - Docker Sandbox execution and verification
21
- - Automated failure diagnosis and repair
22
- - Full PostgreSQL state persistence and user isolation
23
-
24
- ## Architecture
25
-
26
- ```mermaid
27
- flowchart TB
28
- FE[Frontend] --> API[Backend API]
29
- API --> ORCH[Workflow Orchestrator]
30
- ORCH --> PLANNER[Planner LLM]
31
- ORCH --> MEM[(PostgreSQL)]
32
- PLANNER --> DAG[DAG Engine]
33
- DAG --> CODE[Code Agent]
34
- DAG --> TEST[Test Agent]
35
- DAG --> ANALYSIS[Static Analysis]
36
- CODE --> DOCKER[Docker Sandbox]
37
- TEST --> DOCKER
38
- ANALYSIS --> DOCKER
39
- DOCKER --> VERIFY[Verification]
40
- ```
41
-
42
- Phase 1 implements the **API**, **PostgreSQL memory layer**, **authentication**, **LLM provider abstraction**, and **workflow persistence**.
43
-
44
- ## Repository Structure
45
-
46
- ```text
47
- AgentOS/
48
- ├── backend/ # FastAPI application
49
- │ ├── api/ # HTTP routes (auth, workflows, settings)
50
- │ ├── agents/ # Agent modules (Phase 2+)
51
- │ ├── orchestration/ # DAG engine (Phase 2+)
52
- │ ├── execution/ # Docker sandbox (Phase 2+)
53
- │ ├── analysis/ # Static analysis (Phase 2+)
54
- │ ├── memory/ # Workflow repository
55
- │ ├── llm/ # Provider abstraction
56
- │ ├── db/ # Models and migrations
57
- │ └── events/ # Event publisher
58
- ├── frontend/ # React + Vite web UI (Phase 5)
59
- ├── benchmark/ # Evaluation suite (Phase 5)
60
- ├── docker/ # Dockerfiles
61
- ├── tests/ # Backend tests
62
- ├── docker-compose.yml
63
- └── .env.example
64
- ```
65
-
66
- ## Local Setup
67
-
68
- ### Prerequisites
69
-
70
- - Docker and Docker Compose
71
- - Python 3.12+ (for local development without Docker)
72
-
73
- ### Quick Start (Docker)
74
-
75
- ```bash
76
- cp .env.example .env
77
- docker compose up --build -d
78
- ```
79
-
80
- ### Hugging Face Space Deployment
81
- For deploying AutoForge to a public Hugging Face Space, please refer to the [Hugging Face Deployment Guide](HUGGINGFACE_DEPLOYMENT.md).
82
-
83
- Services:
84
-
85
- | Service | URL |
86
- |-----------|----------------------------|
87
- | Frontend | http://localhost:5173 |
88
- | Backend | http://localhost:8000 |
89
- | API docs | http://localhost:8000/docs |
90
- | PostgreSQL| localhost:5432 |
91
-
92
- Migrations run automatically when the backend container starts.
93
-
94
- ### Local Development (without Docker backend)
95
-
96
- ```bash
97
- # Start PostgreSQL only
98
- docker compose up -d postgres
99
-
100
- # Create virtual environment and install dependencies
101
- python -m venv .venv
102
- source .venv/bin/activate # Windows: .venv\Scripts\activate
103
- pip install -r backend/requirements.txt
104
-
105
- # Copy and configure environment
106
- cp .env.example .env
107
-
108
- # Run migrations
109
- alembic upgrade head
110
-
111
- # Start API server
112
- uvicorn backend.main:app --reload --port 8000
113
- ```
114
-
115
- ### Frontend Development
116
-
117
- ```bash
118
- cd frontend
119
- npm install
120
- npm run dev
121
- ```
122
-
123
- The Vite dev server runs at http://localhost:5173 and proxies `/api` requests to the backend at http://localhost:8000.
124
-
125
- For Docker (backend + frontend + PostgreSQL):
126
-
127
- ```bash
128
- docker compose up --build
129
- ```
130
-
131
- ## Environment Variables
132
-
133
- See [`.env.example`](.env.example). Key variables:
134
-
135
- | Variable | Description |
136
- |----------------|------------------------------------------|
137
- | `DATABASE_URL` | Async PostgreSQL connection string |
138
- | `SECRET_KEY` | JWT signing secret |
139
- | `ENCRYPTION_KEY` | Key material for API credential encryption |
140
- | `MAX_RETRIES` | Max repair attempts (default: 4) |
141
- | `DOCKER_HOST` | Docker socket for sandbox (later phases) |
142
-
143
- Never commit `.env` files with real secrets.
144
-
145
- ## API Endpoints (Phase 1)
146
-
147
- | Method | Endpoint | Description |
148
- |--------|---------------------------------|--------------------------|
149
- | POST | `/auth/signup` | Create account |
150
- | POST | `/auth/login` | Obtain JWT token |
151
- | GET | `/auth/me` | Current user |
152
- | POST | `/workflows` | Create workflow |
153
- | GET | `/workflows` | List user workflows |
154
- | GET | `/workflows/{workflow_id}` | Get workflow details |
155
- | POST | `/workflows/{workflow_id}/start` | Plan, validate, and execute DAG |
156
- | GET | `/workflows/{workflow_id}/tasks` | List workflow tasks |
157
- | GET | `/workflows/{workflow_id}/events` | List workflow events (supports `after_id`) |
158
- | GET | `/workflows/{workflow_id}/events/stream` | SSE live event stream |
159
- | GET | `/workflows/{workflow_id}/attempts` | List repair/execution attempts |
160
- | GET | `/settings/providers` | List LLM providers and models |
161
- | POST | `/settings/api-credentials` | Store encrypted API key |
162
- | GET | `/settings/api-credentials` | List credentials (redacted) |
163
- | DELETE | `/settings/api-credentials/{id}` | Delete credential |
164
- | GET | `/health` | Health + DB connectivity |
165
-
166
- ## Database Schema
167
-
168
- PostgreSQL tables (Phase 1):
169
-
170
- - `users` — authentication
171
- - `workflows` — workflow records with status and planner output
172
- - `tasks` — DAG task nodes (schema ready; populated in Phase 2)
173
- - `attempts` — generation/execution attempts
174
- - `events` — workflow event stream
175
- - `api_credentials` — encrypted user LLM API keys
176
-
177
- ## LLM Provider Abstraction
178
-
179
- Providers implement:
180
-
181
- - `generate()` — text completion
182
- - `generate_structured()` — JSON output
183
- - `estimate_cost()` — token cost estimation
184
-
185
- Currently supported: **OpenAI** and **Gemini**.
186
- The workflow engine resolves providers through `get_llm_provider()` — no provider-specific code in API routes.
187
-
188
- Users can securely enter their own API keys (OpenAI or Gemini) directly in the frontend Settings page. The keys are encrypted at rest in the database and automatically injected into the containerized runner during execution.
189
-
190
- ## Running Tests
191
-
192
- ```bash
193
- # Ensure PostgreSQL is running
194
- docker compose up -d postgres
195
-
196
- # Run migrations (if not already applied)
197
- alembic upgrade head
198
-
199
- # Install dependencies and run tests
200
- pip install -r backend/requirements.txt
201
- pytest -v
202
- ```
203
-
204
- Tests use a real PostgreSQL connection and truncate tables between test cases.
205
-
206
- ## Security Considerations
207
-
208
- - Passwords stored as bcrypt hashes
209
- - API keys encrypted at rest (Fernet-derived key from `ENCRYPTION_KEY`)
210
- - JWT authentication on all workflow endpoints
211
- - Users cannot access other users' workflows
212
- - Generated code execution will run only inside Docker (Phase 2+)
213
-
214
- ## Known Limitations
215
-
216
- - Docker sandbox requires Docker on the host for real code execution
217
- - LLM calls require a valid API key (OpenAI supported)
218
- - Benchmark runner not yet implemented
219
-
220
- ## License
221
-
222
- See LICENSE (to be added).