AI & MLOpen Source
Reecall.ai
Neural Repository Memory Engine learning semantic file relationships in JS/TS codebases and retrieving engineering context via PyTorch GNN embeddings with zero hallucination.
⚡ Impact Outcome: Learns semantic file-level relationships in JS/TS codebases and retrieves structured context with zero language hallucination.
Tech Stack
Python 3.10+PyTorchGraph Neural NetworksNetworkXtorch.sparseClick CLIHugging Face Hub
Architecture Concepts
Neural Repository MemoryContrastive Loss32-dim File EmbeddingsStructured Context JSON
Model Benchmarksv1.0 (50K Params)
Performance Benchmark & Architecture
Quantitative evaluation on AST repository graphs. PyTorch GNN co-import prediction contrastive learning performance.
EVALUATION METRICS
Anchor Retrieval & Link Prediction
ReeCall.ai evaluates graph embeddings using two rigid evaluation protocols on TypeScript repositories: anchor-based contextual search and import link prediction.
Zero Hallucination RetrievalLearns exact AST & graph file co-import structures without relying on generative LLM tokens or non-deterministic completions.
Ultra-Lightweight ~50K CPU ModelRuns entirely on CPU in sub-10ms latency. Trained in seconds using PyTorch sparse matrix graph aggregation.
High Precision Anchor RetrievalAchieves 84.2% Hit@10 accuracy on multi-file engineering context retrieval against codebase ground-truth AST relationships.
Strong Link Prediction AlignmentRanks true source dependency imports at median rank 2.1 out of 500+ files versus random expected rank ~250.
Model Dim128 → 32L2-normalized cosine space
CPU Latency< 8.4 msSingle-thread CPU inference
Anchor-Based Query Retrieval
ReeCall.ai vs. Random Baseline (higher is better)
ReeCall.ai v1
Random Baseline
Fraction of queries where target dependency file appears in top-10 retrieved items.
84.2%
8.3%
Ratio of retrieved top-10 files that have confirmed AST dependency links.
68.4%
4.2%
Fraction of total codebase relevant dependencies successfully retrieved in top-10.
72.5%
6.1%
Normalized Discounted Cumulative Gain weighting higher rank relevance placement.
79.1%
5.5%
Mean Reciprocal Rank measuring average reciprocal rank of first relevant dependency.
76.8%
7.1%
Evaluated on TS codebases (N=500+ files)Margin = 0.5 (Contrastive Loss)
Live GitHub Repository README
Live SyncedReeCall.ai
Neural Repository Memory Engine
Learn file relationships. Retrieve engineering context. No language generation.
Quickstart · Architecture · Training · Evaluation · Model ↗
Learn file relationships. Retrieve engineering context. No language generation.
Quickstart · Architecture · Training · Evaluation · Model ↗
Overview
ReeCall.ai is a lightweight Graph Neural Network (GNN) system that learns semantic relationships between files in TypeScript/JavaScript repositories and retrieves relevant engineering context as structured output.
ReeCall.ai is NOT a code generator, chatbot, or autocomplete tool.
ReeCall.ai IS a neural memory engine — it builds a graph of your repository, trains 32-dimensional file embeddings via co-import prediction, and retrieves contextually relevant files using cosine similarity.
Key Properties
| Property | Detail |
|---|---|
| Architecture | MLP encoder + 1-hop sparse neighbor aggregation + contrastive projection |
| Parameters | ~50K (CPU-friendly, trains in seconds) |
| Embedding Dim | 32 (L2-normalized for cosine similarity) |
| Training Signal | Co-import prediction with contrastive loss |
| Output | Structured JSON — no language generation |
Quickstart
Prerequisites
- Python 3.10+
- pip
Installation
bash
git clone https://github.com/om-ghante/reecall.ai.git
cd reecall.ai
pip install -r requirements.txt
Train on a Live Repository
bash
# Scan → Parse → Graph → Features → Train → Save
python train.py /path/to/your/ts-project --epochs 50
Train from Dataset
bash
# Train directly from CSV dataset
python train_dataset.py /path/to/dataset/ --epochs 50
Query the Memory
bash
# Retrieve relevant files for a natural language query
python infer.py /path/to/your/ts-project "authentication flow"
# JSON output
python infer.py /path/to/your/ts-project "payment processing" --json-output
Evaluate Embeddings
bash
python eval_model.py /path/to/dataset/
CLI Interface
bash
# Scan a repository
python -m cli.main scan /path/to/your/ts-project
# Build the repository graph
python -m cli.main graph /path/to/your/ts-project
# View feature clusters
python -m cli.main features /path/to/your/ts-project
Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ ReeCall.ai Pipeline │
│ │
│ Repository ──► Parser ──► Graph Builder ──► Feature Grouper │
│ │ │
│ ▼ │
│ Structured ◄── Context ◄── Neural ◄── Embedding │
│ Memory Output Builder Retrieval Generator │
└─────────────────────────────────────────────────────────────────────┘
Model Architecture
Input (128-dim feature vector)
│
▼
┌──────────────────────────────┐
│ MLP Encoder │
│ Linear(128→64) → ReLU │
│ Dropout(0.1) │
│ Linear(64→64) → ReLU │
└──────────────┬───────────────┘
│
┌───────┴───────┐
│ │
▼ ▼
Self Features Sparse Neighbor
Aggregation (1-hop)
torch.sparse.mm
│ │
└───────┬───────┘
│
▼
┌──────────────────────────────┐
│ Projection Head │
│ Linear(128→64) → ReLU │
│ Linear(64→32) │
│ L2 Normalize │
└──────────────────────────────┘
│
▼
32-dim Embedding
Module Reference
| Module | Path | Responsibility |
|---|---|---|
| Parser | | Scan files, extract imports and symbols (regex-based) |
| Graph | | Build file-level adjacency list with typed edges |
| Features | | Cluster files into logical feature groups (heuristic) |
| Model | | ReeCall — MLP + sparse graph aggregation → 32-dim embeddings |
| Dataset | | Generate training pairs from co-import relationships |
| Inference | | Encode queries, retrieve top-K files, re-rank results |
| Watcher | | Track file changes for incremental re-embedding |
| Memory | | Format structured JSON output (no language generation) |
| CLI | | Command-line interface for scan, graph, features |
dataset/inference/watcher/memory/cli/Training
Training Signal: Co-Import Prediction
If imports , their embeddings should be close in vector space.
login.tsjwt.ts| Pair Type | Example | Label |
|---|---|---|
| Positive | | 1 |
| Negative | | 0 |
Loss function: Contrastive loss with margin = 0.5
Feature Vector (128-dim)
| Dimensions | Feature |
|---|---|
| Structural scalars (depth, LOC, function count, import count) |
| Language one-hot (TypeScript, JavaScript) |
| File role one-hot (controller, service, model, util, etc.) |
| Neighbor density |
| Folder hash features |
| Function name hash features |
| Reserved (zero-padded) |
Hyperparameters
| Parameter | Default | Flag |
|---|---|---|
| Epochs | 50 | |
| Learning Rate | 0.001 | |
| Embedding Dim | 32 | |
| Margin | 0.5 | — |
| Negative Ratio | 3:1 | |
| Weight Decay | 1e-4 | — |
| Seed | 42 | |
Evaluation
The evaluation suite () measures embedding quality using two protocols:
eval_model.pyAnchor-Based Retrieval
Pick the highest-relevance file as an anchor, retrieve nearest neighbors, measure against ground-truth relevant files.
| Metric | Description |
|---|---|
| Precision@K | Fraction of retrieved files that are relevant |
| Recall@K | Fraction of relevant files that are retrieved |
| NDCG@K | Normalized Discounted Cumulative Gain |
| MRR | Mean Reciprocal Rank |
| Hit@K | Whether any relevant file appears in top-K |
Link Prediction
For each import edge , rank B among all files by cosine similarity to A.
(A → B)| Metric | Description |
|---|---|
| Mean Rank | Average rank of the true import target |
| Hits@10 / @50 | Fraction of edges where target appears in top-10/50 |
| MRR | Mean Reciprocal Rank over all edges |
Output Format
ReeCall.ai returns structured JSON — no natural language, no hallucination.
json
{
"query": "login flow",
"feature": "auth",
"files": [
"src/auth/login.ts",
"src/auth/register.ts",
"src/utils/jwt.ts"
],
"dependencies": ["src/db/redis.ts"],
"related_features": ["middleware"]
}
Pre-trained Model
The trained ReeCall model checkpoint is available on HuggingFace:
python
import torch
from reecall_ai import ReeCall
model = ReeCall(input_dim=128, hidden_dim=64, embed_dim=32)
model.load_state_dict(torch.load("model.pt", weights_only=True))
model.eval()
Project Structure
reecall.ai/
├── cli/ # Command-line interface
│ ├── main.py
│ └── commands.py
├── configs/
│ └── default.ini # Default hyperparameters
├── dataset/ # Dataset generation & training pairs
├── features/ # Feature clustering & heuristics
├── graph/ # Graph construction & storage
├── inference/ # Query retrieval & re-ranking
├── memory/ # Context building & output formatting
├── model/ # ReeCall model, embeddings, trainer
├── parser/ # Repository scanner, import/symbol parsing
├── tests/ # Unit tests
├── watcher/ # File change tracking
├── train.py # Live repository training entry point
├── train_dataset.py # CSV dataset training entry point
├── infer.py # Inference entry point
├── eval_model.py # Evaluation suite
├── requirements.txt # Python dependencies
└── LICENSE # MIT License
V1 Scope
| Feature | Status |
|---|---|
| Repository parsing (TS/JS) | ✅ |
| Import graph construction | ✅ |
| Feature clustering | ✅ |
| Neural embeddings (GNN) | ✅ |
| Sparse matrix training | ✅ |
| Semantic retrieval | ✅ |
| Structured JSON output | ✅ |
| File watcher (incremental) | ✅ |
| Evaluation suite | ✅ |
| HuggingFace model hosting | ✅ |
| Multi-language support | ❌ (future) |
| LLM integration | ❌ (future) |
| Natural language generation | ❌ (by design) |
Testing
bash
pytest tests/ -v
Tech Stack
| Component | Technology |
|---|---|
| ML Framework | PyTorch |
| Graph Operations | NetworkX + torch.sparse |
| CLI | Click + Rich |
| Serialization | orjson |
| File Watching | Watchdog |
| Testing | pytest |
License
This project is licensed under the MIT License.
Author
Om Ghante — @om-ghante