Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1edcd90
Add AKD type protocols for framework-agnostic contracts
NISH1001 Apr 16, 2026
96b6a21
Add ConfigBindingMixin for opt-in config + metadata binding
NISH1001 Apr 16, 2026
0ec100b
Fold StreamingMixin and AsyncRunMixin into AbstractBase
NISH1001 Apr 16, 2026
772c286
Remove dead extraction module and clean up references
NISH1001 Apr 16, 2026
07ff2de
Add standalone validate_input/validate_output functions
NISH1001 Apr 16, 2026
3684ff4
Delegate _validate_input/_validate_output to standalone functions
NISH1001 Apr 16, 2026
1311790
Move config property creation and metadata binding to ConfigBindingMixin
NISH1001 Apr 16, 2026
5086044
Drop AbstractBaseMeta and UnrestrictedAbstractBase
NISH1001 Apr 16, 2026
3dda19b
Reorder AbstractBase bases: Generic before ABC
NISH1001 Apr 17, 2026
7703ded
Fold ToolCallingMixin into AKDAgent
NISH1001 Apr 17, 2026
6fa063a
Fix granite think tests to skip per specific Ollama model availability
NISH1001 Apr 17, 2026
58a06f3
Remove dead nodes/ package and trim common_types.py
NISH1001 Apr 17, 2026
2993c61
Remove dead schema-info properties; move union handling into _format_…
NISH1001 Apr 17, 2026
fb91ab6
Add effective_system_prompt property; keep _system_prompt as backward…
NISH1001 Apr 17, 2026
319e454
Remove ParamExposureMixin and exposed_param decorator
NISH1001 Apr 17, 2026
d960bc5
Add AKDBaseAgent alias for BaseAgent
NISH1001 Apr 17, 2026
9d7edd1
Update docs to match the refactor state
NISH1001 Apr 20, 2026
0e0494f
Merge pull request #426 from NASA-IMPACT/refactor/akd-protocols
NISH1001 Apr 20, 2026
0f7cac4
Add is_empty structural emptiness check for OutputSchema
NISH1001 Apr 20, 2026
f2713ba
Merge pull request #431 from NASA-IMPACT/feature/output-emptiness
NISH1001 Apr 20, 2026
771d7c3
Remove search agents and related tools/tests/scripts
NISH1001 Apr 21, 2026
5c19c4c
Remove GapAgent and its tests/profilers
NISH1001 Apr 21, 2026
31db31b
Remove LitAgent deprecation shim
NISH1001 Apr 21, 2026
1d4c682
Remove dead extraction schemas from structures
NISH1001 Apr 21, 2026
a94f62e
Empty planner AVAILABLE_AGENTS; drop tests tied to removed agents
NISH1001 Apr 21, 2026
c8af5c0
Clear mapping JSON caches; refresh mapping README and tests
NISH1001 Apr 21, 2026
99f89a6
Refresh top-level docs and scripts for agent removal
NISH1001 Apr 21, 2026
6c424c4
Remove STORM agent subpackage and its config
NISH1001 Apr 21, 2026
acb0112
Migrate mappers LLM fallback from langchain-openai to litellm
NISH1001 Apr 21, 2026
447c91c
Gate AKDSerializer langgraph dependency via lazy import
NISH1001 Apr 21, 2026
d74e308
Move langchain/langgraph out of core deps; add serializer extra
NISH1001 Apr 21, 2026
2d9a8da
Drop stale langgraph node-template docs and requirements.txt lines
NISH1001 Apr 21, 2026
3f52b01
Document optional extras (serializer, ml, dev, local) in README
NISH1001 Apr 21, 2026
9cb81ac
Remove QueryAgent, IntentAgent, FollowUpQueryAgent and dead factories
NISH1001 Apr 22, 2026
3ddd523
Retarget test_mappers off removed QueryAgent schemas
NISH1001 Apr 22, 2026
6698e93
Drop orphaned prompts from removed agents
NISH1001 Apr 22, 2026
75b206f
Update docs for removed query/intent/storm agents
NISH1001 Apr 22, 2026
0c7a899
Drop 7 unused deps (STORM orphans + ollama/chromedriver SDKs)
NISH1001 Apr 22, 2026
7ef2e39
Merge pull request #432 from NASA-IMPACT/refactor/remove-bloat
NISH1001 Apr 23, 2026
5641cd3
Bump version to 0.2.0
NISH1001 Apr 23, 2026
20d018b
Merge pull request #433 from NASA-IMPACT/version/0.2.0
NISH1001 Apr 23, 2026
1ecc779
Widen RunContext.messages to list[Any] for adapter flexibility
NISH1001 Apr 27, 2026
c65a9a6
Merge pull request #435 from NASA-IMPACT/bugfix/run-context-messages
NISH1001 Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,22 @@ See `docs/design_philosophy.md` for full design principles.

