Metadata-Version: 2.4
Name: naive-knowledge-base
Version: 0.1.3
Summary: A dependency graph analyzer using smolagents
Home-page: https://github.com/yourusername/naive-knowledge-base
Author: Your Name
Author-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/naive-knowledge-base
Project-URL: Documentation, https://github.com/yourusername/naive-knowledge-base#readme
Project-URL: Repository, https://github.com/yourusername/naive-knowledge-base
Project-URL: Issues, https://github.com/yourusername/naive-knowledge-base/issues
Keywords: dependency-graph,code-analysis,smolagents,ai-agents
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: annotated-types==0.7.0
Requires-Dist: anyio==4.12.0
Requires-Dist: astroid==4.0.2
Requires-Dist: attrs==25.4.0
Requires-Dist: autopep8==2.3.2
Requires-Dist: certifi==2025.11.12
Requires-Dist: charset-normalizer==3.4.4
Requires-Dist: click==8.3.1
Requires-Dist: colorama==0.4.6
Requires-Dist: coloredlogs==15.0.1
Requires-Dist: dill==0.4.0
Requires-Dist: directory_tree==1.0.0
Requires-Dist: distro==1.9.0
Requires-Dist: flow-code-mapper==2.0.1
Requires-Dist: filelock==3.20.1
Requires-Dist: fsspec==2025.12.0
Requires-Dist: gitdb==4.0.12
Requires-Dist: GitPython==3.1.45
Requires-Dist: h11==0.16.0
Requires-Dist: hf-xet==1.2.0
Requires-Dist: httpcore==1.0.9
Requires-Dist: httpx==0.28.1
Requires-Dist: huggingface_hub==1.2.3
Requires-Dist: humanfriendly==10.0
Requires-Dist: idna==3.11
Requires-Dist: interrogate==1.7.0
Requires-Dist: isort==7.0.0
Requires-Dist: Jinja2==3.1.6
Requires-Dist: jiter==0.12.0
Requires-Dist: joblib==1.5.3
Requires-Dist: lizard==1.19.0
Requires-Dist: markdown-it-py==4.0.0
Requires-Dist: MarkupSafe==3.0.3
Requires-Dist: mccabe==0.7.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: networkx==3.6.1
Requires-Dist: numpy==2.3.5
Requires-Dist: openai==2.12.0
Requires-Dist: packaging==25.0
Requires-Dist: pathspec==0.12.1
Requires-Dist: pillow==12.0.0
Requires-Dist: platformdirs==4.5.1
Requires-Dist: prettytable==3.17.0
Requires-Dist: py==1.11.0
Requires-Dist: pycodestyle==2.14.0
Requires-Dist: pydantic==2.12.5
Requires-Dist: pydantic_core==2.41.5
Requires-Dist: PyDriller==2.9
Requires-Dist: Pygments==2.19.2
Requires-Dist: pylint==4.0.4
Requires-Dist: pyparsing==3.2.5
Requires-Dist: pyperclip==1.11.0
Requires-Dist: python-dotenv==1.2.1
Requires-Dist: python-louvain==0.16
Requires-Dist: pytz==2025.2
Requires-Dist: PyYAML==6.0.3
Requires-Dist: requests==2.32.5
Requires-Dist: rich==14.2.0
Requires-Dist: scikit-learn==1.8.0
Requires-Dist: scipy==1.16.3
Requires-Dist: setuptools==80.9.0
Requires-Dist: shellingham==1.5.4
Requires-Dist: smmap==5.0.2
Requires-Dist: smolagents==1.16.1
Requires-Dist: sniffio==1.3.1
Requires-Dist: tabulate==0.9.0
Requires-Dist: threadpoolctl==3.6.0
Requires-Dist: tomlkit==0.13.3
Requires-Dist: toon_format==0.1.0
Requires-Dist: tqdm==4.67.1
Requires-Dist: typer-slim==0.20.0
Requires-Dist: types-pytz==2025.2.0.20251108
Requires-Dist: typing-inspection==0.4.2
Requires-Dist: typing_extensions==4.15.0
Requires-Dist: urllib3==2.6.2
Requires-Dist: wcwidth==0.2.14
Requires-Dist: wheel==0.45.1
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: isort>=5.10.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=2.20.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Naive Knowledge Base

