What it does
Cross-paper synthesis
Contradiction detection
Citation extraction
Gap analysis
Qdrant vector store for 100+ papers
Stack
PythonLlamaIndexAnthropic ClaudeQdrant
Deploy on
✓ Google Colab✓ Modal✓ RunPod
Full source code
Install commands are in the top comments. Copy and run.
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llama_index.core.node_parser import SentenceSplitter
from llama_index.llms.anthropic import Anthropic
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.vector_stores.qdrant import QdrantVectorStore
from llama_index.core import StorageContext, Settings
import qdrant_client
Settings.llm = Anthropic(model='claude-sonnet-4-6', max_tokens=2000)
Settings.embed_model = OpenAIEmbedding(model='text-embedding-3-small')
qd = qdrant_client.QdrantClient(path='./papers_db')
storage_ctx = StorageContext.from_defaults(vector_store=QdrantVectorStore(client=qd,collection_name='papers'))
docs = SimpleDirectoryReader('./papers', file_metadata=lambda p: {'source': p.name}).load_data()
index = VectorStoreIndex.from_documents(docs, storage_context=storage_ctx,
transformations=[SentenceSplitter(chunk_size=512,chunk_overlap=64)])
engine = index.as_query_engine(similarity_top_k=8, response_mode='tree_summarize')
def ask(question, mode='synthesis'):
prefix = {'synthesis':'Synthesise: ','gaps':'Find gaps: ','contra':'Find contradictions: '}.get(mode,'')
r = engine.query(prefix + question)
return {'answer': str(r), 'papers': list(set(n.metadata.get('source') for n in r.source_nodes))}
print(ask('What are the main findings on transformer attention?'))