### Base System (`akd/_base/`)

Everything inherits from `AbstractBase` or `UnrestrictedAbstractBase`. See `docs/specs/AKD_BASE.md` for the full reference.
Everything inherits from `AbstractBase`. See `docs/specs/AKD_BASE.md` for the full reference.

**Key exports from `akd._base`:**

| Class | Purpose |
| Class / Protocol | Purpose |
|-------|---------|
| `AbstractBase` | Strict base with schema validation (agents, tools) |
| `AbstractBase` | Concrete base with schema validation, streaming, and config binding (agents, tools) |
| `InputSchema` / `OutputSchema` / `IOSchema` | Typed schemas with required docstrings |
| `BaseConfig` | Configuration base |
| `StreamEvent` / `StreamingMixin` | Streaming event system |
| `ToolCall` / `ToolResult` / `ToolCallingMixin` | Tool calling infrastructure |
| `ConfigBindingMixin` | Opt-in: config property binding + metadata binding (already on `AbstractBase`) |
| `AKDExecutable` / `AKDTool` / `RunContextProtocol` | Structural protocols — framework adapters satisfy these without inheriting `BaseAgent` / `BaseTool` |
| `StreamEvent` | Streaming event hierarchy |
| `ToolCall` / `ToolResult` | Tool calling data models |
| `RunContext` | Execution context passed to agents (in `_base/structures.py`) |
| `HumanResponse` | Human reply for HITL resumption (in `_base/structures.py`) |
| `Memory` | Message storage with session lifecycle |
| `validate_input` / `validate_output` | Standalone schema validators for non-inheriting adapters |

### Adding Agents or Tools

Expand Down Expand Up @@ -97,7 +99,6 @@ See specs:

**`akd/structures.py`** (public, also re-exports `HumanResponse`):
- `SearchResult` / `SearchResultItem` — search results with metadata
- `ExtractionSchema` / `SingleEstimation` — extraction output schemas
- `HumanResponse` — re-exported for backend convenience

## Project Structure
Expand All @@ -107,26 +108,20 @@ akd/
├── _base/ # Base classes, streaming, tool calling, memory, structures
├── agents/ # Agent implementations
│ ├── _base.py # BaseAgent, InstructorBaseAgent, LiteLLMInstructorBaseAgent
│ ├── search/ # SearchAgent, DeepLitSearchAgent, ControlledSearchAgent, AspectSearchAgent
│ ├── gap_analysis/ # GapAgent
│ ├── extraction.py # EstimationExtractionAgent
│ ├── query.py # QueryAgent, FollowUpQueryAgent
│ ├── relevancy.py # Relevancy checking agents
│ ├── storm/ # STORM workflow agent
│ └── intents.py # Intent detection
│ └── relevancy.py # RelevancyAgent, MultiRubricRelevancyAgent
├── tools/ # Tool implementations
│ ├── _base.py # BaseTool, BaseToolConfig
│ ├── human.py # HumanTool (HITL)
│ ├── search/ # SearxNG, Serper, SemanticScholar, CodeSearch, Composite, Pipeline
│ ├── search/ # SearxNG, Serper, SemanticScholar, Composite, Pipeline
│ ├── scrapers/ # Web, PDF, Crawl4AI, PyPaperBot, Docling scrapers
│ ├── resolvers/ # DOI, Arxiv, ADS, Unpaywall resolvers
│ ├── reranker.py # CrossEncoder, NoOp rerankers
│ ├── relevancy.py # Relevancy checker
│ └── source_validator.py
├── configs/ # Configuration (project, prompts, lit, storm)
├── configs/ # Configuration (project, prompts, lit)
├── guardrails/ # Safety and validation guardrails
├── mapping/ # Agent/tool registry and field mapping
├── planner/ # Workflow planning
├── mapping/ # Runtime agent registry + field-mapping machinery
├── planner/ # Workflow planning (agents registered at runtime)
└── structures.py # Public data structures

