FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
Back to Projects
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%
Hit@10
Ratio of retrieved top-10 files that have confirmed AST dependency links.
68.4%
4.2%
Precision@10
Fraction of total codebase relevant dependencies successfully retrieved in top-10.
72.5%
6.1%
Recall@10
Normalized Discounted Cumulative Gain weighting higher rank relevance placement.
79.1%
5.5%
NDCG@10
Mean Reciprocal Rank measuring average reciprocal rank of first relevant dependency.
76.8%
7.1%
MRR
Evaluated on TS codebases (N=500+ files)Margin = 0.5 (Contrastive Loss)

Live GitHub Repository README

Live Synced

ReeCall.ai

Neural Repository Memory Engine
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

PropertyDetail
ArchitectureMLP encoder + 1-hop sparse neighbor aggregation + contrastive projection
Parameters~50K (CPU-friendly, trains in seconds)
Embedding Dim32 (L2-normalized for cosine similarity)
Training SignalCo-import prediction with contrastive loss
OutputStructured 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

ModulePathResponsibility
Parser
parser/
Scan files, extract imports and symbols (regex-based)
Graph
graph/
Build file-level adjacency list with typed edges
Features
features/
Cluster files into logical feature groups (heuristic)
Model
model/
ReeCall — MLP + sparse graph aggregation → 32-dim embeddings
| Dataset |
dataset/
| Generate training pairs from co-import relationships | | Inference |
inference/
| Encode queries, retrieve top-K files, re-rank results | | Watcher |
watcher/
| Track file changes for incremental re-embedding | | Memory |
memory/
| Format structured JSON output (no language generation) | | CLI |
cli/
| Command-line interface for scan, graph, features |

Training

Training Signal: Co-Import Prediction

If
login.ts
imports
jwt.ts
, their embeddings should be close in vector space.
Pair TypeExampleLabel
Positive
(login.ts, jwt.ts)
— import relationship
1
Negative
(login.ts, stripe.ts)
— no relationship
0
Loss function: Contrastive loss with margin = 0.5

Feature Vector (128-dim)

DimensionsFeature
[0:4]
Structural scalars (depth, LOC, function count, import count)
[4:8]
Language one-hot (TypeScript, JavaScript)
[8:24]
File role one-hot (controller, service, model, util, etc.)
[24:28]
Neighbor density
[28:60]
Folder hash features
[60:92]
Function name hash features
[92:128]
Reserved (zero-padded)

Hyperparameters

ParameterDefaultFlag
Epochs50
--epochs
Learning Rate0.001
--lr
Embedding Dim32
--emb-dim
Margin0.5
Negative Ratio3:1
--neg-ratio
Weight Decay1e-4
Seed42
--seed

Evaluation

The evaluation suite (
eval_model.py
) measures embedding quality using two protocols:

Anchor-Based Retrieval

Pick the highest-relevance file as an anchor, retrieve nearest neighbors, measure against ground-truth relevant files.
MetricDescription
Precision@KFraction of retrieved files that are relevant
Recall@KFraction of relevant files that are retrieved
NDCG@KNormalized Discounted Cumulative Gain
MRRMean Reciprocal Rank
Hit@KWhether any relevant file appears in top-K

Link Prediction

For each import edge
(A → B)
, rank B among all files by cosine similarity to A.
MetricDescription
Mean RankAverage rank of the true import target
Hits@10 / @50Fraction of edges where target appears in top-10/50
MRRMean 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

FeatureStatus
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

ComponentTechnology
ML FrameworkPyTorch
Graph OperationsNetworkX + torch.sparse
CLIClick + Rich
Serializationorjson
File WatchingWatchdog
Testingpytest

License

This project is licensed under the MIT License.

Author

Om Ghante@om-ghante