A dependency graph analyzer using smolagents for building and analyzing code dependencies.

## Features

- 🔍 **Dependency Graph Generation**: Automatically generate dependency graphs from source code
- 🤖 **AI-Powered Analysis**: Uses smolagents for intelligent code analysis
- 📊 **Multiple Language Support**: Support for Java and other languages
- 🌳 **Directory Tree Visualization**: Generate visual representations of project structure
- 📝 **File Operations**: Read, write, and manage files programmatically

## Installation

### From Source

```bash
git clone https://github.com/yourusername/naive-knowledge-base.git
cd naive-knowledge-base
pip install -e .
```

### From PyPI (when published)

```bash
pip install naive-knowledge-base
```

## Requirements

- Python 3.8+
- OpenAI API key (or compatible API)

## Configuration

Create a `.env` file in your project directory with the following:

```env
OPENAI_API_KEY=your_api_key_here
# Or configure your API endpoint
API_BASE_URL=your_api_base_url
```

## Usage

### Command Line Interface

After installation, you can use the `naive-kb` command:

```bash
# Basic usage
naive-kb /path/to/source/directory

# Specify file extensions
naive-kb /path/to/source/directory java

# Specify directories to ignore
naive-kb /path/to/source/directory java "target,.git,test,node_modules"
```

### Python API

```python
from naive_knowledge_base import run_analysis

# Run dependency graph analysis
result = run_analysis(
    source_directory="/path/to/source",
    file_extensions="java",
    ignore_dirs="target,.git,test"
)
```

### Advanced Usage

```python
from smolagents import CodeAgent, ToolCallingAgent
from naive_knowledge_base.api_models import FlowApiModel
from naive_knowledge_base.tools import (
    save_content_to_file,
    read_file_content,
    delete_folder_or_file,
    generate_folder_tree
)
from naive_knowledge_base.agents.dependency_graph import generate_dependency_graph

# Create custom agents
model = FlowApiModel(model_id="gpt-4.1", temperature=0.5)

dependency_agent = ToolCallingAgent(
    tools=[generate_dependency_graph],
    model=model,
    max_steps=7,
    name="dependency_graph_agent"
)

manager_agent = CodeAgent(
    managed_agents=[dependency_agent],
    model=model,
    tools=[read_file_content, save_content_to_file],
    max_steps=30,
    name="tech_lead_agent"
)

# Run analysis
result = manager_agent.run("Analyze dependencies in /path/to/source")
```

## Package Structure

```
naive_knowledge_base/
├── agents/
│   ├── common/          # Common agent utilities
│   │   ├── base.py
│   │   ├── exceptions.py
│   │   ├── logging.py
│   │   └── utils.py
│   └── dependency_graph/  # Dependency graph analysis
│       ├── agent.py
│       └── model.py
├── api_models/          # API model integrations
│   └── flow_api_model.py
└── tools/              # Agent tools
    ├── io.py           # File I/O operations
    └── tree.py         # Directory tree generation
```

## Development

### Setup Development Environment

```bash
# Clone the repository
git clone https://github.com/yourusername/naive-knowledge-base.git
cd naive-knowledge-base

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in editable mode with dev dependencies
pip install -e ".[dev]"
```

### Running Tests

```bash
pytest tests/
```

### Code Formatting

```bash
# Format code
black .
isort .

# Check code quality
pylint naive_knowledge_base/
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Acknowledgments

- Built with [smolagents](https://github.com/huggingface/smolagents)
- Uses OpenAI API for AI-powered analysis

## Support

For issues and questions, please file an issue on the [GitHub repository](https://github.com/yourusername/naive-knowledge-base/issues).
