# π§ CAJAL
> **Cognitive Academic Journal Authoring Layer** β Generate publication-ready scientific papers locally, for free, with zero cloud dependency.
[](https://pypi.org/project/cajal-p2pclaw/)
[](LICENSE)
[](https://github.com/Agnuxo1/CAJAL)
[](https://huggingface.co/Agnuxo)
[](https://p2pclaw.com)
[](https://github.com/sponsors/Agnuxo1)
---
> **Part of the P2PCLAW ecosystem.** For the protocol overview, live network, paper, MCP gateway, and ecosystem map, start at [Agnuxo1/OpenCLAW-P2P](https://github.com/Agnuxo1/OpenCLAW-P2P).
## What is CAJAL?
CAJAL is a **local scientific paper generator** that runs entirely on your machine. No API keys. No subscriptions. No data leaves your computer.
Named after **Santiago RamΓ³n y Cajal**, the father of modern neuroscience, whose pioneering work on neural networks mirrors our mission: making the generation of scientific knowledge accessible, decentralized, and free.
### Key Features
| Feature | Description |
|---------|-------------|
| π **100% Local** | All computation runs on your hardware. Zero data exfiltration. |
| π **Zero Cost** | MIT license. No subscriptions, no tiers, no limits. |
| π **Publication Ready** | 7-section papers: Abstract β Introduction β Methods β Results β Discussion β Conclusion β References. |
| π **Real Citations** | Integrates with arXiv and CrossRef for verifiable, real references. No hallucinated citations. |
| βοΈ **Tribunal Scoring** | 8β10 LLM judges evaluate each paper on 10 quality dimensions. Instant peer review. |
| π **100+ Integrations** | Native kits for LangChain, CrewAI, AutoGen, LlamaIndex, VS Code, Jupyter, Ollama, and more. |
| π€ **Any LLM** | Works with any Ollama-compatible model. Bring your own weights. |
---
## How It Works
```
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Research Idea ββββββΆβ CAJAL EngineββββββΆβ Full Paper β
β (your input) β β (local LLM) β β (markdown/LaTeXβ
βββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
"Quantum error Structured generation Real citations
correction with with system prompt from arXiv/
surface codes" enforcing academic CrossRef
structure and rigor
```
### Paper Structure
Every paper generated by CAJAL follows the standard academic format:
1. **Abstract** (150β250 words) β Background, methods, key results, conclusion
2. **Introduction** β Context, problem statement, objectives, significance
3. **Related Work** β 3β5 cited papers with real references
4. **Methodology** β Detailed, reproducible procedures
5. **Results** β Data-driven findings
6. **Discussion** β Interpretation, limitations, future work
7. **Conclusion** β Summary of contributions
8. **References** β Real, verifiable citations (minimum 8)
### Quality Assurance
```
Your Paper βββΆ Tribunal (8-10 LLM Judges)
β
βββ Novelty Score
βββ Methodological Soundness
βββ Citation Quality
βββ Argument Strength
βββ Reproducibility
βββ Clarity & Precision
βββ Technical Depth
βββ Overall Publishability
β
βΌ
Final Score + Improvement Suggestions
```
---
## Installation
### Quick Start (30 seconds)
```bash
# 1. Install CAJAL
pip install cajal-p2pclaw
# 2. Install Ollama (if not already installed)
# macOS: brew install ollama
# Linux: curl -fsSL https://ollama.com/install.sh | sh
# 3. Create the CAJAL model
ollama create cajal -f integrations/ollama/Modelfile
# 4. Generate your first paper
python -c "from cajal_p2pclaw import PaperGenerator; \
PaperGenerator().generate('Quantum error correction with surface codes')"
```
### Requirements
- Python 3.8+
- [Ollama](https://ollama.com) installed and running
- Any Ollama-compatible model (llama3.1, qwen3.5, mistral, etc.)
---
## Usage
### Command Line
```bash
# Generate a full paper
cajal generate "Federated learning for medical imaging privacy"
# Generate only an abstract
cajal abstract "Neural architecture search for edge devices"
# Generate methodology section
cajal methods "Differential privacy in distributed training"
# Find references for a topic
cajal references "Byzantine fault tolerance in P2P networks" --count 12
# Review an existing draft
cajal review draft.md
```
### Python API
```python
from cajal_p2pclaw import PaperGenerator
# Initialize
gen = PaperGenerator(model="cajal", host="http://localhost:11434")
# Generate a full paper
paper = gen.generate(
topic="Quantum machine learning for drug discovery",
format="markdown", # or "latex", "pdf"
min_references=10
)
print(paper)
# Generate specific sections
abstract = gen.generate_abstract("Neural architecture search")
methods = gen.generate_methods("Federated learning with differential privacy")
refs = gen.find_references("Byzantine consensus mechanisms", count=12)
```
### JavaScript / TypeScript
```typescript
import { CAJAL } from 'cajal-p2pclaw';
const cajal = new CAJAL({ model: 'cajal' });
const paper = await cajal.generatePaper({
topic: 'Neural architecture search for resource-constrained devices',
format: 'markdown',
minReferences: 10
});
console.log(paper);
```
---
## Native Integrations
One config file. Zero dependencies. Works everywhere.
### Agent Frameworks
| Platform | Integration | File |
|----------|-------------|------|
| **LangChain** | LLM wrapper | [`integrations/langchain/llm.py`](integrations/langchain/llm.py) |
| **CrewAI** | Multi-agent PaperCrew | [`integrations/crewai/llm.py`](integrations/crewai/llm.py) |
| **AutoGen** | 4-agent setup | [`integrations/autogen/client.py`](integrations/autogen/client.py) |
| **LlamaIndex** | Query Engine + Tool | [`integrations/llamaindex/llm.py`](integrations/llamaindex/llm.py) |
### IDEs & Editors
| Platform | Integration | File |
|----------|-------------|------|
| **VS Code** | Settings + commands | [`integrations/vscode/cajal.json`](integrations/vscode/cajal.json) |
| **Continue.dev** | Slash commands | [`integrations/continue_dev/config.yaml`](integrations/continue_dev/config.yaml) |
| **Cursor** | Config | [`integrations/vscode/cajal.json`](integrations/vscode/cajal.json) |
### Local LLM Platforms
| Platform | Integration | File |
|----------|-------------|------|
| **Ollama** | Modelfile | [`integrations/ollama/Modelfile`](integrations/ollama/Modelfile) |
| **Open WebUI** | Function | [`integrations/openwebui/function.py`](integrations/openwebui/function.py) |
| **Jan** | Model config | [`integrations/jan/`](integrations/jan/) |
| **LM Studio** | README | [`integrations/lmstudio/`](integrations/lmstudio/) |
| **Pinokio** | install.json | [`integrations/pinokio/`](integrations/pinokio/) |
### Notebook & Publishing
| Platform | Integration | File |
|----------|-------------|------|
| **Jupyter** | `%%cajal` magic | [`integrations/jupyter/cajal_magic.py`](integrations/jupyter/cajal_magic.py) |
| **Quarto** | Extension filter | [`integrations/quarto/`](integrations/quarto/) |
### DevOps & Automation
| Platform | Integration | File |
|----------|-------------|------|
| **Docker** | Full stack | [`integrations/docker/docker-compose.yml`](integrations/docker/docker-compose.yml) |
| **GitHub Actions** | Workflow | [`integrations/github_actions/cajal-paper.yml`](integrations/github_actions/cajal-paper.yml) |
### Browser & Desktop
| Platform | Integration | File |
|----------|-------------|------|
| **Chrome Extension** | Popup + floating button | [`integrations/chrome_extension/`](integrations/chrome_extension/) |
| **npm SDK** | TypeScript package | [`integrations/npm/`](integrations/npm/) |
### P2PCLAW Ecosystem Agents
- **OpenClaw** β [`integrations/openclaw/`](integrations/openclaw/)
- **Hermes** β [`integrations/hermes/`](integrations/hermes/)
- **NanoClaw** β [`integrations/nanoclaw/`](integrations/nanoclaw/)
- **Devian** β [`integrations/devian/`](integrations/devian/)
- **AgenteZero** β [`integrations/agentezero/`](integrations/agentezero/)
- **KiloClaw** β [`integrations/kiloclaw/`](integrations/kiloclaw/)
- **KimiClaw** β [`integrations/kimiclaw/`](integrations/kimiclaw/)
---
## Project Structure
```
CAJAL/
βββ cajal_p2pclaw/ # PyPI package source
β βββ __init__.py
β βββ generator.py # Core paper generation engine
β βββ tribunal.py # LLM jury scoring system
β βββ citations.py # arXiv/CrossRef integration
β βββ cli.py # Command-line interface
β βββ formats.py # Markdown / LaTeX / PDF exporters
βββ integrations/ # 100+ native integration kits
β βββ ollama/ # Modelfile
β βββ langchain/ # LLM wrapper
β βββ crewai/ # Agent tool
β βββ autogen/ # Multi-agent client
β βββ llamaindex/ # Query engine
β βββ vscode/ # Editor settings
β βββ continue_dev/ # Copilot config
β βββ jupyter/ # Magic command
β βββ quarto/ # Extension filter
β βββ docker/ # Compose stack
β βββ github_actions/ # CI workflow
β βββ chrome_extension/ # Browser extension
β βββ npm/ # JS/TS SDK
β βββ ... # +88 more
βββ docs/
β βββ landing-page.html # Promotional flyer
β βββ TARGETS.md # 100 target projects
β βββ SOCIAL_MEDIA_PACK.md # Outreach content
βββ scripts/
β βββ submit-to-targets.sh # Mass outreach automation
βββ PR_TEMPLATE.md # Gift-economy PR template
βββ OUTREACH_EMAIL_TEMPLATE.md
βββ README.md # This file
βββ LICENSE # MIT
```
---
## The Gift Economy
CAJAL is not a product. It is a **public good**.
- No paywalls
- No feature tiers
- No data harvesting
- No venture capital
Funded by [GitHub Sponsors](https://github.com/sponsors/Agnuxo1) and sustained by contributors who believe that scientific writing tools should be as accessible as scientific knowledge itself.
We give integration kits to open-source projects **freely and unconditionally**. If you maintain a project and want CAJAL native support, open an issue β we'll build it.
---
## Community & Support
| Channel | Link |
|---------|------|
| GitHub Issues | [Agnuxo1/CAJAL/issues](https://github.com/Agnuxo1/CAJAL/issues) |
| Live Demo | [p2pclaw.com/silicon](https://www.p2pclaw.com/silicon) |
| HuggingFace | [huggingface.co/Agnuxo](https://huggingface.co/Agnuxo) |
| PyPI | [pypi.org/project/cajal-p2pclaw](https://pypi.org/project/cajal-p2pclaw/) |
---
## Citation
If you use CAJAL in your research, please cite:
```bibtex
@software{cajal2026,
title = {CAJAL: Cognitive Academic Journal Authoring Layer},
author = {Angulo de Lafuente, Francisco},
organization = {P2PCLAW Research Network},
year = {2026},
url = {https://github.com/Agnuxo1/CAJAL}
}
```
---
## License
This project is licensed under the **MIT License**. See [LICENSE](LICENSE) for details.
> *"The brain is a world consisting of a number of unexplored continents and great stretches of unknown territory."*
> β **Santiago RamΓ³n y Cajal** (1852β1934)
---
**Created by** [Francisco Angulo de Lafuente](https://github.com/Agnuxo1) (@Agnuxo1)
**Organization:** [P2PCLAW Research Network](https://p2pclaw.com)
**Copyright 2026 P2PCLAW Research**