RESEARCH PAPER
methodology, §3.2
RAG PIPELINE
retrieval.py
def retrieve(query, k=5):
vec = embed(query)
return faiss_index.search(
vec, k
)chunk → embed → retrieve → generate
methodology_parser.py
class MethodParser:
def to_python(self, eq):
return compile_fn(eq)THE IDEA
Academic papers describe methods in prose and formulas that stay locked on the page. PaperForge AI reads a paper the way a researcher would — retrieve the relevant section, understand the method, then re-express it as code you can actually run.
THE PIPELINE
- RESEARCH PAPER
- DOCUMENT PROCESSING
- SEMANTIC CHUNKINGrecursive character splitting
- VECTOR SEARCHFAISS
- LLM
- METHODOLOGY
- PYTHON CODE
THE SYSTEM
- Documents are split with semantic chunking and recursive character splitting, tuned so a chunk stays a coherent unit of meaning rather than an arbitrary slice of text.
- Chunks are embedded and indexed in a FAISS vector store for fast semantic retrieval.
- A research-to-code parser takes the retrieved methodology and converts unstructured formulas into compilable Python functions, guided by strict prompts and output schemas.
THE PROCESS
- Retrieval quality was evaluated with Recall@K to keep the pipeline honest about what it actually finds.
- Prompt and schema design went through several passes to keep LLM output strictly structured — code that compiles, not code that merely reads well.
THE RESULT
A working pipeline: paper in, retrieved methodology and runnable Python out — built as a personal exploration of RAG systems applied to a genuinely hard retrieval problem.
papers → code