tests/ # Mirrors akd/ structure — pytest + asyncio + xdist
Expand Down
57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,13 @@ This works across any transport — REST APIs, WebSockets, CLI — because the p

| Category | Agent | Description |
|----------|-------|-------------|
| **Research** | `DeepLitSearchAgent` | Multi-agent deep literature search with triage, clarification, and synthesis |
| | `ControlledSearchAgent` | Controlled search with configurable parameters |
| | `AspectSearchAgent` | Interview-pattern multi-aspect search |
| | `CodeSearchAgent` | Code repository search |
| | `QuestionAnsweringAgent` | QA over retrieved content |
| **Analysis** | `GapAgent` | Research gap identification via knowledge graphs |
| | `EstimationExtractionAgent` | Intent-based data extraction |
| | `StormAgent` | Structured narrative generation |
| **Utility** | `IntentAgent` | User intent classification |
| | `QueryAgent` | Query reformulation and refinement |
| | `FollowUpQueryAgent` | Follow-up query generation |
| | `RelevancyAgent` | Binary relevance classification |
| **Utility** | `RelevancyAgent` | Binary relevance classification |
| | `MultiRubricRelevancyAgent` | Multi-dimensional relevance scoring |
| **Base** | `BaseAgent` | Core agent with streaming, tool calling, HITL, message trimming |
| | `LiteLLMInstructorBaseAgent` | Structured Pydantic output via Instructor |

Domain-specific agents live in downstream packages and can be registered at runtime via `AgentRegistry.register_agent(YourAgent)`.

## Out-of-Box Tools

| Category | Tool | Description |
Expand Down Expand Up @@ -214,25 +205,52 @@ dependencies = [
]
```

**Optional extras:** pull in extra dependencies for specific features.

| Extra | What it pulls in | Install when you... |
|---|---|---|
| `serializer` | `langgraph` | use `AKDSerializer` as a langgraph checkpoint serde (e.g. `AsyncPostgresSaver(serde=AKDSerializer())`) |
| `ml` | `pandas`, `sentence-transformers`, `docling`, `deepeval` | need ML-backed rerankers, scrapers, or eval tools |
| `dev` | `pytest`, `pytest-asyncio`, `pytest-cov`, `pytest-xdist`, `pre-commit`, `memray`, `scalene` | run the test suite or hack on akd itself |
| `local` | `marimo`, `jupyter`, `ipykernel`, `ipywidgets` | run the marimo notebooks under `notebooks/` |

```bash
# As a dependency, with an extra:
uv pip install "akd[serializer] @ git+https://github.com/NASA-IMPACT/accelerated-discovery.git@develop"
```

```toml
# In your pyproject.toml:
dependencies = [
"akd[serializer] @ git+https://github.com/NASA-IMPACT/accelerated-discovery.git@develop",
]
```

**For local development:**

```bash
# Create and activate virtual environment
uv venv --python 3.12
source .venv/bin/activate

# Install dependencies
# Install core dependencies
uv sync

# For development (includes testing tools)
# With development tooling (pytest, pre-commit, profilers)
uv sync --extra dev

# For local development (includes marimo and other local tools)
# With notebooks (marimo, jupyter)
uv sync --extra dev --extra local

# For ML features (includes sentence-transformers, docling, deepeval)
# With ML extras (pandas, sentence-transformers, docling, deepeval)
uv sync --extra ml

# With the langgraph checkpoint serde (AKDSerializer)
uv sync --extra serializer

# Combine extras freely, e.g. full dev setup:
uv sync --extra dev --extra local --extra ml --extra serializer

