open-ended argument mapping
- Open-ended types: LLM chooses appropriate node and edge types for each argument
- Provenance tracking: Links claims back to exact positions in source text
- Interactive visualization: Force-directed graph with draggable nodes
- Flexible API: Supports Gemini API key or Google Cloud Project authentication
# Install dependencies
pip install -r requirements.txt
# Set your API key
export GEMINI_API_KEY="your-key"
# OR
export GOOGLE_CLOUD_PROJECT="your-project"
# OR leave it to the frontend
# Run the server
python server.pyServer runs at http://localhost:8000
cd frontend
npm install
VITE_API_URL=http://localhost:8000 npm run devFrontend runs at http://localhost:5173
- Enter philosophical or argumentative text
- (Optional) Enter your Gemini API key
- Click "Extract Argument Map"
- Explore the graph, summary, and JSON output
- Click on nodes/edges to see details
Extract argument map from text.
Request:
{
"text": "Your philosophical text here...",
"api_key": "optional-api-key",
"temperature": 0.0,
"model": "gemini-2.5-flash"
}Response:
{
"success": true,
"result": {
"version": "1.0",
"source_text": "...",
"nodes": [
{
"id": "n1",
"content": "the claim",
"type": "premise",
"rhetorical_force": "asserts",
"span": {"start": 0, "end": 50}
}
],
"edges": [
{
"source": "n1",
"target": "n2",
"type": "supports",
"explanation": "provides evidence for"
}
],
"summary": "Overview of the argument",
"key_tensions": ["list of gaps or issues"]
}
}GEMINI_API_KEY: Gemini API keyGOOGLE_CLOUD_PROJECT: Google Cloud project (for Vertex AI)GOOGLE_CLOUD_LOCATION: Cloud location (default: us-central1)LLM_MODEL: Model to use (default: gemini-2.5-flash)CACHE_LLM: Enable LLM response cachingLLM_CACHE_DIR: Cache directory (default: .cache/llm)
argmap/
├── argmap/
│ ├── llm.py # LLM client with dual auth
│ ├── schema.py # Pydantic models
│ ├── prompts.py # Extraction prompts
│ └── extract.py # Core extraction logic
├── frontend/
│ ├── src/
│ │ ├── App.tsx # Main application
│ │ ├── types/ # TypeScript types
│ │ └── components/
│ │ ├── ArgumentGraph.tsx # Graph visualization
│ │ └── NodeDetails.tsx # Detail panel
├── server.py # FastAPI server
└── requirements.txt
MIT