Evidence-Grounded Agentic Loop Platform
Every claim traces to evidence. If evidence is missing, SCOUT says so β it doesn't guess.
π Runs with Llama 3 locally via Ollama β’ π Real-time evidence tracking β’ π Tenant-safe from day one
SCOUT is a production-grade single-agent runtime that proves its answers. Every tool output becomes evidence. Every claim is validated. Every answer is grounded.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β User Query β Tool Calls β Evidence Pool β Grounded Answer β
β β β β β β
β βΌ βΌ βΌ βΌ β
β ββββββββ ββββββββββββ ββββββββββ βββββββββββ β
β β Task ββββββΆβ LLM Call βββΆβ Score ββββββΆβ Verifiedβ β
β ββββββββ ββββββββββββ ββββββββββ βββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Most LLM agent frameworks give you a response and a prayer. They call tools, build context, and produce answers β but you have no way to prove why they're trustworthy.
The gap between "it runs" and "it's reliable" is where production agents die.
| Problem | SCOUT Solution |
|---|---|
| Hallucinated citations | Evidence validation against actual pool |
| Fabricated data | 5-tier grounding quality scoring |
| Unbounded loops | Typed state machine with budgets |
| Provider failures | Multi-provider fallback with fault injection |
| Multi-tenant security | Tenant isolation (404 on cross-tenant) |
flowchart TB
A[Client Request] --> B[Auth Middleware]
B --> C[Rate Limiter]
C --> D[Run Service]
D --> E[Loop Controller]
E --> F[Planner]
E --> G[Executor]
E --> H[Stop Controller]
G --> I[Evidence Store]
I --> J[Citation Parser]
J --> K[Grounding Validator]
F --> L[Primary Provider]
L -->|fail| M[Fallback Provider]
flowchart LR
A[Tool Output] --> B[EvidenceRecord]
B --> C[Content Hash]
B --> D[Source Reference]
C --> E[Score]
D --> E
E --> F[Citation Parser]
F --> G[Grounding Quality]
G --> H[Final Answer]
flowchart TD
A[LLM Call] --> B{Primary Provider}
B -->|Success| C[Response]
B -->|Rate Limit| D[Retry with Jitter]
B -->|Error| E[Fallback Manager]
D -->|Success| C
D -->|Exhausted| E
E -->|Success| C
E -->|All Failed| F[Output Repair]
F --> G[Final Response]
- Python 3.11+
- Ollama (for local LLM)
# Clone the repository
git clone https://github.com/shivamsingh-007/SCOUT-The-Agentic-Loop.git
cd SCOUT-The-Agentic-Loop
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -e ".[dev]"# Pull Llama 3 model
ollama pull llama3
# Run tests
pytest -q
# Start API server
uvicorn scout.api.app:create_app --factory --reload
# Create a run
curl -X POST http://localhost:8000/v1/runs \
-H "Content-Type: application/json" \
-d '{"task": "What is the capital of France?"}'Every tool output becomes evidence with:
- Content hashes for deduplication
- Source references for provenance
- Composite scoring (relevance + recency + quality)
| Tier | Description | Action |
|---|---|---|
| π’ Strong | Multiple strong citations | Proceed |
| π‘ Adequate | Basic citations present | Proceed with note |
| π Weak | Limited evidence | Flag for review |
| π΄ Speculative | Inconsistent evidence | Reject |
| β« None | No evidence | Reject |
Primary Provider β Retry β Fallback β Output Repair
β β β β
Success Success Success Final Answer
- HMAC-based auth with constant-time comparison
- Per-tenant rate limiting (requests/min, requests/hour)
- Tenant isolation (404 on cross-tenant access)
- Error sanitization (no file paths or API keys in errors)
- Graceful shutdown with database cleanup
| Metric | Value | Status |
|---|---|---|
| Tests | 628 passing | β |
| Type Checking | mypy strict, 0 errors | β |
| Linting | Ruff, 0 errors | β |
| API Isolation | Tenant-safe (404) | β |
| Auth | Constant-time + HMAC | β |
| Storage | SQLite hardened | β |
| Metric | Result |
|---|---|
| Test Pass Rate | 100% |
| mypy Errors | 0 |
| Ruff Errors | 0 |
| Metric | Result |
|---|---|
| Tasks Run | 10/10 |
| Parse Success | 100% |
| Citation Validity | 70% |
| Avg Latency | 13.3s |
src/scout/
βββ api/ # FastAPI server, auth, rate limiting
β βββ routers/ # API endpoints
β βββ services/ # Business logic
β βββ utils.py # Error sanitization
βββ runtime/ # State machine, loop controller
β βββ agent.py # Main agent class
β βββ loop.py # Loop controller
β βββ verifier.py # Grounding verification
βββ llm/ # LLM provider abstraction
β βββ ollama.py # Ollama provider
β βββ router.py # Provider routing
β βββ fallback.py # Fallback logic
βββ tools/ # Tool protocol and implementations
βββ grounding/ # Evidence tracking and scoring
β βββ scorer.py # BM25 scoring
β βββ validator.py # Claim validation
βββ memory/ # SQLite memory store
βββ config.py # Typed configuration
# Run all tests
make test
# Run linting
make lint
# Run type checking
make typecheck
# Run all quality gates
make all
# Start development server
make serve- Ruff for linting and formatting
- mypy strict mode for type checking
- Pydantic v2 for data validation
- pytest for testing
| Phase | Status | Description |
|---|---|---|
| Phase 1-10 | β Complete | Core platform |
| Phase 11 | π In Progress | Eval framework |
| Phase 12 | π Planned | Dashboard UI |
| Phase 13 | π Planned | Multi-provider |
| Phase 14 | π Planned | Persistent memory |
See CONTRIBUTING.md for the full process.
# Quick start
git checkout -b feat/my-feature
make all
git commit -m "feat: add new feature"
git push origin feat/my-featureMIT License - see LICENSE