This directory contains example scripts demonstrating how to use deepxiv-sdk.
quickstart.py: The fastest way to get started - minimal example to get up and running
-
example_reader.py: Basic usage of the Reader class for accessing arXiv papers- Searching for papers
- Getting paper metadata
- Reading sections
- Getting previews and full content
-
example_agent.py: Basic usage of the Agent class for intelligent paper analysis- Simple queries
- Follow-up questions with context
- Detailed paper analysis
- Using different LLM providers (OpenAI, DeepSeek, OpenRouter)
example_advanced.py: Advanced Agent usage patterns- Literature reviews
- Methodology comparisons
- Concept explanations
- Research trend analysis
- Finding related work
- Multi-query interactive sessions
- Set up your API tokens as environment variables:
# deepxiv CLI auto-registers DEEPXIV_TOKEN on first use and saves it to ~/.env
# You can also set it manually if needed:
export DEEPXIV_TOKEN="your_deepxiv_token"
export OPENAI_API_KEY="your_openai_key"
# Or for DeepSeek:
export DEEPSEEK_API_KEY="your_deepseek_key"- Install the package:
pip install deepxiv-sdk[all]- Run an example:
python examples/quickstart.py
python examples/example_reader.py
python examples/example_agent.py
python examples/example_advanced.pyAll examples can be customized by:
- Changing the model (e.g., "gpt-4", "gpt-3.5-turbo", "deepseek-chat")
- Adjusting parameters (temperature, max_tokens, max_llm_calls)
- Using different LLM providers (OpenAI, DeepSeek, OpenRouter, etc.)
- Modifying the queries to suit your research needs
- Use
print_process=Trueto see the agent's reasoning steps - Use
stream=Truefor real-time response streaming - Start with simpler queries and build up to more complex ones
- The agent maintains context across queries, so you can ask follow-up questions
- Use
agent.reset_papers()to start fresh on a new topic