fcht-agent 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fcht_agent-0.1.0/LICENSE +21 -0
- fcht_agent-0.1.0/PKG-INFO +255 -0
- fcht_agent-0.1.0/README.md +209 -0
- fcht_agent-0.1.0/fcht_agent/__init__.py +13 -0
- fcht_agent-0.1.0/fcht_agent/cli/__init__.py +0 -0
- fcht_agent-0.1.0/fcht_agent/cli/main.py +317 -0
- fcht_agent-0.1.0/fcht_agent/config/__init__.py +3 -0
- fcht_agent-0.1.0/fcht_agent/config/schema.py +102 -0
- fcht_agent-0.1.0/fcht_agent/core/__init__.py +3 -0
- fcht_agent-0.1.0/fcht_agent/core/agent.py +214 -0
- fcht_agent-0.1.0/fcht_agent/daemon/server.py +164 -0
- fcht_agent-0.1.0/fcht_agent/memory/__init__.py +5 -0
- fcht_agent-0.1.0/fcht_agent/memory/embeddings.py +77 -0
- fcht_agent-0.1.0/fcht_agent/memory/episodic.py +71 -0
- fcht_agent-0.1.0/fcht_agent/memory/semantic.py +172 -0
- fcht_agent-0.1.0/fcht_agent/skills/__init__.py +3 -0
- fcht_agent-0.1.0/fcht_agent/skills/model_downloader.py +49 -0
- fcht_agent-0.1.0/fcht_agent/skills/registry.py +222 -0
- fcht_agent-0.1.0/fcht_agent/tools/__init__.py +4 -0
- fcht_agent-0.1.0/fcht_agent/tools/comfyui.py +220 -0
- fcht_agent-0.1.0/fcht_agent/tools/registry.py +296 -0
- fcht_agent-0.1.0/fcht_agent.egg-info/PKG-INFO +255 -0
- fcht_agent-0.1.0/fcht_agent.egg-info/SOURCES.txt +31 -0
- fcht_agent-0.1.0/fcht_agent.egg-info/dependency_links.txt +1 -0
- fcht_agent-0.1.0/fcht_agent.egg-info/entry_points.txt +3 -0
- fcht_agent-0.1.0/fcht_agent.egg-info/requires.txt +19 -0
- fcht_agent-0.1.0/fcht_agent.egg-info/top_level.txt +1 -0
- fcht_agent-0.1.0/pyproject.toml +90 -0
- fcht_agent-0.1.0/setup.cfg +4 -0
- fcht_agent-0.1.0/setup.py +35 -0
- fcht_agent-0.1.0/tests/test_agent.py +81 -0
- fcht_agent-0.1.0/tests/test_memory.py +147 -0
- fcht_agent-0.1.0/tests/test_skills.py +103 -0
fcht_agent-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joseph Brown & Newton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fcht-agent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: First-Class Hermes Tool Agent โ Offline ReAct agent with dual memory (episodic + semantic), skill learning, and daemon mode
|
|
5
|
+
Author-email: Joseph Brown <commanderbrown@ppcrepair.com>
|
|
6
|
+
Maintainer-email: FCHT Team <commanderbrown@ppcrepair.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/fcht-agent/fcht-agent
|
|
9
|
+
Project-URL: Repository, https://github.com/fcht-agent/fcht-agent
|
|
10
|
+
Project-URL: Issues, https://github.com/fcht-agent/fcht-agent/issues
|
|
11
|
+
Project-URL: Documentation, https://github.com/fcht-agent/fcht-agent/blob/main/README.md
|
|
12
|
+
Project-URL: Changelog, https://github.com/fcht-agent/fcht-agent/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: ai-agent,offline-ai,local-llm,react-agent,rag,chromadb,ollama,autonomous-agent,hermes,memory-augmented
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: requests>=2.32
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Requires-Dist: chromadb>=1.5
|
|
31
|
+
Requires-Dist: sentence-transformers>=5.5
|
|
32
|
+
Requires-Dist: pydantic>=2.10
|
|
33
|
+
Requires-Dist: pydantic-settings>=2.6
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
37
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
38
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
39
|
+
Requires-Dist: pre-commit>=3.0; extra == "dev"
|
|
40
|
+
Provides-Extra: gpu
|
|
41
|
+
Requires-Dist: torch>=2.0; extra == "gpu"
|
|
42
|
+
Provides-Extra: all
|
|
43
|
+
Requires-Dist: torch>=2.0; extra == "all"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
Dynamic: requires-python
|
|
46
|
+
|
|
47
|
+
# FCHT Agent โ First-Class Hermes Tool Agent
|
|
48
|
+
|
|
49
|
+
> **Offline ReAct agent with persistent dual-memory (episodic + semantic) โ runs entirely on your hardware.**
|
|
50
|
+
|
|
51
|
+
[](https://python.org)
|
|
52
|
+
[](LICENSE)
|
|
53
|
+
[](https://github.com)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ๐ฏ What Is This?
|
|
58
|
+
|
|
59
|
+
**FCHT Agent** is a local-first AI agent that runs **100% offline** on your machine using [Ollama](https://ollama.ai) and your choice of local LLM (default: `qwen2.5:7b`). It features:
|
|
60
|
+
|
|
61
|
+
| Capability | Description |
|
|
62
|
+
|------------|-------------|
|
|
63
|
+
| **ReAct Loop** | Think โ Act โ Observe reasoning with tool use |
|
|
64
|
+
| **Episodic Memory** | JSONL few-shot history for context-aware responses |
|
|
65
|
+
| **Semantic Memory** | ChromaDB + sentence-transformers for RAG |
|
|
66
|
+
| **Skill System** | Agent writes executable Python tools to `memory/skills/` |
|
|
67
|
+
| **7 Built-in Tools** | shell, read/write files, python_exec, list_files, remember, retrieve |
|
|
68
|
+
| **Daemon Mode** | JSON-RPC over stdin/stdout for low-latency reuse |
|
|
69
|
+
| **CLI + Config** | Full argparse interface, YAML/env config, health checks |
|
|
70
|
+
|
|
71
|
+
**Zero cloud calls after initial model pull. Your data never leaves your machine.**
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## ๐ Quick Start
|
|
76
|
+
|
|
77
|
+
### Prerequisites
|
|
78
|
+
- Python 3.10+
|
|
79
|
+
- [Ollama](https://ollama.ai) installed and running
|
|
80
|
+
- Pull a model: `ollama pull qwen2.5:7b`
|
|
81
|
+
|
|
82
|
+
### Install
|
|
83
|
+
```bash
|
|
84
|
+
pip install -e .
|
|
85
|
+
# or from PyPI (when published)
|
|
86
|
+
pip install fcht-agent
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Verify Installation
|
|
90
|
+
```bash
|
|
91
|
+
fcht-agent doctor
|
|
92
|
+
# โ Ollama: http://localhost:11434
|
|
93
|
+
# โ Target model 'qwen2.5:7b' available
|
|
94
|
+
# โ All memory dirs exist
|
|
95
|
+
# All checks passed โ
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Run a Task
|
|
99
|
+
```bash
|
|
100
|
+
# One-shot
|
|
101
|
+
fcht-agent run "What is the project name? Use retrieve."
|
|
102
|
+
|
|
103
|
+
# JSON output for scripting
|
|
104
|
+
fcht-agent --json run "List skills in memory/skills"
|
|
105
|
+
# {"result": "...", "episodes_added": 1, "steps_taken": 2, "success": true}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Daemon Mode (Fast, Model Stays Loaded)
|
|
109
|
+
```bash
|
|
110
|
+
# Terminal 1: start daemon
|
|
111
|
+
fcht-agent-daemon
|
|
112
|
+
# {"jsonrpc": "2.0", "method": "ready", "params": {"model": "qwen2.5:7b"}}
|
|
113
|
+
|
|
114
|
+
# Terminal 2: send requests
|
|
115
|
+
echo '{"task": "What is the project name?", "id": "req-1"}' | fcht-agent-daemon
|
|
116
|
+
# {"id": "req-1", "result": {"output": "...", "episodes_added": 1, "steps_taken": 2, "success": true}}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## ๐ง Memory Architecture
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
memory/
|
|
125
|
+
โโโ episodes.jsonl # Episodic: few-shot conversation history
|
|
126
|
+
โโโ chroma/ # Semantic: ChromaDB vector store
|
|
127
|
+
โ โโโ chroma.sqlite3
|
|
128
|
+
โ โโโ ...
|
|
129
|
+
โโโ skills/ # Procedural: learned Python tools
|
|
130
|
+
โโโ hello.py
|
|
131
|
+
โโโ greeting.py
|
|
132
|
+
โโโ fibonacci.py
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
| Memory Type | Storage | Use Case |
|
|
136
|
+
|-------------|---------|----------|
|
|
137
|
+
| **Episodic** | JSONL (append-only) | Few-shot prompting, conversation continuity |
|
|
138
|
+
| **Semantic** | ChromaDB + embeddings | Fact retrieval, RAG, similarity search |
|
|
139
|
+
| **Procedural** | Python files in `skills/` | Learned procedures, reusable tools |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## ๐ Built-in Tools
|
|
144
|
+
|
|
145
|
+
| Tool | Description | Example |
|
|
146
|
+
|------|-------------|---------|
|
|
147
|
+
| `shell` | Run shell commands | `{"tool": "shell", "args": {"cmd": "ls -la"}}` |
|
|
148
|
+
| `read_file` | Read file contents | `{"tool": "read_file", "args": {"path": "config.yaml"}}` |
|
|
149
|
+
| `write_file` | Write file contents | `{"tool": "write_file", "args": {"path": "out.py", "content": "print(1)"}}` |
|
|
150
|
+
| `python_exec` | Execute Python code | `{"tool": "python_exec", "args": {"code": "print(2+2)"}}` |
|
|
151
|
+
| `list_files` | List directory | `{"tool": "list_files", "args": {"path": "memory/skills"}}` |
|
|
152
|
+
| `remember` | Store in semantic memory | `{"tool": "remember", "args": {"text": "API key is xyz", "metadata": {"type": "secret"}}}` |
|
|
153
|
+
| `retrieve` | Search semantic memory | `{"tool": "retrieve", "args": {"query": "API key", "n_results": 3}}` |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## โ๏ธ Configuration
|
|
158
|
+
|
|
159
|
+
### YAML Config (`config.yaml`)
|
|
160
|
+
```yaml
|
|
161
|
+
ollama:
|
|
162
|
+
host: "http://localhost:11434"
|
|
163
|
+
model: "qwen2.5:7b"
|
|
164
|
+
temperature: 0.1
|
|
165
|
+
timeout: 120
|
|
166
|
+
|
|
167
|
+
memory:
|
|
168
|
+
episodes_path: "memory/episodes.jsonl"
|
|
169
|
+
max_few_shot: 3
|
|
170
|
+
chroma_path: "memory/chroma"
|
|
171
|
+
embed_model: "all-MiniLM-L6-v2"
|
|
172
|
+
embed_cache_dir: "~/.cache/fcht-agent/embeddings"
|
|
173
|
+
|
|
174
|
+
agent:
|
|
175
|
+
max_steps: 10
|
|
176
|
+
system_prompt: |
|
|
177
|
+
You are a precise, helpful assistant. Use tools to accomplish tasks.
|
|
178
|
+
Output ONLY JSON tool calls. When done, respond with 'DONE: <result>'.
|
|
179
|
+
|
|
180
|
+
daemon:
|
|
181
|
+
enabled: true
|
|
182
|
+
host: "127.0.0.1"
|
|
183
|
+
port: 8765
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Environment Variables (override any setting)
|
|
187
|
+
```bash
|
|
188
|
+
FCHT_OLLAMA__MODEL=llama3.1
|
|
189
|
+
FCHT_MEMORY__MAX_FEW_SHOT=5
|
|
190
|
+
FCHT_AGENT__MAX_STEPS=15
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## ๐งช Testing
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Run all tests
|
|
199
|
+
pytest tests/ -v
|
|
200
|
+
|
|
201
|
+
# Memory tests
|
|
202
|
+
pytest tests/test_memory.py -v
|
|
203
|
+
|
|
204
|
+
# Agent tests
|
|
205
|
+
pytest tests/test_agent.py -v
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## ๐ฆ Project Structure
|
|
211
|
+
```
|
|
212
|
+
fcht_agent/
|
|
213
|
+
โโโ __init__.py # Exports: FCHTAgent, AgentConfig, __version__
|
|
214
|
+
โโโ config/schema.py # Pydantic settings (YAML/env/file)
|
|
215
|
+
โโโ core/agent.py # ReAct loop + Ollama client + tools
|
|
216
|
+
โโโ memory/
|
|
217
|
+
โ โโโ episodic.py # JSONL few-shot memory
|
|
218
|
+
โ โโโ semantic.py # ChromaDB + cached embeddings
|
|
219
|
+
โ โโโ embeddings.py # Singleton embedding model
|
|
220
|
+
โโโ tools/registry.py # 7 built-in tools
|
|
221
|
+
โโโ cli/main.py # argparse CLI: run, config, doctor, version
|
|
222
|
+
โโโ daemon/server.py # JSON-RPC stdin/stdout daemon
|
|
223
|
+
tests/
|
|
224
|
+
โโโ test_memory.py # Memory module tests
|
|
225
|
+
โโโ test_agent.py # Agent integration tests
|
|
226
|
+
setup.py # Setuptools config
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## ๐ License
|
|
232
|
+
|
|
233
|
+
MIT License โ see [LICENSE](LICENSE) for details.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## ๐ค Contributing
|
|
238
|
+
|
|
239
|
+
1. Fork the repo
|
|
240
|
+
2. Create a feature branch
|
|
241
|
+
3. Add tests for new functionality
|
|
242
|
+
4. Ensure `pytest tests/` passes
|
|
243
|
+
5. Submit PR
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## ๐ Support
|
|
248
|
+
|
|
249
|
+
- **Issues**: GitHub Issues
|
|
250
|
+
- **Discussions**: GitHub Discussions
|
|
251
|
+
- **Security**: security@example.com (PGP key available)
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
*Built with โค๏ธ for local-first AI. Runs on a GTX 1080 Ti (11GB) with qwen2.5:7b.*
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# FCHT Agent โ First-Class Hermes Tool Agent
|
|
2
|
+
|
|
3
|
+
> **Offline ReAct agent with persistent dual-memory (episodic + semantic) โ runs entirely on your hardware.**
|
|
4
|
+
|
|
5
|
+
[](https://python.org)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ๐ฏ What Is This?
|
|
12
|
+
|
|
13
|
+
**FCHT Agent** is a local-first AI agent that runs **100% offline** on your machine using [Ollama](https://ollama.ai) and your choice of local LLM (default: `qwen2.5:7b`). It features:
|
|
14
|
+
|
|
15
|
+
| Capability | Description |
|
|
16
|
+
|------------|-------------|
|
|
17
|
+
| **ReAct Loop** | Think โ Act โ Observe reasoning with tool use |
|
|
18
|
+
| **Episodic Memory** | JSONL few-shot history for context-aware responses |
|
|
19
|
+
| **Semantic Memory** | ChromaDB + sentence-transformers for RAG |
|
|
20
|
+
| **Skill System** | Agent writes executable Python tools to `memory/skills/` |
|
|
21
|
+
| **7 Built-in Tools** | shell, read/write files, python_exec, list_files, remember, retrieve |
|
|
22
|
+
| **Daemon Mode** | JSON-RPC over stdin/stdout for low-latency reuse |
|
|
23
|
+
| **CLI + Config** | Full argparse interface, YAML/env config, health checks |
|
|
24
|
+
|
|
25
|
+
**Zero cloud calls after initial model pull. Your data never leaves your machine.**
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ๐ Quick Start
|
|
30
|
+
|
|
31
|
+
### Prerequisites
|
|
32
|
+
- Python 3.10+
|
|
33
|
+
- [Ollama](https://ollama.ai) installed and running
|
|
34
|
+
- Pull a model: `ollama pull qwen2.5:7b`
|
|
35
|
+
|
|
36
|
+
### Install
|
|
37
|
+
```bash
|
|
38
|
+
pip install -e .
|
|
39
|
+
# or from PyPI (when published)
|
|
40
|
+
pip install fcht-agent
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Verify Installation
|
|
44
|
+
```bash
|
|
45
|
+
fcht-agent doctor
|
|
46
|
+
# โ Ollama: http://localhost:11434
|
|
47
|
+
# โ Target model 'qwen2.5:7b' available
|
|
48
|
+
# โ All memory dirs exist
|
|
49
|
+
# All checks passed โ
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Run a Task
|
|
53
|
+
```bash
|
|
54
|
+
# One-shot
|
|
55
|
+
fcht-agent run "What is the project name? Use retrieve."
|
|
56
|
+
|
|
57
|
+
# JSON output for scripting
|
|
58
|
+
fcht-agent --json run "List skills in memory/skills"
|
|
59
|
+
# {"result": "...", "episodes_added": 1, "steps_taken": 2, "success": true}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Daemon Mode (Fast, Model Stays Loaded)
|
|
63
|
+
```bash
|
|
64
|
+
# Terminal 1: start daemon
|
|
65
|
+
fcht-agent-daemon
|
|
66
|
+
# {"jsonrpc": "2.0", "method": "ready", "params": {"model": "qwen2.5:7b"}}
|
|
67
|
+
|
|
68
|
+
# Terminal 2: send requests
|
|
69
|
+
echo '{"task": "What is the project name?", "id": "req-1"}' | fcht-agent-daemon
|
|
70
|
+
# {"id": "req-1", "result": {"output": "...", "episodes_added": 1, "steps_taken": 2, "success": true}}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## ๐ง Memory Architecture
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
memory/
|
|
79
|
+
โโโ episodes.jsonl # Episodic: few-shot conversation history
|
|
80
|
+
โโโ chroma/ # Semantic: ChromaDB vector store
|
|
81
|
+
โ โโโ chroma.sqlite3
|
|
82
|
+
โ โโโ ...
|
|
83
|
+
โโโ skills/ # Procedural: learned Python tools
|
|
84
|
+
โโโ hello.py
|
|
85
|
+
โโโ greeting.py
|
|
86
|
+
โโโ fibonacci.py
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
| Memory Type | Storage | Use Case |
|
|
90
|
+
|-------------|---------|----------|
|
|
91
|
+
| **Episodic** | JSONL (append-only) | Few-shot prompting, conversation continuity |
|
|
92
|
+
| **Semantic** | ChromaDB + embeddings | Fact retrieval, RAG, similarity search |
|
|
93
|
+
| **Procedural** | Python files in `skills/` | Learned procedures, reusable tools |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## ๐ Built-in Tools
|
|
98
|
+
|
|
99
|
+
| Tool | Description | Example |
|
|
100
|
+
|------|-------------|---------|
|
|
101
|
+
| `shell` | Run shell commands | `{"tool": "shell", "args": {"cmd": "ls -la"}}` |
|
|
102
|
+
| `read_file` | Read file contents | `{"tool": "read_file", "args": {"path": "config.yaml"}}` |
|
|
103
|
+
| `write_file` | Write file contents | `{"tool": "write_file", "args": {"path": "out.py", "content": "print(1)"}}` |
|
|
104
|
+
| `python_exec` | Execute Python code | `{"tool": "python_exec", "args": {"code": "print(2+2)"}}` |
|
|
105
|
+
| `list_files` | List directory | `{"tool": "list_files", "args": {"path": "memory/skills"}}` |
|
|
106
|
+
| `remember` | Store in semantic memory | `{"tool": "remember", "args": {"text": "API key is xyz", "metadata": {"type": "secret"}}}` |
|
|
107
|
+
| `retrieve` | Search semantic memory | `{"tool": "retrieve", "args": {"query": "API key", "n_results": 3}}` |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## โ๏ธ Configuration
|
|
112
|
+
|
|
113
|
+
### YAML Config (`config.yaml`)
|
|
114
|
+
```yaml
|
|
115
|
+
ollama:
|
|
116
|
+
host: "http://localhost:11434"
|
|
117
|
+
model: "qwen2.5:7b"
|
|
118
|
+
temperature: 0.1
|
|
119
|
+
timeout: 120
|
|
120
|
+
|
|
121
|
+
memory:
|
|
122
|
+
episodes_path: "memory/episodes.jsonl"
|
|
123
|
+
max_few_shot: 3
|
|
124
|
+
chroma_path: "memory/chroma"
|
|
125
|
+
embed_model: "all-MiniLM-L6-v2"
|
|
126
|
+
embed_cache_dir: "~/.cache/fcht-agent/embeddings"
|
|
127
|
+
|
|
128
|
+
agent:
|
|
129
|
+
max_steps: 10
|
|
130
|
+
system_prompt: |
|
|
131
|
+
You are a precise, helpful assistant. Use tools to accomplish tasks.
|
|
132
|
+
Output ONLY JSON tool calls. When done, respond with 'DONE: <result>'.
|
|
133
|
+
|
|
134
|
+
daemon:
|
|
135
|
+
enabled: true
|
|
136
|
+
host: "127.0.0.1"
|
|
137
|
+
port: 8765
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Environment Variables (override any setting)
|
|
141
|
+
```bash
|
|
142
|
+
FCHT_OLLAMA__MODEL=llama3.1
|
|
143
|
+
FCHT_MEMORY__MAX_FEW_SHOT=5
|
|
144
|
+
FCHT_AGENT__MAX_STEPS=15
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## ๐งช Testing
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Run all tests
|
|
153
|
+
pytest tests/ -v
|
|
154
|
+
|
|
155
|
+
# Memory tests
|
|
156
|
+
pytest tests/test_memory.py -v
|
|
157
|
+
|
|
158
|
+
# Agent tests
|
|
159
|
+
pytest tests/test_agent.py -v
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## ๐ฆ Project Structure
|
|
165
|
+
```
|
|
166
|
+
fcht_agent/
|
|
167
|
+
โโโ __init__.py # Exports: FCHTAgent, AgentConfig, __version__
|
|
168
|
+
โโโ config/schema.py # Pydantic settings (YAML/env/file)
|
|
169
|
+
โโโ core/agent.py # ReAct loop + Ollama client + tools
|
|
170
|
+
โโโ memory/
|
|
171
|
+
โ โโโ episodic.py # JSONL few-shot memory
|
|
172
|
+
โ โโโ semantic.py # ChromaDB + cached embeddings
|
|
173
|
+
โ โโโ embeddings.py # Singleton embedding model
|
|
174
|
+
โโโ tools/registry.py # 7 built-in tools
|
|
175
|
+
โโโ cli/main.py # argparse CLI: run, config, doctor, version
|
|
176
|
+
โโโ daemon/server.py # JSON-RPC stdin/stdout daemon
|
|
177
|
+
tests/
|
|
178
|
+
โโโ test_memory.py # Memory module tests
|
|
179
|
+
โโโ test_agent.py # Agent integration tests
|
|
180
|
+
setup.py # Setuptools config
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## ๐ License
|
|
186
|
+
|
|
187
|
+
MIT License โ see [LICENSE](LICENSE) for details.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## ๐ค Contributing
|
|
192
|
+
|
|
193
|
+
1. Fork the repo
|
|
194
|
+
2. Create a feature branch
|
|
195
|
+
3. Add tests for new functionality
|
|
196
|
+
4. Ensure `pytest tests/` passes
|
|
197
|
+
5. Submit PR
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## ๐ Support
|
|
202
|
+
|
|
203
|
+
- **Issues**: GitHub Issues
|
|
204
|
+
- **Discussions**: GitHub Discussions
|
|
205
|
+
- **Security**: security@example.com (PGP key available)
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
*Built with โค๏ธ for local-first AI. Runs on a GTX 1080 Ti (11GB) with qwen2.5:7b.*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
FCHT Agent - First-Class Hermes Tool Agent
|
|
3
|
+
Offline ReAct agent with persistent memory (episodic + semantic)
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "0.1.0"
|
|
7
|
+
__author__ = "Joseph Brown & Newton"
|
|
8
|
+
__license__ = "MIT"
|
|
9
|
+
|
|
10
|
+
from fcht_agent.core.agent import FCHTAgent
|
|
11
|
+
from fcht_agent.config.schema import AgentConfig
|
|
12
|
+
|
|
13
|
+
__all__ = ["FCHTAgent", "AgentConfig", "__version__"]
|
|
File without changes
|