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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FELON Cortex β Local Cognitive Runtime
|
| 2 |
+
|
| 3 |
+
<p align="center">
|
| 4 |
+
<img src="https://img.shields.io/badge/version-1.0.0-blue?style=flat-square" alt="Version">
|
| 5 |
+
<img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="License">
|
| 6 |
+
<img src="https://img.shields.io/badge/python-3.10+-blue?style=flat-square" alt="Python">
|
| 7 |
+
<img src="https://img.shields.io/badge/platform-linux%20%7C%20macos%20%7C%20android-lightgrey?style=flat-square" alt="Platform">
|
| 8 |
+
<img src="https://img.shields.io/badge/privacy-100%25%20local-purple?style=flat-square" alt="Privacy">
|
| 9 |
+
<img src="https://img.shields.io/badge/offline-ready-orange?style=flat-square" alt="Offline">
|
| 10 |
+
</p>
|
| 11 |
+
|
| 12 |
+
**Give ANY AI model a brain.** Memory. Knowledge. Tools. Verification. Confidence. All running locally. No cloud. No API keys required. Works offline.
|
| 13 |
+
|
| 14 |
+
```
|
| 15 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 16 |
+
β FELON CORTEX β
|
| 17 |
+
β β
|
| 18 |
+
β You βββ FELON βββ Claude / OpenAI / opencode / β
|
| 19 |
+
β any local model β
|
| 20 |
+
β β
|
| 21 |
+
β FELON wraps EVERY interaction with: β
|
| 22 |
+
β 𧬠DNA Memory β Never forgets β
|
| 23 |
+
β π Knowledge Lib β 22 SE textbooks β
|
| 24 |
+
β π Veritas β 6 security + syntax checks β
|
| 25 |
+
β π€ Nanobot Swarm β 8 local tools β
|
| 26 |
+
β π― Confidence β Tells you when it's guessing β
|
| 27 |
+
β π Session Journal β Works offline, syncs later β
|
| 28 |
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## What It Solves
|
| 34 |
+
|
| 35 |
+
| Problem | FELON Solution |
|
| 36 |
+
|---------|---------------|
|
| 37 |
+
| **AI forgets between sessions** | DNA Memory persists everything β picks up where you left off |
|
| 38 |
+
| **Can't code without internet** | Offline mode β local model + 22 textbooks + cached knowledge |
|
| 39 |
+
| **Models lie confidently** | Confidence score on every response: "I'm sure" / "experimental" / "guessing" |
|
| 40 |
+
| **No code verification** | Veritas runs 6 checks: syntax, security, imports, logic, tests, edge cases |
|
| 41 |
+
| **Blank slate every chat** | 22 SE textbooks injected into context automatically |
|
| 42 |
+
| **API downtime = dead project** | Session journal records everything offline, syncs when internet returns |
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## Install
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
git clone https://github.com/AnonymousNomad/felon-cortex.git
|
| 50 |
+
cd felon-cortex
|
| 51 |
+
./install.sh
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Or via pip:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
pip install felon-cortex
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Dependencies: **Python 3.10+ only.** Zero external packages required for core operation.
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## Usage
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
felon start # Start proxy on http://localhost:8080
|
| 68 |
+
felon start --port 9090 # Custom port
|
| 69 |
+
felon status # View memory, sessions, knowledge
|
| 70 |
+
felon sync # Upload offline sessions when internet returns
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
Then point **any tool** at `http://localhost:8080`:
|
| 74 |
+
|
| 75 |
+
| Tool | Configuration |
|
| 76 |
+
|------|--------------|
|
| 77 |
+
| **Claude Desktop** | Settings β Proxy β `http://localhost:8080` |
|
| 78 |
+
| **opencode** | `--api-base http://localhost:8080` |
|
| 79 |
+
| **Continue.dev** | `apiBase: "http://localhost:8080"` in config |
|
| 80 |
+
| **Any OpenAI client** | Set `OPENAI_BASE_URL=http://localhost:8080` |
|
| 81 |
+
| **Local GGUF model** | `felon start --model ./my-model.gguf` |
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## Architecture
|
| 86 |
+
|
| 87 |
+
```
|
| 88 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 89 |
+
β FELON CORTEX β
|
| 90 |
+
β β
|
| 91 |
+
β ββββββββββββ ββββββββββββ ββββββββββββ β
|
| 92 |
+
β β DNA β β KNOWLEDGEβ β VERITAS β β
|
| 93 |
+
β β MEMORY β β LIBRARY β β 6-CHECK β β
|
| 94 |
+
β β β β 22 books β β VERIFIER β β
|
| 95 |
+
β β Remembersβ β Works β β Catches β β
|
| 96 |
+
β β every β β offline β β mistakes β β
|
| 97 |
+
β β session β β β β β β
|
| 98 |
+
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β
|
| 99 |
+
β β β β β
|
| 100 |
+
β ββββββββββββββββΌββββββββββββββ β
|
| 101 |
+
β β β
|
| 102 |
+
β βββββββββββββββββββββ΄βββββββββββββββββββββ β
|
| 103 |
+
β β PROMPT ENRICHMENT β β
|
| 104 |
+
β β Memory context + Knowledge + Context β β
|
| 105 |
+
β βββββββββββββββββββββ¬βββββββββββββββββββββ β
|
| 106 |
+
β β β
|
| 107 |
+
β βΌ β
|
| 108 |
+
β ββββββββββββββββββββββββββββββββββββββββββ β
|
| 109 |
+
β β TARGET MODEL β β
|
| 110 |
+
β β Claude / OpenAI / opencode / local β β
|
| 111 |
+
β βββββββββββββββββββββ¬βββββββββββββββββββββ β
|
| 112 |
+
β β β
|
| 113 |
+
β βββββββββββββββββββββ΄βββββββββββββββββββββ β
|
| 114 |
+
β β RESPONSE PROCESSING β β
|
| 115 |
+
β β Veritas checks + Confidence scoring β β
|
| 116 |
+
β βββββββββββββββββββββ¬βββββββββββββββββββββ β
|
| 117 |
+
β β β
|
| 118 |
+
β βββββββββββββββββββββ΄βββββββββββββββββββββ β
|
| 119 |
+
β β π€ NANOBOT SWARM (8 tools) β β
|
| 120 |
+
β β fs β’ git β’ compile β’ test β’ search β β
|
| 121 |
+
β β shell β’ library β’ web_search β β
|
| 122 |
+
β ββββββββββββββββββββββββββββββββββββββββββ β
|
| 123 |
+
β β β
|
| 124 |
+
β βββββββββββββββββββββ΄βββββββββββββββββββββ β
|
| 125 |
+
β β π SESSION JOURNAL β β
|
| 126 |
+
β β Offline β logs β syncs when online β β
|
| 127 |
+
β ββββββββββββββββββββββββββββββββββββββββββ β
|
| 128 |
+
β β β
|
| 129 |
+
β βΌ β
|
| 130 |
+
β VERIFIED + SCORED + TOOL-EXECUTED OUTPUT β
|
| 131 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
---
|
| 135 |
+
|
| 136 |
+
## Offline Mode
|
| 137 |
+
|
| 138 |
+
When the API is unreachable, FELON Cortex:
|
| 139 |
+
|
| 140 |
+
1. **DNA Memory** β pulls from past sessions (continuity)
|
| 141 |
+
2. **Knowledge Library** β answers from 22 SE textbooks
|
| 142 |
+
3. **Local Model** β falls back to bundled GGUF model (optional)
|
| 143 |
+
4. **Session Journal** β records every prompt, decision, file change
|
| 144 |
+
5. **Auto-Sync** β when internet returns, uploads journal β model is instantly caught up
|
| 145 |
+
|
| 146 |
+
```
|
| 147 |
+
No internet?
|
| 148 |
+
β You keep coding
|
| 149 |
+
β FELON remembers everything
|
| 150 |
+
β Knowledge library fills gaps
|
| 151 |
+
β When internet returns: one sync β model caught up
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## Sub-Systems
|
| 157 |
+
|
| 158 |
+
### 𧬠DNA Memory
|
| 159 |
+
|
| 160 |
+
BM25-ranked retrieval across all past sessions. Gives the model continuity.
|
| 161 |
+
```python
|
| 162 |
+
# FELON automatically adds to every prompt:
|
| 163 |
+
[FELON DNA MEMORY β relevant context from past sessions]
|
| 164 |
+
Past interactions:
|
| 165 |
+
(0.87) "Build REST API with Flask" β "Use Flask blueprints for modular routes..."
|
| 166 |
+
(0.72) "Add JWT auth" β "Use flask-jwt-extended with token refresh..."
|
| 167 |
+
[END MEMORY]
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
### π Knowledge Library
|
| 171 |
+
|
| 172 |
+
22 software engineering textbook entries. Topics: Python, algorithms, data structures, testing, git, security, design patterns, web, concurrency. BM25 retrieval with tag-based boosting. Works completely offline.
|
| 173 |
+
|
| 174 |
+
### π Veritas (6-Check Verifier)
|
| 175 |
+
|
| 176 |
+
Every code block in every response gets checked:
|
| 177 |
+
1. **Syntax** β `compile()` check
|
| 178 |
+
2. **Imports** β resolves every import
|
| 179 |
+
3. **Security** β blocks eval, exec, subprocess, pickle
|
| 180 |
+
4. **Logic** β has def/class/return/control flow
|
| 181 |
+
5. **Tests** β has assert statements
|
| 182 |
+
6. **Edge Cases** β has try/except or if/else
|
| 183 |
+
|
| 184 |
+
### π― Confidence Scoring
|
| 185 |
+
|
| 186 |
+
Every response gets a confidence label:
|
| 187 |
+
- **β
90%+** β High confidence, I'm sure
|
| 188 |
+
- **π 70-89%** β Moderate confidence
|
| 189 |
+
- **π¬ 50-69%** β Experimental, verify
|
| 190 |
+
- **β οΈ 30-49%** β Low confidence, I'm guessing
|
| 191 |
+
- **π« <30%** β I have no idea
|
| 192 |
+
|
| 193 |
+
### π€ Nanobot Swarm
|
| 194 |
+
|
| 195 |
+
8 local tools the model can use:
|
| 196 |
+
| Tool | Actions |
|
| 197 |
+
|------|---------|
|
| 198 |
+
| `fs` | read, write, list, exists, delete, mkdir |
|
| 199 |
+
| `git` | init, add, commit, status, diff, log |
|
| 200 |
+
| `compile` | Syntax-check any Python file |
|
| 201 |
+
| `test` | Run pytest on any directory |
|
| 202 |
+
| `search` | Search codebase for patterns |
|
| 203 |
+
| `shell` | Run safe shell commands |
|
| 204 |
+
| `library` | Query knowledge library |
|
| 205 |
+
| `web_search` | Search allowlisted sites (docs.python.org, stackoverflow, etc.) |
|
| 206 |
+
|
| 207 |
+
### π Session Journal
|
| 208 |
+
|
| 209 |
+
- Records every interaction during offline sessions
|
| 210 |
+
- Tracks: prompts, responses, decisions, file changes, tool use
|
| 211 |
+
- Builds sync summary when internet returns
|
| 212 |
+
- Model instantly catches up on everything that happened offline
|
| 213 |
+
|
| 214 |
+
---
|
| 215 |
+
|
| 216 |
+
## Benchmarks
|
| 217 |
+
|
| 218 |
+
| Metric | Value |
|
| 219 |
+
|--------|:-----:|
|
| 220 |
+
| Prompt enrichment latency | < 50ms |
|
| 221 |
+
| DNA Memory retrieval | < 10ms (BM25) |
|
| 222 |
+
| Knowledge Library query | < 5ms |
|
| 223 |
+
| Veritas 6-check | < 20ms per code block |
|
| 224 |
+
| Offline fallback latency | < 100ms |
|
| 225 |
+
| Memory: 1000 sessions stored | < 5MB disk |
|
| 226 |
+
|
| 227 |
+
---
|
| 228 |
+
|
| 229 |
+
## Development
|
| 230 |
+
|
| 231 |
+
```bash
|
| 232 |
+
git clone https://github.com/AnonymousNomad/felon-cortex.git
|
| 233 |
+
cd felon-cortex
|
| 234 |
+
pip install -e .
|
| 235 |
+
|
| 236 |
+
# Run tests
|
| 237 |
+
python -m pytest tests/
|
| 238 |
+
|
| 239 |
+
# Start dev proxy
|
| 240 |
+
felon start --port 8080
|
| 241 |
+
```
|
| 242 |
+
|
| 243 |
+
---
|
| 244 |
+
|
| 245 |
+
## Roadmap
|
| 246 |
+
|
| 247 |
+
- [x] DNA Memory (BM25 retrieval)
|
| 248 |
+
- [x] Knowledge Library (22 textbooks)
|
| 249 |
+
- [x] Veritas 6-check verifier
|
| 250 |
+
- [x] Nanobot swarm (8 tools)
|
| 251 |
+
- [x] Confidence scoring
|
| 252 |
+
- [x] Offline session journaling
|
| 253 |
+
- [x] Auto-sync on internet restore
|
| 254 |
+
- [ ] Bundled local GGUF model
|
| 255 |
+
- [ ] ChromaDB/FAISS for large-scale memory
|
| 256 |
+
- [ ] Web dashboard
|
| 257 |
+
- [ ] VSCode extension
|
| 258 |
+
- [ ] Multi-user memory isolation
|
| 259 |
+
|
| 260 |
+
---
|
| 261 |
+
|
| 262 |
+
## Project Status
|
| 263 |
+
|
| 264 |
+
**Beta β actively developed.** The core proxy, memory, knowledge library, and veritas layer are built and tested. Nanobot tools and offline sync are functional. Currently expanding the knowledge library and adding bundled local model support.
|
| 265 |
+
|
| 266 |
+
---
|
| 267 |
+
|
| 268 |
+
## Author
|
| 269 |
+
|
| 270 |
+
**FerrellSyntheticIntelligence (James Ferrell)** β built on a tablet with zero VC funding.
|
| 271 |
+
|
| 272 |
+
- GitHub: [AnonymousNomad](https://github.com/AnonymousNomad)
|
| 273 |
+
- HuggingFace: [FerrellSyntheticIntelligence](https://huggingface.co/FerrellSyntheticIntelligence)
|
| 274 |
+
|
| 275 |
+
---
|
| 276 |
+
|
| 277 |
+
## License
|
| 278 |
+
|
| 279 |
+
MIT License β free for personal and commercial use.
|
| 280 |
+
|
| 281 |
+
---
|
| 282 |
+
|
| 283 |
+
<p align="center">
|
| 284 |
+
<b>FELON Cortex</b> β <i>Every model deserves a brain.</i>
|
| 285 |
+
</p>
|