# Setup environment variables
cp .env.example .env
# Edit .env with your API keys
Expand All @@ -259,13 +277,6 @@ scripts/ # Utility scripts and demos
tests/ # Test suite (mirrors akd/ structure)
```

## Roadmap

These features are part of the design vision but not yet fully implemented:

- **Conflict Agent** — a dedicated agent that specifically searches for contradictory evidence and conflicting findings across sources. Currently, conflict detection is a design principle (see [Design Philosophy](docs/design_philosophy.md)) but lacks a standalone agent implementation.
- **Full Attribution Chain** — end-to-end traceability from final claims back to specific source sentences. Partial support exists today: `GapAgent` provides `attributed_source_answers` and the guardrail system includes an `ATTRIBUTION` risk category.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, style guide, branch conventions, and how to create agents and tools.
Expand Down
23 changes: 3 additions & 20 deletions akd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,15 @@
try:
__version__ = _version("akd")
except PackageNotFoundError:
__version__ = "0.1.1"
__version__ = "0.2.0"
__author__ = "NASA IMPACT"
__email__ = "np0069@uah.edu,mr0051@uah.edu"

# Core base classes
from akd._base import (
AbstractBase,
BaseConfig,
InputSchema,
IOSchema,
OutputSchema,
UnrestrictedAbstractBase,
)
from akd._base import AbstractBase, BaseConfig, InputSchema, IOSchema, OutputSchema

# Core structures
from akd.structures import (
ExtractionSchema,
ResearchData,
SearchResultItem,
SingleEstimation,
ToolSearchResult,
)
from akd.structures import SearchResultItem, ToolSearchResult

# Tool system
from akd.tools._base import BaseTool, BaseToolConfig
Expand All @@ -50,7 +37,6 @@
"__email__",
# Base classes
"AbstractBase",
"UnrestrictedAbstractBase",
"BaseConfig",
"IOSchema",
"InputSchema",
Expand All @@ -60,8 +46,5 @@
"BaseToolConfig",
# Core structures
"SearchResultItem",
"ResearchData",
"ExtractionSchema",
"SingleEstimation",
"ToolSearchResult",
]
28 changes: 15 additions & 13 deletions akd/_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

from ._base import (
AbstractBase,
AbstractBaseMeta,
AsyncRunMixin,
BaseConfig,
InputSchema,
IOSchema,
OutputSchema,
TextInput,
TextOutput,
UnrestrictedAbstractBase,
)
from .config_binding import ConfigBindingMixin
from .errors import HumanInputRequired
from .exposure import ParamExposureMixin, exposed_param
from .protocols import AKDExecutable, AKDRunContext, AKDTool, RunContextProtocol
from .session import AgentSession, BaseSession, ToolSession
from .streaming import (
CompletedEvent,
Expand Down Expand Up @@ -44,13 +42,12 @@
ToolResultEventData,
)
from .structures import HumanResponse, RunContext
from .tool_calling import ToolCall, ToolCallingMixin, ToolResult
from .tool_calling import ToolCall, ToolResult
from .validation import validate_input, validate_output, validate_schema

__all__ = [
# Base classes
"AbstractBase",
"UnrestrictedAbstractBase",
"AsyncRunMixin",
# Schema classes
"IOSchema",
"InputSchema",
Expand All @@ -59,11 +56,6 @@
"TextOutput",
# Config classes
"BaseConfig",
# Metadata and decorators
"exposed_param",
"ParamExposureMixin",
# Metaclass
"AbstractBaseMeta",
# Streaming
"StreamEvent",
"StreamEventType",
Expand Down Expand Up @@ -96,9 +88,19 @@
# Tool calling
"ToolCall",
"ToolResult",
"ToolCallingMixin",
# Context
"RunContext",
"AKDRunContext",
# Protocols
"AKDExecutable",
"AKDTool",
"RunContextProtocol",
# Config binding
"ConfigBindingMixin",
# Validation
"validate_input",
"validate_output",
"validate_schema",
# Human interaction
"HumanResponse",
"HumanInputRequired",
Expand Down
Loading
Loading