https://github.com/gradrix/dendrite
π§ Self-organizing AI agent with dendrite spawning - decomposes complex goals into neurons, spawns parallel sub-tasks, and aggregates results. Features smart parameter extraction, context isolation, and automatic data compaction. Built for Strava analytics with extensible tool system.
https://github.com/gradrix/dendrite
agentic-ai ai-agent autonomous-agent llm mistral neural-architecture ollama python strava strava-api task-decomposition
Last synced: 3 months ago
JSON representation
π§ Self-organizing AI agent with dendrite spawning - decomposes complex goals into neurons, spawns parallel sub-tasks, and aggregates results. Features smart parameter extraction, context isolation, and automatic data compaction. Built for Strava analytics with extensible tool system.
- Host: GitHub
- URL: https://github.com/gradrix/dendrite
- Owner: gradrix
- Created: 2025-10-23T21:25:12.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-21T20:35:40.000Z (6 months ago)
- Last Synced: 2025-12-23T08:51:24.812Z (6 months ago)
- Topics: agentic-ai, ai-agent, autonomous-agent, llm, mistral, neural-architecture, ollama, python, strava, strava-api, task-decomposition
- Language: Python
- Homepage:
- Size: 1.4 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# Dendrite
A self-contained AI neural engine with tool execution, scheduled goals, and 100% local LLM inference via llama.cpp.
## Features
- **Local LLM**: Built-in llama.cpp server (Mistral 7B) - no external APIs
- **Tool System**: Semantic tool discovery and execution (Strava, memory, calculator, etc.)
- **Scheduler**: Run goals on cron schedules or intervals
- **PostgreSQL Storage**: Persistent tool data and credentials
- **GPU Acceleration**: Auto-detects NVIDIA GPU for faster inference
## Quick Start
```bash
# Clone
git clone https://github.com/gradrix/dendrite.git
cd dendrite
# Start (auto-detects GPU)
./start.sh
# Run a single goal
./start.sh goal "What is 2+2?"
# Run scheduler daemon
./start.sh scheduler
```
## Commands
```bash
./start.sh # Start services (auto-detect GPU)
./start.sh goal "..." # Run single goal and exit
./start.sh scheduler # Run scheduler daemon (uses goals.yaml)
./start.sh api # Start HTTP API server
./start.sh stop # Stop all services
./start.sh status # Show service status
./start.sh logs # Follow logs
./start.sh test # Run tests
./start.sh help # Show help
```
## Configuration
### Environment (.env)
```bash
# RAM profile for model selection (8gb, 16gb, 32gb)
RAM_PROFILE=32gb
# GPU VRAM (auto-detected if not set)
VRAM_GB=32
# Strava OAuth (optional)
STRAVA_CLIENT_ID=your_id
STRAVA_CLIENT_SECRET=your_secret
```
### Scheduled Goals (goals.yaml)
```yaml
goals:
- id: collect_kudos
goal: "Use strava_collect_kudos_givers with hours_back=48"
schedule: cron
cron: "0 */4 * * *" # Every 4 hours
enabled: true
- id: reciprocate_kudos
goal: "Use strava_reciprocate_kudos with count=30 and max_age_hours=24"
schedule: cron
cron: "0 */6 * * *" # Every 6 hours
enabled: true
settings:
check_interval: 60
```
## Architecture
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orchestrator β
β Routes goals to appropriate neurons based on intent β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββ βββββββββββββ βββββββββββββ
β Intent β β Tool β β Generativeβ
β Neuron β β Neuron β β Neuron β
βββββββββββββ βββββββββββββ βββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββ βββββββββββββ βββββββββββββ
β LLM β β Tool β β LLM β
β Client β β Registry β β Client β
βββββββββββββ βββββββββββββ βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Tools (Strava, etc) β
β PostgreSQL Storage β
βββββββββββββββββββββββββββ
```
## Tools
### Built-in
- `calculator` - Math expressions
- `memory_write` / `memory_read` - Persistent key-value storage
- `current_datetime` - Current date/time
### Strava Integration
- `strava_get_activities` - Get your activities
- `strava_get_dashboard_feed` - Get friends' activities
- `strava_give_kudos` - Give kudos to an activity
- `strava_collect_kudos_givers` - Track who gives you kudos
- `strava_reciprocate_kudos` - Auto-kudos back to givers
- `strava_list_kudos_givers` - List known kudos givers
## Services
| Service | Port | Description |
|---------|------|-------------|
| llama-gpu | 8080 | llama.cpp server (Mistral 7B) |
| postgres | 5432 | PostgreSQL with pgvector |
| redis | 6379 | Message bus / caching |
## Development
```bash
# Run tests
./start.sh test
# Run specific tests
./start.sh test -k "test_strava"
# Access container shell
./scripts/docker/shell.sh
```
## Project Structure
```
βββ main.py # Entry point
βββ start.sh # Main startup script
βββ goals.yaml # Scheduled goals config
βββ docker-compose.yml # Services definition
βββ neural_engine/
β βββ v2/
β βββ core/ # Config, LLM, Orchestrator
β βββ neurons/ # Intent, Tool, Generative, Memory
β βββ tools/ # Tool implementations
β βββ scheduler/ # Goal scheduling
β βββ forge/ # Dynamic tool creation
β βββ cli.py # Command-line interface
β βββ api.py # HTTP API
βββ scripts/
βββ db/ # Database migrations
βββ docker/ # Docker helper scripts
βββ testing/ # Test runners
```
## License
MIT