This application processes documents using Docling and PydanticAI to identify and extract requirements from policy documents.
- Install dependencies using UV:
# Create and activate a virtual environment
uv venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
# Install the project in editable mode (-e)
# This allows you to modify the code without reinstalling
uv install -e .- Create a
.envfile in the root directory and add your Anthropic API key:
ANTHROPIC_API_KEY=your_api_key_here
- Place your policy documents in the
policy-documentsdirectory.
Run the application:
uv run src/main.pyThe application will:
- Load all documents from the
policy-documentsdirectory - Process each document to identify requirements
- Save identified requirements to
requirement-output.json
Requirements are saved in JSON format with the following structure:
{
"id": "REQ-001",
"text": "The actual requirement text",
"type": "functional|non-functional|security|performance",
"priority": "high|medium|low",
"dependencies": ["REQ-X", "REQ-Y"]
}