C
carlosgild-web/luna-hybrid-agent
Local-first hybrid agent on Ollama: Luna picks per question between document search (RAG), read-only business…
updated 2026-11-27
View on GitHub ↗Link checked 2026-11-28 · HTTP 200 · opens the vendor's own site
- Star count
- 0 ★ · carlosgild-web/luna-hybrid-agent · read from the GitHub search API · (checked 2026-11-28 20:00:45)
- Source
- read directly from its GitHub page · type: open-source project
- Harvest history
- first seen 2026-11-28 · last seen 2026-11-29 · seen 2× · listed by 2 sources
- Score
- score 203 · 2 sources · repo
FAQ (answers come from our records)
Who is it for?
We filed it under these tags: Open Source. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository
carlosgild-web/luna-hybrid-agent;first catalogued 2026-11-28;last seen 2026-11-29。There is no official certification or quality rating here — we record sources and dates only.README excerpt (English, untranslated) · Read the full README on GitHub →
# Luna Hybrid Agent
Excerpted from the repository README (abridged)
A local agent that decides, for each question, where the answer lives. Luna is the
assistant of a fictional bead maker's staff. For each question she picks the company's
documents, its business database, an exchange rate, a chart, or several of them; she shows
every step, and the app checks every number she writes. Everything runs on your machine with
Ollama; the one external call is off unless you turn it on.
Numbers come from tools, never from the model's memory.
Recorded with the evaluation suite's scripted model. The app, the tools, the database, the search, the answer check and the inspector are real.
### The 2½-minute video: a real model, under the hood
https://github.com/user-attachments/assets/0fd91b84-9853-4ecf-94d7-a18cef77cb2a
Five questions on qwen3:4b-instruct on a laptop CPU, with a panel that shows the code and
the data behind every step; model waits are cut to 1 s with their real length. How it was
recorded, and what is real: docs/video.md.
bash
git clone https://github.com/carlosgild-web/luna-hybrid-agent.git
cd luna-hybrid-agent
.\start.cmd # Windows; ./start.sh on macOS and Linux
No API key, and Docker is optional: the script finds Ollama and Python (or Docker), asks
before installing or downloading anything, and opens the app. Then click Load the demo
company and ask Luna. More ways to run it in Try it.
Built by Carlos Velazquez · LinkedIn · open to AI engineering roles (remote)
## What this demonstrates
Native tool calling on a local model: a bounded, traced loop on Ollama's tools API (backend/app/agent/loop.py), no agent framework (decision 0032 is the answer to "why not LangChain?").
Hybrid grounding: one answer can cite a document passage and a SQL aggregate, and the answer check traces every number to the tool result that holds it (answer.py).
SQL from a model, safely: read-only in three layers, a one-statement guard, row and time caps, 39 hostile queries in the tests (sql_guard.py).
Measured, not claimed: 30 tiered questions scored from stored traces; three runs on a 4B model, 53 % → 67 %, with the failures listed (decision 0040).
Local-first, external by consent: the one external API is off by default, audited and cached, with a fallback to the stored rate.
Full stack and delivery: FastAPI, ChromaDB + SQLite FTS5, React + TypeScript, Docker, 740 tests (93 % coverage) in GitHub Actions.
## The problem
A small company's answers live in two places: documents (policies, agreements, meeting
notes) and a business database (stock, sales, purchases). A plain RAG app always searches
the documents. An agent has to decide, and every decision is a new way to be wrong:
The model can skip the search. In the first evaluation run, 6 of 7 document questions
got "I don't have that information" without a single tool call.
A wrong choice gives a confident wrong answer. "Was the acorn charm order received
late?" got "No" from the meeting notes alone; the purchase records say received late.
Every number was right; the reasoning wasn't.
A citation proves a passage, not a SQL aggregate. So every number in an answer is
traced to the tool result or passage that contains it.
The model writes SQL, and loops go wrong in new ways: malformed arguments, the same
assistant of a fictional bead maker's staff. For each question she picks the company's
documents, its business database, an exchange rate, a chart, or several of them; she shows
every step, and the app checks every number she writes. Everything runs on your machine with
Ollama; the one external call is off unless you turn it on.
Numbers come from tools, never from the model's memory.
Recorded with the evaluation suite's scripted model. The app, the tools, the database, the search, the answer check and the inspector are real.
### The 2½-minute video: a real model, under the hood
https://github.com/user-attachments/assets/0fd91b84-9853-4ecf-94d7-a18cef77cb2a
Five questions on qwen3:4b-instruct on a laptop CPU, with a panel that shows the code and
the data behind every step; model waits are cut to 1 s with their real length. How it was
recorded, and what is real: docs/video.md.
bash
git clone https://github.com/carlosgild-web/luna-hybrid-agent.git
cd luna-hybrid-agent
.\start.cmd # Windows; ./start.sh on macOS and Linux
No API key, and Docker is optional: the script finds Ollama and Python (or Docker), asks
before installing or downloading anything, and opens the app. Then click Load the demo
company and ask Luna. More ways to run it in Try it.
Built by Carlos Velazquez · LinkedIn · open to AI engineering roles (remote)
## What this demonstrates
Native tool calling on a local model: a bounded, traced loop on Ollama's tools API (backend/app/agent/loop.py), no agent framework (decision 0032 is the answer to "why not LangChain?").
Hybrid grounding: one answer can cite a document passage and a SQL aggregate, and the answer check traces every number to the tool result that holds it (answer.py).
SQL from a model, safely: read-only in three layers, a one-statement guard, row and time caps, 39 hostile queries in the tests (sql_guard.py).
Measured, not claimed: 30 tiered questions scored from stored traces; three runs on a 4B model, 53 % → 67 %, with the failures listed (decision 0040).
Local-first, external by consent: the one external API is off by default, audited and cached, with a fallback to the stored rate.
Full stack and delivery: FastAPI, ChromaDB + SQLite FTS5, React + TypeScript, Docker, 740 tests (93 % coverage) in GitHub Actions.
## The problem
A small company's answers live in two places: documents (policies, agreements, meeting
notes) and a business database (stock, sales, purchases). A plain RAG app always searches
the documents. An agent has to decide, and every decision is a new way to be wrong:
The model can skip the search. In the first evaluation run, 6 of 7 document questions
got "I don't have that information" without a single tool call.
A wrong choice gives a confident wrong answer. "Was the acorn charm order received
late?" got "No" from the meeting notes alone; the purchase records say received late.
Every number was right; the reasoning wasn't.
A citation proves a passage, not a SQL aggregate. So every number in an answer is
traced to the tool result or passage that contains it.
The model writes SQL, and loops go wrong in new ways: malformed arguments, the same
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/carlosgild-web-luna-hybrid-agent/)
- Source
- github · https://github.com/carlosgild-web/luna-hybrid-agent
- Browse by field
- Open source
- Listed by
- 2 independent sources
- added
- today
More entries
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.