Repo Q&A LangGraph
What it does
A retriever searches the repository for the files relevant to the question and reads them. An answerer responds using only that code, citing the exact file and line behind each claim. When the repository does not cover the question, it says so rather than inventing an answer. Useful for onboarding, code archaeology, and answering 'where does this happen?' without a human spelunking the tree.
The cast · 2 agents
Answer the question using only the retrieved code, citing the file and line for each claim. If the retrieved context does not actually contain the answer, say the repository does not cover it rather than guessing.
Search the repository for code relevant to the question and read the promising files. Return the passages with their file paths and line ranges. Do not answer yet.
Flow
Interface
Depends on · 1 MCP server
io.github.github/github-mcpnot in the registry yetcode# Generated by @socketcat/compiler for target: langgraph
# blueprint: com.socketcat/repo-qa v1.0.0 schema: socketcat.dev/blueprint/v0
# This code is yours. Edit it freely. The socketcat_runtime helper is optional and can be vendored.
from typing import TypedDict
from langgraph.graph import StateGraph, START, END
import socketcat_runtime as _rt
class State(TypedDict, total=False):
question: object
answer: object
context: object
def node_AgentInvoke_0(state):
return _rt.run_agent("retriever", state, {"question":"question"}, "context")
def node_AgentInvoke_1(state):
return _rt.run_agent("answerer", state, {"context":"context","question":"question"}, "answer")
def build():
b = StateGraph(State)
b.add_node("AgentInvoke_0", node_AgentInvoke_0)
b.add_node("AgentInvoke_1", node_AgentInvoke_1)
b.add_edge(START, "AgentInvoke_0")
b.add_edge("AgentInvoke_0", "AgentInvoke_1")
b.add_edge("AgentInvoke_1", END)
return b.compile()
INPUTS = ["question"]
OUTPUTS = ["answer"]
if __name__ == "__main__":
_rt.main(build, INPUTS, OUTPUTS)
▸blueprint.json (the portable format)
{
"id": "com.socketcat/repo-qa",
"flow": {
"type": "sequence",
"blocks": [
{
"in": {
"question": "question"
},
"out": "context",
"use": "retriever",
"type": "agent"
},
{
"in": {
"context": "context",
"question": "question"
},
"out": "answer",
"use": "answerer",
"type": "agent"
}
]
},
"tags": [
"code",
"rag",
"onboarding",
"citations"
],
"title": "Repo Q&A",
"agents": {
"answerer": {
"model": {
"hint": "reasoning"
},
"title": "Answerer",
"instructions": "Answer the question using only the retrieved code, citing the file and line for each claim. If the retrieved context does not actually contain the answer, say the repository does not cover it rather than guessing."
},
"retriever": {
"model": {
"hint": "fast"
},
"title": "Retriever",
"tools": [
"code.search_code",
"code.get_file"
],
"instructions": "Search the repository for code relevant to the question and read the promising files. Return the passages with their file paths and line ranges. Do not answer yet."
}
},
"estate": {
"context": {
"type": "array",
"description": "The retrieved files and passages relevant to the question."
}
},
"$schema": "socketcat.dev/blueprint/v0",
"authors": [
{
"url": "https://socketcat.com",
"name": "SocketCat"
}
],
"license": "MIT",
"servers": [
{
"ref": "io.github.github/github-mcp",
"alias": "code"
}
],
"summary": "Answers questions about a codebase grounded in the actual files, with citations, and admits when the answer isn't there.",
"targets": [
"langgraph",
"crewai",
"*"
],
"version": "1.0.0",
"interface": {
"inputs": {
"question": {
"type": "string",
"description": "The question about the codebase."
}
},
"outputs": {
"answer": {
"type": "string",
"description": "The answer with file-and-line citations, or an honest 'not covered'."
}
}
},
"extensions": {
"dev.langgraph": {
"checkpointer": "memory"
}
},
"description": "A retriever searches the repository for the files relevant to the question and reads them. An answerer responds using only that code, citing the exact file and line behind each claim. When the repository does not cover the question, it says so rather than inventing an answer. Useful for onboarding, code archaeology, and answering 'where does this happen?' without a human spelunking the tree."
}More in Coding & QA
Browse all →E2E Test Author
Turns a user story into browser tests: plans the scenarios, writes Playwright code, runs it against the real page, and self-heals until it passes for the right reason.