A flexible system for analyzing legal and business documents using Ollama with the qwq model.
This system processes documents to analyze relationships, terms, and agreements between multiple entities. It's designed to be flexible and can handle various types of document analysis tasks.
- Interactive configuration
- Multi-entity document analysis
- Custom query support
- Automated response generation
- Markdown report generation
- Real-time streaming responses
- Install Ollama and the qwq model:
# Install Ollama (macOS)
brew install ollama
# Pull qwq model
ollama pull qwq- Install Python dependencies:
pip install -r requirements.txt- Place your documents in the
doc/directory:
- Any markdown (.md) files you want to analyze
- Example: contracts, agreements, correspondence, etc.
- Run the analysis:
python main.py-
Follow the interactive prompts:
- Enter the entities involved
- Specify the core objective
- Provide document paths
- Add custom queries (optional)
-
The script will:
- Process all documents
- Generate responses for default and custom queries
- Save analysis to markdown files in the
out/directory
The system includes these default queries:
- Document differences analysis
- Payment terms structure
- IP rights protection
- Document structure and relationships
You can add custom queries during runtime.
Analysis results are saved in the out/ directory as markdown files with timestamps:
out/
└── analysis_YYYYMMDD_HHMMSS.md
- Modify default queries in
main.py - Adjust context window size
- Change output format
- Add new analysis sections
MIT License. See LICENSE for more information.